Insight
How to evaluate an AI agent.
You would not ship software without tests. An agent needs them more, because the same input can produce different outputs. Here is the method we use, in plain terms.
01Short answer
The short answer
To evaluate an AI agent, build a set of real cases with known good outcomes, run the agent on all of them, and score the results automatically. Decide in advance what score is good enough. Re-run the whole set every time you change a prompt, a tool or a model. Keep a trace of each run so that a failure can be explained, and have people review a sample in production.
02Terms
Four words you will hear
- Eval
- A test for AI behaviour: an input, the agent’s output and a score.
- Golden set
- The collection of real cases with agreed correct answers that the agent is tested on.
- Grader
- What produces the score: code, a second model, or a person.
- Trace
- The full record of one run: each model call, tool call, result, cost and timing.
03Method
The method, step by step
-
Collect real cases
Fifty is enough to start. Take them from actual history, and include the awkward ones: missing data, ambiguous requests, cases that should be refused. Write down the right outcome for each with the people who do the job.
-
Decide what to score
Score the outcome first: was the final result correct? Then score the path: did it call the right tools, in a sensible order, without doing anything it should not? An agent can reach a right answer the wrong way.
-
Pick the cheapest grader that works
Use code where the answer can be checked exactly, a model as judge where it needs reading, and a person where judgment is the point. Check the model judge against human scores before trusting it.
-
Set the threshold before you look
Agree what pass rate is good enough for this process, and which failures are never acceptable. Deciding after you see the score is how weak systems get approved.
-
Run it on every change
Prompt edits, new tools, model upgrades and price-driven model swaps all go through the same suite. This is what makes switching models safe.
-
Keep evaluating in production
Trace every run. Sample real cases for human review, track approval and override rates, and add every new kind of failure to the golden set.
04Graders
Which grader for which question
| Grader | Good for | Watch out for |
|---|---|---|
| Code | Exact values, formats, totals, which tools were called | Cannot judge tone or reasoning |
| Model as judge | Summaries, explanations, policy compliance | Needs calibrating against people; costs money per run |
| Human | High-stakes decisions and setting the standard | Slow and expensive; use on a sample |
05Why it matters
Why this is not optional
-
93%
of developers using AI tools say they need to see where an answer came from before they trust it.
-
362
AI incidents were recorded in 2025, up from 233 the year before.
Evals are how an agent earns autonomy. Without them every decision about what it may do alone is a guess. With them, you can point to a number, and so can your auditor.
06Pitfalls
Common mistakes
- Testing only the happy path. The cases that matter are the ones that should be refused or escalated.
- Writing the test set from imagination. Invented cases are tidier than real ones.
- Trusting a model judge unchecked. Compare it with human scores on a sample first.
- Scoring only the final answer. An agent that deletes a record on its way to the right answer has not passed.
- Treating evals as a one-off. The suite is a product asset that grows with every incident.
Start here
Let’s talk.
Tell us what you are trying to get done. You get a straight answer.