Guide
AI Agent Evaluation: How to Test Agents Before and After They Ship
A good final answer can hide a bad run. This guide covers what to measure in an agent's work, how to build test cases that reflect production, and how to keep evaluating once the agent is live.
What AI agent evaluation measures
AI agent evaluation is the practice of judging whether an agent did the job it was given, and did it acceptably: right result, reasonable path, within its rules, at a cost you can live with. It applies to the whole run, not one model call. An agent plans, calls tools, reads what comes back and decides again, so a test has to look at the steps as well as the answer.
That is what separates it from evaluating a single LLM prompt. A prompt evaluation asks whether one completion is good. An agent evaluation also asks whether the agent chose the right tools, passed them the right arguments, stopped when it should have, and left the systems it touched in the state the user wanted.
Evaluation vs. observability
The two depend on each other. Observability records what each run did; evaluation decides whether it was right. Without traces there is nothing to score, and without scores a trace is just a long log. The AI agent observability guide covers the telemetry side; this page covers the judgement.
What to score in an agent run
Score more than the final output. Most silent agent failures produce an answer that looks fine, so the output alone gives a falsely clean result. Useful dimensions, roughly in the order teams add them:
- Task completion. Did the run achieve what was asked? Where possible, check the end state in the system the agent changed (the ticket exists, the refund was issued once, the record has the right value) rather than trusting the agent's own report.
- Correctness and grounding. Is the answer true, and is every claim supported by what the agent retrieved or was given? An answer that is right by luck is a failure waiting to happen.
- Tool use. Were the right tools called, with valid and sensible arguments, in a workable order? Invented IDs, wrong units and repeated identical calls show up here first.
- Trajectory. Was the path reasonable: no loops, no unnecessary steps, no giving up early, no wandering off the task. Score against acceptable paths, not one golden path, because several routes can be correct.
- Instruction and policy adherence. Did the agent stay within its system instructions, permissions and business rules at every step, including the steps the user never sees? How to Audit an AI Agent Against Its Own Instructions covers this in depth.
- Safety and escalation. Did it refuse what it should refuse, ask for confirmation before irreversible actions, and hand off to a person when it was out of its depth?
- Cost and latency. Steps, tokens and wall-clock time per run. A change that keeps quality flat but doubles the steps is a regression.
Build an eval set from real runs
Public agent benchmarks such as SWE-bench, τ-bench and AppWorld are useful for comparing models on general ability. They do not tell you whether your agent, with your tools, prompts and data, handles your users' requests. For that you need your own set of cases.
- Start from the job description. List the tasks the agent is meant to do and the things it must never do. Write a handful of cases for each, including the boring common ones.
- Add real traffic. Sample production requests (with redaction) across task types, so the set reflects what users actually ask rather than what the team imagined.
- Add the hard edges. Ambiguous requests, missing data, tool errors and timeouts, conflicting instructions, prompt-injection attempts in retrieved content, and requests that should be refused or escalated.
- Add every incident. Each confirmed failure becomes a case, with the expected behaviour written down. This is how a postmortem turns into a regression test; see Blameless Postmortems for AI Agent Incidents.
- Write down what passing means. For each case, record the expected end state, the required and forbidden actions, and the rubric a grader should apply. A case without a pass condition cannot be scored consistently.
Version the eval set alongside prompts, tool schemas and agent code, and keep a held-out slice the team does not tune against, so scores still mean something after a few rounds of fixes.
Choose graders: code, model, human
Use the cheapest grader that can make the call reliably, and reserve the expensive ones for judgements that need them.
- Code-based checks. Schema validation, exact or fuzzy match against expected values, assertions on tool arguments, and queries against the end state of a test environment. Fast, cheap and deterministic: use them wherever the right answer can be stated precisely.
- Model-based graders (LLM-as-a-judge). A separate model scores the run against a written rubric: was the answer grounded, did it follow the instructions, was the tone acceptable. They make semantic judgements possible at scale, but they are another model with its own errors.
- Human review. People label a regular sample and every disputed case. Their labels are the reference the other graders are checked against.
Making an LLM judge trustworthy
- Give it a narrow rubric with defined outcomes (pass, fail, and a reason) rather than an open 1–10 score, and grade one dimension per prompt.
- Show it the evidence it needs: the instructions, the tool results and the trace, not only the final answer.
- Check its agreement with human labels on a fixed sample before relying on it, and recheck after changing the judge model or rubric.
- Watch for known judge biases reported in research on LLM-as-a-judge, such as favouring longer answers, the first option shown, or output from its own model family. Randomise order and compare against human labels.
Offline evals before release, online evals after
Offline evaluation runs the eval set against a candidate change (a new prompt, model, tool or agent version) before it ships, and compares scores with the current version. Because agents are non-deterministic, run each case more than once and look at pass rates, not single outcomes. Treat a drop on any must-not-fail case as a release blocker.
Online evaluation scores production runs after release. Deterministic checks can run on every run; model graders usually run on a sample. Online scores catch what the eval set never anticipated: new kinds of request, drift in upstream data, a provider's model changing underneath you. Instruction Drift and Goal Displacement in Long-Running Agents describes failure modes that only appear over time.
Sampling means online scores are estimates. Plan the sample size per task type and be honest about what a low observed failure rate can and cannot rule out: see Incident Rate Estimation When Agent Sampling Is Sparse.
From eval scores to incidents
An evaluation programme pays off when a falling score reaches the right person quickly. The links below assume the scores above exist.
- Treat online eval scores as part of the agent's baseline, per task and per version: Defining Normal Agent Behavior as an Observable Baseline.
- Alert on a sustained drop in scores or a rise in policy failures, not on one bad run: Alerting on Agent Behavior Instead of Exit Codes.
- Rank failing runs by impact so a quiet failure that changes customer data outranks a slow reply: Severity Triage for Silent Agent Failures.
- Express quality as an objective the team owns, alongside availability: SLOs for Multi-Step Agent Pipelines.
Questions to ask an agent evaluation tool
Evaluation features and pricing change quickly, so put these questions to each vendor or open-source project and confirm the answers in its current documentation.
- Can it score full multi-step traces, including tool calls and their arguments, or only final inputs and outputs?
- Can it run the same evaluators offline on a dataset and online on sampled production traces?
- Can you write your own code-based checks and model-graded rubrics, and choose the judge model?
- Does it track agreement between model graders and human labels?
- Can it turn a production trace into a dataset case in a few clicks, so incidents become regression tests?
- Does it accept OpenTelemetry traces, and can scores feed the alerting and paging tools you already use?
- Where is data stored, what can be redacted first, and is self-hosting possible?
A starting checklist
- The agent's tasks, forbidden actions and pass conditions are written down.
- An eval set covers common requests, hard edges and every past incident, and is versioned with the agent.
- Each case is scored on task completion, tool use, trajectory and policy, not only the final answer.
- Code-based checks run wherever the answer can be stated precisely; LLM judges are checked against human labels.
- Every prompt, model, tool or code change runs the offline evals, several times per case, before release.
- Production runs are scored online, with a planned sample per task type.
- Score drops feed the agent's baseline and alerts, and confirmed failures go back into the eval set.
Frequently asked questions
What is the difference between agent evaluation and LLM evaluation?
LLM evaluation usually scores single model outputs against a prompt. Agent evaluation scores a whole run: the plan, each tool call and its arguments, the order of steps, and whether the end state matches what was asked, as well as the final answer.
Can I rely on an LLM as a judge?
For semantic questions such as grounding or instruction-following, often yes, once you have checked it against human labels on your own cases and keep rechecking when the judge model or rubric changes. Use code-based checks instead wherever the right answer can be stated exactly.
How many test cases does an agent eval set need?
There is no fixed number. Cover every task the agent is meant to do and every thing it must never do, add real production requests and every past incident, and run each case several times because agent runs vary. Grow the set as production shows you new failure types.
Are public benchmarks enough to choose a model for my agent?
They are a reasonable first filter for general ability. The decision should rest on your own eval set, run with your tools, prompts and data, because benchmark tasks rarely match the work your agent does.


