Guide 5 of 6Guardrails, review and evals
  1. Anatomy of an automation
  2. How AI agents work
  3. RAG: answering from your documents
  4. MCP: connecting AI to tools
  5. Guardrails, review and evals
    1. Why guardrails
    2. Set the threshold
    3. Layers of protection
    4. Human in the loop, done well
    5. Evals: testing AI like software
  6. How a project runs

Production3 min readUpdated

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.

InteractiveAuto-approve above a confidence thresholdDrag the threshold

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

Guardrail layers
LayerWhat it catchesHow
Input checksMissing fields, wrong formats, personal dataValidation and redaction before the model sees it
Output schemaRambling or malformed answersStructured output that must parse, or the step fails
Confidence gateUncertain answersBelow the threshold, route to a review queue
Action policyRisky actionsRefunds over a limit, external emails, deletions need approval
LimitsRunaway loops and costsMax steps, max tokens, rate limits per run
Audit logAnything, after the factEvery 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.

One eval casejson
{ "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" }
  1. Collect real casesStart with 20-50 from the actual process, including the awkward ones.
  2. Write the expected outcomeWhat a careful person would do, in checkable terms.
  3. Run on every changeA prompt tweak that fixes one case can break three others.
  4. Track the pass rateShip when it holds; investigate any drop before going live.