Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Agent or workflow/AI step guardrails
Reference · Agent or workflow

AI step guardrails

Part of Agent or workflow. Install the skill and your agent reads this page when it needs the depth.

Output schema

Rule checks after the model

Pick the ones that apply. Each is a few lines of logic and catches a class of model error.

Setting confidence cut-offs

A model's self-reported confidence is a signal, not a probability. Calibrate it before you route on it.

  1. Run the step over at least 200 labelled real cases.
  2. Record for each case: correct or not, the self-reported confidence, whether all rule checks passed, and whether the evidence quotes were found.
  3. Group the cases into buckets and measure precision per bucket.
  4. Choose the cut-off where everything above it meets the target precision.

Example from 620 labelled cases:

Bucket Cases Correct Route
All checks pass and confidence 0.9 or more 412 99.3% Automatic
All checks pass and confidence 0.7 to 0.9 160 93% Human queue
Any check fails, or confidence under 0.7 48 71% Manual path

Result: 66% of cases go automatic at 99.3% precision. To claim 99% with confidence you need roughly 300 cases above the cut-off: with zero errors in n cases, the true error rate is still only bounded at about 3 in n.

Recheck the buckets on every prompt or model change. A cut-off set for one model version means nothing for the next.

For money fields, a second independent extraction (another prompt, or the same prompt run twice) that must agree with the first is a strong signal. It doubles the cost of that field, so use it where an error is expensive.

Fallback ladder

Failure Do Never
Timeout or transient error Retry once after a short wait, then the human queue Retry in a tight loop
Schema failure One retry with the validation error included, then the queue Accept a partial object
Business check failure Queue at once, naming the failed check Retry: the model will often repeat the same answer
Provider outage Queue everything; alert when the queue passes 50 items or the oldest is 2 hours old Switch to an untested second model
Low confidence Human queue Fill a default category

A second model is a valid fallback only after it has passed the same labelled set with the same cut-offs.

Untrusted input

Any document, email, form or web page can contain text written to steer the model. Prompt wording alone does not stop it. The structure does:

Agent budgets and stops

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.