Skip to content
AI Playbooks · 11 min read

How to Evaluate AI Agents: A Beginner’s Playbook on Testing Multi-Step Tasks

Learn how to evaluate AI agents in plain words: write test tasks, check the end result and the tool calls, run each task several times and catch regressions.

Cover image for a beginner's playbook on how to evaluate AI agents, with test tasks, trajectories and pass^k

Meera, a developer in Pune, built a small support agent for her team’s online shop. It reads a customer’s message, looks up the order, and can issue a refund. In the demo it was perfect. Her manager clapped. Two weeks later the team switched to a newer model, and nobody noticed that the agent had started refunding orders twice.

Meera already knew how to test a chatbot that gives one answer. An agent is different: it takes many steps, calls tools and changes things in the real world. This playbook shows how to evaluate AI agents in plain words, so you catch problems like Meera’s before your customers do.

Last verified: 3 December 2026. AI tools change fast; check the linked sources for anything newer.

Who this is for: anyone who has built, or is about to build, an AI agent and wants to know if it really works. You should know what an agent is (see the AI agents playbook). Time needed: about 30-45 minutes to read and set up your first test list.

What is agent evaluation, in simple words

Think of a driving test. The examiner does not only check that you arrived at the end of the route. They also watch whether you stopped at the red light and used your mirrors. And one good drive does not prove much, which is why people practise many times.

Testing an agent works the same way. You check the end result (did the refund happen once, for the right order?), you look at the route (which tools did it call, with what details?), and you repeat the test, because an AI agent can behave differently each time you run it.

A few words you will see in guides, explained simply:

  • Task: one test, with a starting situation and a clear rule for success. Like one exam question.
  • Trial: one attempt at a task. You usually run several trials per task.
  • Transcript (also called a trace or trajectory): the full record of one trial, every message and every tool call. Like a dashcam recording.
  • Outcome: the final state of the world when the trial ends, for example the order’s status in the database.
  • Grader: the check that gives a score. It can be code, another AI model, or a person.

The precise version of how to evaluate AI agents: run a fixed set of tasks in a clean test environment, several times each, and score both the final outcome and the important steps, so you can compare versions of the agent fairly.

How to evaluate AI agents: the playbook at a glance

  1. Write 20-50 test tasks from real situations.
  2. Build a safe, clean test room for every run.
  3. Grade the end result first.
  4. Check the few steps that really matter.
  5. Run each task several times and count.
  6. Re-run everything after every change.

Play 1: Write test tasks from real situations

Goal: a small list of tasks that look like what real users will ask.

  1. Collect real requests: support tickets, chat logs, bugs your team has seen.
  2. For each one, write the starting situation (the order exists, it was paid) and the success rule (refund issued once, customer told).
  3. Add “should not act” tasks: a refund for an order that is not theirs, an angry message that should go to a human.
  4. Ask a teammate to read each success rule. If two people would grade it differently, rewrite it.

You do not need hundreds. Anthropic’s engineering team writes that 20-50 simple tasks drawn from real failures is a great start. If you are short of examples, the synthetic data playbook shows how to make more from a few real seeds.

Meera wrote 30 tasks, including six where the right answer was “do not refund”. The double-refund bug went straight onto the list.

You are done when: every task has a starting situation, a clear success rule, and some tasks test that the agent says no.

Play 2: Build a safe, clean test room

Goal: the agent can act freely during tests without touching real customers or real money.

  1. Point the agent’s tools at a test copy: a fake orders database, a payment service in test mode.
  2. Reset that copy before every single trial, so one run cannot leave mess for the next.
  3. Save the full transcript of every trial. Your tracing setup can do this for you.

Why the reset matters: if trial 1 already refunded the order, trial 2 might “pass” just because the work was done before it started. It is like a hotel room that must be cleaned before each guest.

Meera used a small script that reloads ten sample orders into a test database before each run.

You are done when: you can run any task twice in a row and both runs start from exactly the same state.

Play 3: Grade the end result first

Goal: a simple pass or fail for each trial, based on what actually changed.

  1. Check the real outcome in the test room, not just the agent’s words. “I have refunded you” means nothing if the database says otherwise.
  2. Use code checks wherever you can: is there exactly one refund row with the right amount? Code checks are fast, cheap and give the same answer every time.
  3. For things code cannot judge, like “was the reply polite and clear?”, use an AI judge with a short scoring guide, as in the AI evals playbook.
  4. Now and then, have a person grade a sample, to make sure the AI judge agrees with humans.

Meera’s main check was one line: count refunds for this order, and it must equal one.

You are done when: every task has an automatic pass/fail check on the final state.

Play 4: Check the few steps that really matter

Goal: catch dangerous or wasteful behaviour on the way, without being too strict.

  1. List the steps that must always or never happen. For example: “must look up the order before refunding” and “must never call the refund tool twice”.
  2. Read the transcript and check only those rules: right tool, sensible details (the order number, the amount), no forbidden calls.
  3. Track simple numbers per trial: steps taken and tokens used. A trial that passes in 40 steps is a warning sign.
  4. Do not demand one exact order of steps. Agents often find a different, valid route, and a strict script would mark that as a failure.

Back to the driving test: the examiner cares that you stopped at the red light, not whether you turned left at the bakery or the bank. If you are new to tool calls, the function calling playbook explains how they work.

Meera added one rule, “refund tool called at most once per order”, and it caught the bug that had slipped past her manager’s demo.

