Skip to content
bits
Evals that matter · Lesson 7 of 8 · 8 min

Evals for agents

Tutor:

An agent doesn't give one reply. It takes steps: it calls a tool, reads the result, calls another, then answers. So "did the reply look right?" isn't enough. An agent can say "You're booked for Friday!" and have booked Thursday.

Anthropic's guide gives you two things to grade. The outcome: what's actually true at the end, like the booking in the database. The transcript: every step the agent took to get there.

Tutor:

Two layers, per the FAQ:

  1. End to end. Treat the agent as a black box. Define precise success on the final state (the database row, the file, the API side effect), not on the final message.

  2. Step-level diagnostics. When it fails, score the trajectory: tool choice, argument extraction, error handling, context retention. Assert tool name, arguments, result and resulting state separately, in code where you can.

Anthropic adds: grade outcomes rather than exact paths (rigid path checks fail valid strategies), give partial credit on multi-part tasks, and start each trial from a clean, isolated environment so shared state doesn't make results flaky. Across many failures, the FAQ's transition failure matrix (last good state against first failure) shows where workflows tend to break.

One booking, four stepsillustrative: made-up numbers that show the idea, not output from a real modelstep by step

AskThe customer: book my bike in for a service this Friday.

step 1 of 4

Tutor:

There's a second twist: agents vary from run to run. Anthropic uses two measures:

  • pass@k: did at least one of k tries succeed? Fine when a person picks the best attempt.

  • pass^k: did all k tries succeed? This is what a customer feels, because every booking has to work.

If one try succeeds 90% of the time, three tries in a row all succeed only about 73% of the time (0.9 × 0.9 × 0.9).

quick check+20 neurons
Tutor:

Your booking agent succeeds on 90% of single runs. You care that every customer's booking works. Which number should you watch?

    Pick one option

    Pick one, then Check.

    Tutor:

    Your turn. Below is a made-up transcript where the agent told the customer the right thing and booked the wrong day. Write a judge that grades the outcome, then finds the first step that went wrong: the first one that used a wrong value, even if it didn't change anything yet.

    Your turn

    Goal Get a fail outcome, the number of the first step that used a wrong value, and a reason that names the wrong date

    What good looks likeThe coach checks the reply
    • Includes the transcriptnot checked yet
    • Includes the customer's requestnot checked yet
    • Asks about the outcomenot checked yet
    • Asks for the first step that went wrongnot checked yet
    • Asks for JSONnot checked yet
    • Ran at 1.0not checked yet
    • Parses as JSON with outcome and first_bad_stepnot checked yet
    • The outcome is failnot checked yet
    • The first bad step is step 1not checked yet
    • The reason names the wrong date the agent bookednot checked yet
    • The prompt asks for the outcome before the stepsnice to have

    Run your prompt and the replies land here.

      ~0 tokens

      Turn on JavaScript to run prompts.