Guardrails, human review and evals
How to let AI act on its own safely: thresholds, approval gates, audit logs and testing.
Includes an interactive demo: Threshold simulator
Why guardrails
Models are probabilistic. Even a very good one is sometimes confidently wrong. Guardrails are the checks around the model that decide what it’s allowed to do on its own, and what a person must see first. They’re how you get the speed of automation without betting the business on every answer.
Set the threshold
The core trade-off: a higher confidence threshold sends more items to a person, but lets fewer mistakes through. Drag it and watch the workload and error rate move. Each dot is one AI decision; hollow ones were wrong.
24 sample AI decisions with confidence scores from 0.50 to 0.99. At a 0.80 threshold, 15 are handled automatically and 9 go to a person.
Sample data. On a real project the threshold is set from a labelled test set, then reviewed monthly.
Layers of protection
| Layer | What it catches | How |
|---|---|---|
| Input checks | Missing fields, wrong formats, personal data | Validation and redaction before the model sees it |
| Output schema | Rambling or malformed answers | Structured output that must parse, or the step fails |
| Confidence gate | Uncertain answers | Below the threshold, route to a review queue |
| Action policy | Risky actions | Refunds over a limit, external emails, deletions need approval |
| Limits | Runaway loops and costs | Max steps, max tokens, rate limits per run |
| Audit log | Anything, after the fact | Every input, output and decision stored with a run id |
Human in the loop, done well
A review queue only works if reviewing is fast. Show the person the original input, the AI’s answer, why it was flagged, and one-click approve, edit or reject. Every decision they make becomes labelled data that improves the threshold and the prompt.
Evals: testing AI like software
An eval is a test suite for AI behaviour: real inputs with known good outputs, scored automatically after every change to a prompt, model or tool.
{ "case": "refund-over-limit",
"input": "Customer asks for a $450 refund on an annual plan, day 12",
"expect": { "action": "request_approval", "reason_mentions": "over $200" },
"score": "pass if action matches and reason mentions the limit" }- Collect real casesStart with 20-50 from the actual process, including the awkward ones.
- Write the expected outcomeWhat a careful person would do, in checkable terms.
- Run on every changeA prompt tweak that fixes one case can break three others.
- Track the pass rateShip when it holds; investigate any drop before going live.