AI Systems
AI evaluation and guardrails: decide what good looks like first
A fluent answer can still be wrong
An AI feature can respond successfully while giving an unsupported answer or proposing the wrong action. Nothing errors. The reply reads well. And nobody notices until a customer does.
Evaluation establishes what a useful result looks like, with cases your people can check, and runs every change against them. Guardrails decide what the system may accept or do when a result falls outside those limits. How much of each depends on what a mistake would cost.
The cases worth writing down
01
Normal request
Does it do the job?
The everyday questions, with the answer a person checked. Most of the set, so you know the common path still works after every change.
02
Incomplete
Does it ask, or guess?
A question missing the detail that matters, such as which unit or which location. The right result is a question back.
03
Unsupported
Does it admit it doesn't know?
Questions your sources don't answer. The right result is “not in the sources”, never a confident guess.
04
Must escalate
Does it hand off?
Complaints, safety words, anything outside its job. The right result is a person, quickly.
05
Out of bounds
Does it stay inside the permissions?
Requests for what this user may not see or do. The right result is a refusal that doesn't leak the answer.
Guardrails catch what tests can't
- done
Schema check
- done
Permission check
- done
Business rules
- done
Released
with sources
The answer goes out with its sources, and the trace is kept.
- failed
Schema check
missing field: source
- done
Retry once
same request, stricter instruction
- done
Schema check, again
- done
Released
One retry, then a safe fallback if it fails again. A malformed answer never reaches anyone.
- done
Schema check
- done
Permission check
- failed
Business rules
discount over 10% needs approval
- waiting
Operations manager
- not started
Released
Nothing goes out until a person decides. The case keeps its draft and the reason it was stopped.
Three questions, measured separately
What evaluation hands off
In
Out
Worth building before anything ships
Good fit
- AI answers or actions touch records, customers or access to knowledge.
- You'll change prompts, models or sources over time.
- Someone can say what a good answer is.
Not the right fit
- Nobody has agreed what a good result is, or who owns it. Settle that first; until then a score can't guide a release.
Questions about AI evaluation and guardrails
How many test cases do we need?
Enough to cover the everyday questions and each kind of edge case. Small systems often start with a few dozen, written with the people who know the right answers, and grow as reviewed mistakes are added.
Who decides what a good answer is?
Your people. We write the cases with whoever owns the work, and the expected answers come from them, not from the model.
Can a model grade the answers?
For some checks, such as whether an answer cites a source. We check those graders against human judgments first, and keep people on the cases that matter most.
What tools do you use?
Often Langfuse for tracing and Promptfoo for test runs, when the system warrants them. A small automation may need only a test file and the checks in its code.