AI Agent Evaluation: How to Test an Agent Before You Trust It
AI agent evaluation tests an agent on a fixed set of tasks and scores the whole job: plan, tool calls, recovery, result. Learn what to measure.
On this page
Short answer
AI agent evaluation is the practice of testing an autonomous agent against a fixed set of tasks and scoring what it actually did, so a team can judge whether the agent is ready to ship. While language model evaluation scores a single answer, agent evaluation scores the whole job, including the plan, the tool calls and the recovery from errors.
What is AI agent evaluation?
AI agent evaluation is the practice of testing an autonomous agent against a fixed set of tasks and scoring what it actually did, so a team can judge whether the agent is ready to ship. While language model evaluation scores a single answer, agent evaluation scores the whole job: the plan, the tool calls, the recovery from errors, and the final result.
That difference matters because an agent can reach the right answer through the wrong path. An agent that books the wrong room but fixes it before the user notices still did the job, while an agent that books the right room by guessing the dates is a failure waiting to happen. Evaluation has to see the path, not just the ending.
Evaluation is a process, not a single test. You build a set of representative tasks, run the agent on them, score the runs, and review the failures. Then you fix the agent and run the set again, so you can tell whether it actually improved.
What should you measure when you evaluate an agent?
You should measure task success first, then the quality of the path, then the cost of the run. A fast, cheap agent that fails half its tasks is worse than a slow one that finishes the job, so success rate is the headline number and the rest explains why it is what it is.
| Measure | What it tells you | How to score it |
|---|---|---|
| Task success rate | Did the job get done? | Share of tasks completed |
| Trajectory quality | Was the path sensible? | Steps vs a reference trace |
| Tool-call accuracy | Right tool, right arguments? | Correct calls over total calls |
| Grounding rate | Are claims backed by sources? | Claims with a source over total |
| Recovery rate | Does it fix its own errors? | Errors fixed over errors made |
| Cost per task | What does one run cost? | Tokens and time per task |
| Latency | How long does the user wait? | Seconds from request to finish |
Track all seven, but gate releases on task success and tool-call accuracy. The rest tells you where to fix the agent when the headline numbers fall.
How do you build a golden test set?
You build a golden test set by collecting real examples of the job, writing the correct outcome for each one, and covering the easy cases, the hard cases and the cases where the agent should ask for help. A test set built only from easy cases will flatter the agent and hide its real failures.
A good set has 50 to 100 tasks for a narrow agent, each with a written correct outcome and the starting state the agent needs. Include tasks that need two or three tools, tasks with messy input, and tasks where the right answer is to stop and escalate. Those are the tasks that separate a working agent from a demo.
Keep the set versioned and separate from the data you used to build the agent. If the agent has seen the test tasks during development, the scores mean nothing. Refresh the set when the product changes, and retire tasks that no longer match the job.
How do you grade an agent's runs?
You grade an agent's runs in three ways, from most to least reliable: programmatic checks, a judge model, and human review. Most teams use all three, because each catches failures the others miss.
Programmatic checks are best when the outcome is checkable by code: a refund posted, a ticket routed, a file written with the right fields. They are cheap, repeatable and objective, but they only exist for tasks with a clear end state.
A judge model reads the full trace and scores it against a written rubric, which scales to open-ended tasks. It inherits the judge's biases, so use a strong model, write the rubric in plain words, and spot-check its scores against human review. Human review is the ground truth: reserve it for low-confidence cases and for the failures that matter most. For the model-level side of the same job, see what LLM evaluation is.
Which benchmarks should you use for agents?
Benchmarks let you compare your agent against a shared standard, but no single benchmark covers every agent. Pick the one that matches your agent's job, and treat the score as a starting point, not a verdict.
- SWE-bench. Tests coding agents on real software issues, scored by running the repository's own tests. The standard for code agents.
- tau-bench. Tests tool-using agents that talk to a simulated user, including the cases where the user changes their mind.
- GAIA. Tests general assistants on tasks that need reasoning, browsing and file work, with short checkable answers.
- AgentBench. Tests agents across several environments, including operating systems, databases and knowledge graphs.
- WebArena. Tests agents on self-hosted websites, with functional checks on what actually happened.
- BFCL. Tests function calling: deciding to use a tool, picking the right one, and filling its arguments correctly.
Run the benchmark, then run your own golden set. A benchmark score that is high while your own tasks fail means the benchmark does not match your job, and your own set is the one to trust.
How do offline and online evaluation differ?
Offline evaluation runs the agent on a fixed test set before deployment, while online evaluation watches it on real work after deployment. You need both, because offline tests cannot cover what real users actually ask for.
Offline evaluation is controlled and repeatable: the same tasks, the same starting state, the same scoring, every time. That makes it the right tool for comparing two versions of the agent and for gating a release. If the new version scores worse on the golden set, it does not ship.
Online evaluation is messier and more honest. It watches live traces, samples conversations for human review, and tracks the same metrics on real tasks. It catches the cases your test set missed, such as a new kind of request or a tool that changed its behaviour.
Feed what it finds back into the golden set, so the offline tests get stronger over time. The tooling for this is covered in the LLM evaluation tools shortlist.
For the setup itself, the guide to implementing LLM evaluation covers the same steps in order.
Example: a support team evaluates its agent
Example (hypothetical): a support team builds a test set of 100 real tickets with written correct outcomes, then runs its agent on the set. On the first run, 68 tasks succeed, 22 fail because the agent picks the wrong tool, and 10 fail because the final answer is wrong. The headline success rate is 68 out of 100.
The team fixes the tool descriptions, which were vague, and adds two examples of the right tool for each common case. On the second run, 84 tasks succeed, 10 fail on tool choice and 6 fail on the final answer. The success rate rises from 68 to 84 out of 100, and the team can see that tool choice is still the main failure.
Each run costs about 40 dollars in model calls and takes about 25 minutes, so the team can afford to run the set after every change. They gate releases on a success rate of at least 80 out of 100, and they review every failure by hand before they ship.
What are the common mistakes?
The most common agent evaluation mistakes are scoring only the final answer, testing on too few examples, and never re-running the set after a change. Scoring only the final answer hides agents that succeed by luck, and a test set of ten tasks hides almost everything.
- Scoring only the outcome. An agent that gets the right answer via the wrong tools is a latent incident, not a success.
- Too few test tasks. Ten tasks cannot cover the easy, hard and escalation cases, so the score is mostly noise.
- Testing on training data. If the agent has seen the test tasks, the score measures memory, not ability.
- No cost or latency tracking. An agent that succeeds slowly and expensively will not survive production.
- Trusting a judge model blindly. Judge scores need spot-checks against human review, or bias creeps in unnoticed.
- Never re-running the set. A model, prompt or tool change can break an agent that passed last month.
Key takeaways
- Agent evaluation scores the whole job, not just the final answer
- Task success rate is the headline number; trajectory and tool accuracy explain it
- A golden test set needs easy, hard and escalation cases
- Grade with programmatic checks, a judge model and human review together
- Offline tests gate releases; online evaluation catches what the tests missed
Frequently asked questions
What is the difference between agent evaluation and LLM evaluation?
LLM evaluation scores a single model answer against a fixed set of examples. Agent evaluation scores an autonomous agent over a whole task: the plan, the tool calls, the recovery from errors and the final state. An agent can pass an LLM test and still fail the job.
How many tasks should a golden test set have?
For a narrow agent, 50 to 100 tasks is a workable size: enough to cover easy, hard and escalation cases without taking too long to run. Include tasks that need several tools and tasks where the right answer is to stop and ask for help.
What is trajectory evaluation?
Trajectory evaluation scores the steps the agent took, not just the final answer. It checks whether the agent picked the right tools, called them with the right arguments, and recovered from errors. It catches agents that succeed by luck or by guessing.
Can a judge model grade an agent reliably?
A judge model can grade open-ended tasks at scale, but it inherits biases, so write the rubric in plain words, use a strong model as the judge, and spot-check its scores against human review. Treat judge scores as a signal, not as ground truth.
Which benchmark should I start with?
Pick the benchmark that matches your agent's job: SWE-bench for coding agents, tau-bench for tool-using agents that talk to users, GAIA for general assistants, and BFCL for function calling. Then build your own golden set, because your tasks are the real test.
When should I re-evaluate an agent?
Re-evaluate whenever the model, the prompt, the tools or the product changes, and on a schedule even when nothing has changed. A tool that changes its behaviour can break an agent that passed last month, and only a re-run will show it.