You are done when: you have a short list of must and must-not step rules, checked on every transcript.

Play 5: Run each task several times and count

Goal: know how reliable the agent is, not just whether it can succeed once.

  1. Run every task several times, for example 5 trials each.
  2. Work out the task success rate: passed trials divided by all trials.
  3. For customer-facing agents, also count how many tasks passed in all their trials. Guides call this pass^k (“pass to the power k”). Its cousin pass@k asks whether at least one of k tries worked, which suits tools where a person picks the best attempt.

Here is the idea as a short illustration in Python. run_agent and check stand for your own code:

results = {}
for task in tasks:
    reset_test_database()          # clean room for each trial
    passes = 0
    for trial in range(5):
        transcript = run_agent(task.input)
        if check(task, transcript):
            passes += 1
        reset_test_database()
    results[task.id] = passes

success_rate = sum(results.values()) / (5 * len(tasks))
always_pass = sum(1 for p in results.values() if p == 5)

In plain steps: clean the room, run the task five times, count the passes, then report the overall rate and how many tasks passed every time.

Meera’s first run (illustrative numbers): 84% success rate, but only 21 of 30 tasks passed all five times. The average looked fine; the “every time” number showed the real risk.

You are done when: you report both the success rate and how many tasks pass every single time.

Play 6: Re-run everything after every change

Goal: catch regressions, which means things that used to work and quietly broke.

  1. Save today’s scores as your baseline.
  2. Re-run the full set whenever you change the model, the prompt, a tool, or a setting.
  3. Compare task by task, not only the total. A new model can fix five tasks and break two others.
  4. Every new bug from real users becomes a new task, so it can never come back unnoticed.

Meera now runs the set before every model or prompt change. The double refund would have shown up as a red line before the switch.

You are done when: no change reaches users without a fresh run compared against the baseline.

Which grader should you use?

GraderGood atWatch out forChoose it when
Code checkFast, cheap, same answer every timeCan reject valid answers worded differentlyThe result can be checked in data (refund rows, files, status)
AI judgeTone, clarity, open-ended answersCosts more, can disagree with itselfQuality cannot be checked by a simple rule
Human reviewThe most trusted judgementSlow and expensiveChecking a sample, and calibrating the AI judge

Mistakes to avoid when you evaluate AI agents

  • Trusting the agent’s own words. Fix: check the real outcome in the test room.
  • Testing once and calling it done. Fix: several trials per task, and track the “passes every time” number.
  • Grading one exact path. Fix: grade the result, and only the must/must-not steps.
  • Only happy-path tasks. Fix: add tasks where the right move is to refuse or hand over to a person. The guardrails playbook helps you decide which actions need approval.
  • Testing against real systems. Fix: test copies, reset before every trial.

How to know it is working

  • Your test set has caught at least one real bug before users did.
  • When you read a failed transcript, you can see why it failed in a minute or two.
  • Scores stay stable when you re-run with no changes (apart from small natural wobble).
  • The team asks “what did the evals say?” before shipping a change.

Your checklist

  • ☐ 20-50 tasks from real situations, each with a clear success rule
  • ☐ Some “should refuse” or “hand to a human” tasks
  • ☐ Test copies of every tool, reset before each trial
  • ☐ Automatic checks on the final outcome
  • ☐ A short list of must and must-not step rules
  • ☐ Several trials per task; success rate and “passes every time” recorded
  • ☐ Full re-run and comparison after every change

Frequently asked questions

How is evaluating an agent different from evaluating a chatbot?

A chatbot gives one answer, so you grade that answer. An agent takes many steps and changes things, so you also check the final state of the world and the important steps along the way.

How many test tasks do I need to start?

Twenty to fifty is enough to begin, as long as they come from real situations. Early fixes usually make big differences that a small set can spot. Grow the list as real bugs appear.

What is trajectory evaluation?

It means reading the transcript of a trial (the trajectory) and checking the route the agent took: which tools it called, with what details, and in roughly what order. Use it for safety and cost rules, not to force one exact path.

What is the difference between pass@k and pass^k?

pass@k is the chance that at least one of k attempts succeeds, so it goes up with more tries. pass^k is the chance that all k attempts succeed, so it goes down. Customer-facing agents should care most about pass^k.

Can I rely on public agent benchmarks instead?

Public benchmarks help you shortlist models, but they do not know your tools, your data or your rules. When you learn how to evaluate AI agents for your own product, your own small test set is what tells you if the agent is ready.

Meera’s agent, one month later

Meera’s test set now has 42 tasks. Last week a prompt change looked great in a quick demo, but the evals showed three “should refuse” tasks failing. She fixed it in an afternoon, before any customer saw it. Her manager no longer claps at demos; he asks for the eval report.

Your next step: write ten tasks for your own agent today, including two where it should say no. Then, if your agent runs open models, read the next chapter on choosing open-weight models, or revisit the computer-use agents playbook to test an agent that clicks and types.

Sources: Anthropic Engineering, “Demystifying evals for AI agents” (9 January 2026) for the definitions of task, trial, transcript, outcome and grader, pass@k and pass^k, grader types and the 20-50 task starting point; A Hitchhiker’s Guide to Agent Evaluation (ICLR 2026 blog track) for background on trajectory checks.

1 comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Newsletter

Get the next guide before anyone else.

One email a week with new playbooks and tutorials. No spam, unsubscribe anytime.