AI Evaluation · Guide

How to Evaluate AI Agents

Yuliya Halavachova ·

AI agents are evaluated on whole tasks, not individual answers. That means measuring whether the agent completed the task, whether it took a sensible path to get there, which tools it called and whether those calls were correct, what it cost, and how it behaved when something failed. Evaluating only the final output misses most of the ways agents actually break.

This is the part of agent development that teams most often skip, and it is usually the reason agents that demo well fail in production. It is also one of the first things I look at in any engagement — see what an AI consultant actually does for the wider picture.

Why agents fail differently from chatbots

A chatbot produces an answer. An agent takes a sequence of actions, calls tools, reads results, and decides what to do next. That difference creates failure modes a response-level evaluation cannot see:

None of these show up if you only grade the final response.

What to measure

A workable agent evaluation covers six dimensions:

DimensionWhat it answers
Task successDid the agent complete the task, judged against a clear definition of done?
Trajectory qualityWas the path sensible — right tools, right order, no wasted steps?
Tool-call accuracyWere the tools called with correct arguments, and were the results used?
Cost and latencyHow many steps, tokens and seconds per task, and how does that trend?
RecoveryWhat happened when a tool failed, returned nothing, or returned something unexpected?
SafetyDid the agent stay within its permissions, and did it pause where it should?

Task success is the headline number. The other five explain it — and they are what tell you why a run failed, which is the only thing that lets you fix it.

Build the eval set from real workflows

The most common mistake is inventing test cases. Synthetic tasks measure how well the agent handles situations that never happen.

Build your golden set from real usage instead:

  1. Collect actual tasks. From production logs, support tickets, or the workflows your team already does manually.
  2. Write a definition of done for each. Not “the answer looks right” — a specific, checkable condition. “The correct invoice ID is extracted and the refund is filed under the right category.”
  3. Include the ugly cases. Empty results, ambiguous requests, tools that time out, users who change their mind mid-task.
  4. Version the set. When you change the agent, the set stays fixed. Otherwise you are moving the target along with the arrow.

A set of 30–50 well-chosen tasks, drawn from reality and kept stable, is worth more than 500 generated ones.

Evaluate the trajectory, not just the outcome

For each task, record the full trajectory: the sequence of thoughts, tool calls, arguments, results and decisions. Then score it.

Two agents can both succeed, with very different trajectories. One takes three steps and £0.02. The other takes fourteen steps, calls a tool it doesn't need, recovers from a failure it caused itself, and costs £0.40. Both passed. Only one is production-ready.

Practical signals to score on the trajectory:

LLM-as-judge, used carefully

LLM-as-judge is useful for scoring things that are hard to check programmatically — whether a summary is faithful, whether a response is appropriately cautious, whether a plan is sensible.

Two rules make it trustworthy:

Calibrate against human review. Have a person score a sample of the same runs, then compare. If the judge and the human disagree on more than a small fraction, the judge is measuring something other than what you think. Recalibrate before trusting it.

Don't judge with the model you're testing. A model grading its own output has a well-documented bias toward it. Use a different model, or a different prompt structure, and check both against human scores.

For anything that can be checked deterministically — did the right ID get extracted, was the correct tool called, is the total arithmetic correct — use code, not a judge. Judges are for the parts you cannot check mechanically.

Evaluating tool calls, including MCP tools

If your agent uses MCP servers or external tools, each tool call is a testable event. For a given task, you know which tools should be called and roughly with what arguments. Score:

This is often where the cheapest, highest-signal failures show up. A tool called with a malformed argument is a bug you can fix in an afternoon once you can see it.

Evaluating agent skills

If your agent loads reusable skills — instructions, scripts or tools it pulls in on demand — each skill needs its own evaluation. A skill only helps if the agent triggers it at the right time and follows it correctly.

Test each skill on three questions:

  1. Triggering accuracy. Does the agent load the skill when it should, and not load it when it shouldn't? Both directions matter — a skill that fires too eagerly is as damaging as one that never fires.
  2. With-skill vs without-skill. Run the same task set with the skill enabled and disabled. If scores don't improve, the skill isn't earning its place in the context window.
  3. Consistency. Run the same task several times. A skill that works two times in five is not working.

Skills that fail all three should be rewritten, merged or retired. A large skill library with no evaluation is a liability, not a capability. If you need help setting this up, see agent skills evaluation.

Put regression testing in CI

Agent evaluation is only useful if it runs automatically. Wire your task set into CI so that every change to prompts, tools, models or orchestration runs the same evaluations and reports the same metrics.

The practical setup:

Without this, evaluation is a one-off exercise that tells you how the agent behaved on the day you ran it.

Red-teaming and safety

Add a separate set of adversarial tasks: prompts designed to make the agent exceed its permissions, leak data, take an irreversible action, or follow an instruction it should refuse.

This is not the same as accuracy testing. An agent can score well on task success and still be unsafe. Run these separately, and treat any failure here as a blocker rather than a metric.

Common mistakes

A minimum viable eval setup

Before shipping an agent to real users, any team should have at least:

The short version

Define the task clearly, score the trajectory as well as the outcome, build the test set from real usage, calibrate any LLM judge against human review, and run the whole thing in CI on every change. That is the difference between an agent that demos well and one that survives production.

Yuliya Halavachova — AI Engineering Manager and AI Consultant, London

Yuliya Halavachova is an AI Engineering Manager at a global enterprise software company, leading a team of 15 engineers shipping AI agents in a B2B SaaS product. She provides AI consulting on agent and LLM evaluation for UK companies.

Working on an AI project?

Talk it through on a discovery call.

Book a discovery callAI consulting services
yuliya.pro