Evals for Agents
Every change to an agent is a bet: a new model, a reworded prompt, a new tool. Without evals you find out whether you won the bet from your customers. With evals you find out within the hour, before anyone else does.
Definition: Evals for agents are repeatable tests that run an AI agent on a fixed set of real cases and grade what it did and how it did it, so you can prove it works before release and spot when it gets worse after any change.
1 The big idea
A demo is one good run. An eval is proof.
Agents are not like normal software. Ask the same question twice and you can get two different answers. Change one sentence in the prompt and behaviour can shift in places you never touched. Swap in a newer model and some things get better while others quietly get worse.
So "I tried it and it looked fine" is not evidence. An eval (short for evaluation) replaces that feeling with a number you can trust. You collect real cases where you know what good looks like. You run the agent on all of them. You grade each result the same way every time. Then you compare the score with the version you already trust.
Evals answer two questions. Before a change: is the new version at least as good as the old one, on the cases that matter most? After release: is it still as good on real traffic as it was in testing? The first is offline evaluation. The second is online monitoring. You need both.
Think of a driving test, not a test drive. A test drive is you, on a sunny day, on a road you chose. A driving test is the same route for everyone, with roundabouts, a hill start and a reverse park, marked against a fixed sheet. You don't hand someone the car keys after a test drive. Don't hand an agent your customers after a demo.
2 Interactive map
The eight parts of a good eval setup
Click any part to see what it does, an example, and what goes wrong without it.
Click or tab to any part
Golden dataset
A fixed collection of real cases, each with the input the agent receives and a clear description of what a good result looks like. This is the heart of every eval.
Read all 8 parts as text
- Golden dataset
- A fixed collection of real cases, each with the input the agent receives and a clear description of what a good result looks like. This is the heart of every eval. Example: For a guest-support agent: 300 real past conversations, anonymised, covering refunds, late check-outs, lost keys, complaints and questions in Arabic and English. Each has a note on the correct outcome. Without it: Every test is a new set of examples someone made up that afternoon, so scores cannot be compared from one week to the next.
- Outcome checks
- Grade the end state: did the agent produce the right result in the world? This is usually the most important check and the easiest to explain. Example: After a duplicate-charge case, exactly one refund of the right amount exists, and the guest was sent a reply. After a pricing case, the nightly rate is inside the allowed range. Without it: You grade how nice the reply sounds, while the refund itself was never issued.
- Trajectory (path) checks
- Grade the steps the agent took, not just where it ended up: which tools it called, in what order, and whether it skipped a required check. Use these where the route matters for safety or cost. Example: A pricing agent must fetch competitor rates before changing a price. If it changed the price without fetching them, the case fails even if the price happened to be reasonable. Without it: An agent that got lucky looks the same as one that did the work. The luck runs out in production.
- Code-based graders
- Checks written as plain code: exact matches, number ranges, required fields, forbidden words, whether a tool was called. Fast, cheap, and they give the same answer every time. Example: Refund amount is at most AED 1,000 unless a human approved it. The reply contains the booking number. No phone numbers of other guests appear in the reply. Without it: Everything is graded by an LLM or by a person, so evals are slow, costly and a little different every run.
- LLM-as-judge, calibrated
- A second model grades things code cannot, like tone, helpfulness or whether a reply answers the actual question, using a written rubric. You check its grades against human grades before you trust it. Example: A judge scores each reply from 1 to 5 against a rubric: polite, accurate to the policy, answers the question, no promises the agent cannot keep. A support lead grades 100 of the same replies, and you compare. Without it: Either nobody measures quality of writing at all, or an unchecked judge gives high marks to long, confident answers that humans find unhelpful.
- Critical slices
- Results broken down by type of case, so a drop in one important area cannot hide inside a good average. Some slices are marked critical: any real drop there blocks a release. Example: Slices for refunds above the limit, Arabic messages, VIP guests, and prompt-injection attempts. The overall score is up, but refunds above the limit went down: blocked. Without it: A 1-point gain overall hides a 14-point drop on the riskiest cases, and you ship it.
- Regression gate in CI
- The eval suite runs automatically on every change to the prompt, model, tools or code, and the change cannot go live unless it scores at least as well as the current version, within a set tolerance. Example: An engineer edits the prompt to make replies shorter. The pipeline runs 300 cases and blocks the merge because two critical cases now skip the refund-limit check. Without it: Evals exist, but people run them when they remember. They remember after the incident.
- Online monitoring
- After release, sample real conversations, grade them with the same checks, and watch signals like escalation rate, complaints and corrections by staff. Turn every new failure into a new golden case. Example: Each day, 5% of conversations are graded automatically and 20 are read by a person. A new type of complaint shows up, and the five worst examples go into the golden dataset. Without it: Your eval set describes last year. The world changes, guests ask new things, and nobody notices the agent getting worse.
No single part is enough. Code checks without real cases test the wrong things. Real cases without slices hide the worst failures. Offline evals without online monitoring go stale.
3 Step-by-step simulator
Watch a change go through the eval gate
A holiday-rental company runs a guest-support agent and a pricing agent. Each scenario is a change someone wants to ship. Watch what the eval setup catches, and what it would have missed with only an overall score.
- Changeteam
- Run caseseval harness
- Gradegraders
- Comparebaseline
- Slice checkgate
- Decidegate
- Learnteam
Model upgrade
A newer model is out and it scores better on public benchmarks. The team wants to switch. The overall score goes up. Watch what the slices show.
Read the walkthrough as text
Model upgrade
A newer model is out and it scores better on public benchmarks. The team wants to switch. The overall score goes up. Watch what the slices show.
- A change is proposed. An engineer opens a change that swaps the model and leaves the prompt, tools and rules the same. That change triggers the eval pipeline automatically.
- Run every golden case, three times. The harness runs all 300 golden cases against the new version. Each case runs three times, because the same agent can answer differently on different runs. Tools are pointed at test copies, so no real guest is refunded. Why it matters: Running each case once tells you what can happen. Running it several times tells you what usually happens.
- Grade with code first, judge second. Code graders check the hard facts: right refund amount, limit respected, booking number in the reply. A calibrated LLM judge scores tone and helpfulness. A case only passes if it passes on all three runs.
- Overall: slightly better. Compared with the current model, the overall pass rate is up by 0.7 points. Replies are rated a little friendlier. On a single dashboard number, this looks like an easy yes.
- One critical slice dropped. The gate checks every slice separately. On refund requests above the AED 1,000 limit, the new model more often offers the refund straight away instead of routing it to a person. The harness permission check would still block the refund itself, but the guest is told "done" before a human has decided. Why it matters: An average blends hundreds of easy cases with a few dangerous ones. The dangerous ones are where you lose money and trust.
- Blocked, with the evidence attached. The change is blocked. The report links the six cases that newly fail so the engineer can read exactly what the new model said, side by side with the old one.
- Fix, re-run, then ship. The team adds one line to the instructions about never promising refunds above the limit and re-runs the suite. The slice recovers, the overall gain remains, and the change ships. The six cases stay in the dataset for good.
Judge vs humans
Grading 300 replies by hand every release is slow, so the team wants an LLM judge to score tone and helpfulness. Before trusting it, they check it against people.
- A new grader is proposed. The team writes a rubric: polite, accurate to the policy, answers the actual question, makes no promises the agent cannot keep. A judge model will score each reply as pass or fail.
- Run it on replies people already graded. Two support leads have already labelled 100 real replies as good or bad. The judge grades the same 100 without seeing the human labels. Why it matters: You calibrate a judge the way you would check a new hire: give them work you already know the answer to.
- The judge grades. The judge passes most replies, and writes a short reason for each grade, which makes disagreements easy to inspect.
- Compare with the humans. The humans passed only 74 of the 100. The judge agrees with them on 80 replies. Most disagreements go one way: the judge passes replies the humans failed.
- Find the pattern. Looking at the disagreements by slice, most are long replies that sound confident and apologetic but never answer the question. LLM judges are known to favour longer, more polished answers, so this is exactly the bias to check for. Why it matters: Judges have known biases: towards longer answers, towards whichever answer appears in a certain position (often the first), and sometimes towards text that sounds like their own. You only see them by comparing with people.
- Not trusted yet. The judge is not allowed into the release gate yet. A grader that agrees with people only four times in five would let bad changes through.
- Tighten the rubric and re-check. The team makes the rubric specific: "fail if the reply does not state the outcome in the first two sentences". They re-run on a fresh set of human-labelled replies, so the rubric is not just tuned to the first 100. Agreement is now high enough, and a person still spot-checks 20 replies a week.
Small prompt edit
A revenue manager asks for shorter explanations from the pricing agent. An engineer trims the instructions. The prices themselves still look fine. The path checks tell a different story.
- A harmless-looking change. The engineer cuts the instructions from 40 lines to 25 so the agent writes shorter notes. Nobody touched anything about how prices are set.
- Run the pricing cases. The harness replays 200 past pricing decisions: different seasons, events in the city, last-minute gaps and long stays. Tools return the same saved data each time, so results are comparable.
- Outcome checks pass. Every proposed nightly rate is inside the allowed range, and most are close to what an experienced revenue manager chose. The outcome checks are happy.
- Path checks fail. The trajectory check looks at which tools were called. In 23 of 600 runs, the agent set a price without first fetching competitor rates. The removed lines included the reminder to always check the market first. Why it matters: The prices were fine this time because the saved market was calm. On the night of a big event, a price set without looking at competitors could be badly wrong.
- Which slice?. All 23 are last-minute cases, where the instructions used to say "check the market again, even if you checked this morning".
- Blocked. A required step is now sometimes skipped. That is a rule in the gate: path failures on required steps block the release, whatever the outcome score says.
- Move the rule into code too. The team restores the reminder and, better, makes the harness refuse any price change that does not come with fresh competitor data. Now the rule holds even if the prompt changes again. Why it matters: An eval that keeps catching the same kind of failure is telling you which rule belongs in code.
The point: in all three scenarios, a single overall number would have said "ship it". The slice view, the path checks and the comparison with humans found the problem. Good evals are not one score. They are many small, specific questions asked the same way every time.
4 Before and after release
Offline evals and online monitoring do different jobs
Offline evals (before release)
- Run on a fixed golden dataset
- Same cases every time, so scores compare
- Tools point at test copies or saved data
- Block a bad change before anyone sees it
- Only as good as the cases you thought of
Online monitoring (after release)
- Run on a sample of real traffic
- Catches what nobody thought to test
- Uses signals like escalations, complaints and staff edits
- Finds drift as guests, policies and seasons change
- Feeds new failures back into the golden dataset
- Cannot stop a bad change, only spot it quickly
Offline evals keep known problems from coming back. Online monitoring finds the problems you did not know about yet. Each one makes the other better.
5 Build your own eval setup
Turn on eval practices. Watch the blind spots close.
These are the ways teams get surprised by their own agents. Tick the practices you have today and see which surprises you would catch. Many teams start with a handful of hand-picked examples and an overall score.
- Quality drops after a model upgrade and nobody notices for weeksNothing compares before and after.
- Overall score goes up while refunds above the limit get worseThe average hides it.
- Scores keep rising but new real cases failThe prompt was tuned to the test.
- Judge passes long, polite replies that never answer the questionNobody checked the grader.
- Works in testing, breaks on the first angry or tricky messageOnly the happy path was tested.
- Passed once in testing, fails one time in four in productionOne lucky run counted as a pass.
- Tests are made up each time, so scores never compareNo fixed set of cases.
- Eval score goes up, but guests complain moreYou are measuring the wrong thing.
Read which part prevents which failure
- Quality drops after a model upgrade and nobody notices for weeks: prevented by Gate in CI or Online monitoring.
- Overall score goes up while refunds above the limit get worse: prevented by Per-slice results.
- Scores keep rising but new real cases fail: prevented by Held-out cases or Online monitoring.
- Judge passes long, polite replies that never answer the question: prevented by Calibrated judge.
- Works in testing, breaks on the first angry or tricky message: prevented by Edge and attack cases.
- Passed once in testing, fails one time in four in production: prevented by Repeated trials.
- Tests are made up each time, so scores never compare: prevented by Golden dataset.
- Eval score goes up, but guests complain more: prevented by Online monitoring or Golden dataset.
Notice that "more test cases" alone is not the answer. Where the cases come from, how they are graded, how results are split and when they run all matter as much as how many there are.
6 Optional: what it looks like in code
A release gate in 18 lines
You don't need to read code to follow this. If you do, here is the core of an eval gate. The highlighted line is the one that catches the model upgrade in the simulator: a critical slice can block a release even when the average improves.
def eval_gate(candidate, baseline, dataset, trials=3):
passed = {}
for case in dataset: # real cases, known good outcomes
runs = [candidate.run(case.input) for _ in range(trials)]
passed[case.id] = all(grade(case, r) for r in runs) # consistent, not lucky
for s in dataset.slices: # refunds, arabic, vip, injection
new = pass_rate(passed, s.case_ids)
old = baseline.pass_rate(s.name)
if s.critical and new < old - s.tolerance:
return block(s.name, old, new, failing_cases(passed, s))
if pass_rate(passed) < baseline.pass_rate("all") - 0.01:
return block("all", baseline.pass_rate("all"), pass_rate(passed))
return approve(passed)
def grade(case, run):
return code_checks(case, run) and judge(case, run) # cheap and certain first
code_checks handles facts like amounts, limits and tool order. judge handles tone and helpfulness, and is itself checked against human grades. Because of and, the judge only runs when the code checks have passed.7 The rules I build by
Eight principles of good agent evals
Start from real cases, not imagined ones
Your best test cases are past conversations, decisions and incidents, anonymised. Twenty real cases with clear outcomes beat two hundred invented ones.
Grade the outcome first
Did the right thing happen in the world? Check that before you check how the reply sounds. Add path checks where the route matters for safety or cost.
Use code wherever code can decide
Amounts, limits, required fields and tool order are facts. Check them with plain code: it is fast, cheap and gives the same answer every time.
Never trust a judge you have not checked
An LLM judge is a useful tool with known biases. Compare its grades with human grades on a sample, fix the rubric, and keep spot-checking after.
Read the slices, not just the average
Mark your riskiest kinds of case as critical. A real drop in a critical slice blocks a release, whatever the overall score says.
Run every case more than once
Agents vary from run to run. A case that passes once and fails twice is a failure. For risky actions, ask for consistent passes, not one lucky pass.
Make the gate automatic
Every change to the model, prompt, tools or rules runs the suite. If evals depend on someone remembering, they will be skipped the week it matters.
Turn every failure into a test
When something goes wrong in production, add it to the golden dataset. Over time your evals become a record of everything you have learned.
8 Common mistakes
Things teams say before an eval surprise
"We tested it on twenty examples and it got them all right."
Twenty hand-picked examples, run once each, mostly tell you that the happy path works. Add hard and adversarial cases, run each more than once, and keep some cases aside that nobody tunes the prompt against.
"The score went from 86 to 89, so it's better."
Maybe. Small changes can be noise when the agent varies between runs, and an average can hide a drop in your most important cases. Look at the slices and the individual failures before you celebrate.
"We use a model to grade the model, so it's fully automated."
Using a model as a judge is fine and often necessary. Trusting it without checking is not. Judges can favour longer answers, the answer shown in a certain position, or text similar to their own. Measure agreement with people first, and keep a human spot-check running.
"Our eval score is high, so customers must be happy."
Only if you are measuring what customers care about. If complaints rise while scores rise, your cases or rubric are out of date. Online signals such as escalations, staff corrections and complaints keep the evals honest.
"We'll write evals once the agent is finished."
Write the first ten cases before you build. They force you to say what "good" means, and every change after that can be checked against them. An agent is never finished, so neither are its evals.
9 Check yourself
Four quick questions
10 Do this today
Six steps to your first real eval
Pick one agent you're building or buying. Work down this list. Your ticks are saved in this browser.
11 Questions people ask
Evals for agents FAQ
What are evals for AI agents?
Evals are repeatable tests for an AI agent. You run the agent on a fixed set of real cases, grade each result with code checks or a calibrated LLM judge, and compare the score with the previous version. They tell you whether a change made the agent better or worse before customers find out.
What is a golden dataset?
A golden dataset is a fixed collection of test cases where you know what a good result looks like. For agents, the best golden cases come from real past conversations, decisions and incidents, anonymised and labelled with the correct outcome. Because the set stays the same, scores can be compared across versions.
What is the difference between outcome and trajectory evaluation?
Outcome evaluation grades the end result, such as whether the right refund was issued. Trajectory evaluation grades the steps the agent took, such as which tools it called and in what order. Use outcome checks everywhere and add trajectory checks where skipping a step would be unsafe or costly.
Is LLM-as-judge reliable?
It can be useful, but it is not reliable by default. LLM judges have known biases, such as favouring longer answers or whichever answer is shown first. Check a judge against human grades on the same cases, use a specific rubric, and keep a regular human spot-check once it is in use.
What is pass@k for agents?
pass@k is the chance that at least one of k attempts at a task succeeds. It suits tasks where you can try several times and keep the best result. For agents that act on real systems you usually care about a stricter question, whether every attempt succeeds, which some teams measure as pass^k or simply as consistency across repeated runs.
How many test cases does an agent eval need?
There is no magic number. Start with a few dozen real cases that cover your main tasks and your riskiest situations, then grow the set every time production shows you a new failure. Coverage of the cases that matter is more important than the total count.
12 Glossary
Words you'll hear
- Eval
- Short for evaluation. A repeatable test that runs an agent on known cases and grades the results.
- Golden dataset
- A fixed set of test cases with known good outcomes, used to compare versions fairly.
- Grader
- The thing that decides whether a result passes: a code check, an LLM judge or a person.
- LLM-as-judge
- Using a language model to grade another model's output against a written rubric.
- Calibration
- Checking a grader against human grades on the same cases, and adjusting until they agree well.
- Trajectory
- The full sequence of steps an agent took: its tool calls, their order and their inputs.
- Slice
- A subset of cases of one kind, such as refunds or Arabic messages, scored separately.
- Regression
- Something that used to work and now does not, usually after a change.
- Baseline
- The scores of the version you currently trust, which every new version is compared against.
- Held-out set
- Test cases kept aside and never used to tune the prompt, so they show how the agent does on cases it was not tuned for.
For teams
Want your team to build evals like this?
I run AI agents in production at estaie that set prices, find customers and look after guests. This page comes from building and running them.
AI Skills 2027, for your engineering team
A hands-on workshop where your engineers build a golden dataset and a release gate for a real agent from your business.
- One skill in depth, or all ten as a bootcamp
- On site in the UAE or remote
- Your team leaves with working code, not slides
Have your agent's evals reviewed
I check how your agent is tested against the failure types on this page and give you a written list of what to fix first, in order of risk.
- For teams about to launch, or just after an incident
- Plain-English findings your board can read
The series
All ten AI Skills for 2027
- Harness Engineering
- Loop Engineering
- Context Engineering
- Tool Design
- Memory Architecture
- Orchestration Patterns
- Guardrails & Permissions
- Evals for Agents
- Human-in-the-loop Design
- Observability & Tracing
Published 2 December 2026. Written by Nimit Solanki from building production agents at estaie.
Get the free Playbook by email
Seven short lessons on taking an agent from prototype to production. One a day, free. You may also hear about my course and consulting. Opt out any time.