learn-agent-launch-with-phoebe / Builder session 8 of 10
Learn Agent Launch with Phoebe · Builder track · Session 8 of 10

Agent-specific evals: when the answer is not the only thing to grade

Sessions b5 to b7 graded three bots on what they said. An agent does not just say things - it takes steps, and the steps are where the money, the data and the damage live. This session grades the path as well as the destination, and then delivers the one number that changes how you read every dashboard you own: not how often the agent can do the task, but how often it does the task every single time.

🟠 Builder track AI engineers · ML engineers · technical PMs 45 min
0-3 · Welcome 3-20 · Trajectory modes + tool-call metrics 20-40 · Build-along: the spec, then pass^k 40-45 · Q&A
Part 0

Two things go wrong that a final-answer eval cannot see

A bot answers. An agent decides, calls, reads, decides again, and eventually answers. Every eval you have built so far grades the last box in that chain, which means two entire failure families are invisible to it: an agent that reached the right answer down a route you would never approve, and an agent that reaches the right answer only sometimes. Both ship happily through a green dashboard.

Live - presented in session Self-study - read after class Official sources covered
★ What you walk out with today The five trajectory matching modes and which one your agent actually needs, the real formulas behind tool-call accuracy in RAGAS, DeepEval and Azure, a written trajectory spec for Beacon's support agent, and pass^k - the reliability number that is almost never on a dashboard and is almost always the one your users experience.
Where this sits b5, b6 and b7 gated three bots on output. b9 assembles all of it into one scorecard and signs it. This session is the bridge: it adds the two agent-shaped measurements that the output gates cannot make, so that the scorecard in b9 has something honest to put in its quality box when the thing being launched takes steps.
Part 1 · the path

Trajectory matching, and its five settings 7 min live

A trajectory is the ordered list of tool calls an agent made. Grading it means comparing that list to a reference list a human wrote, and the entire question is how strictly. Google's Vertex agent evaluation names the modes precisely; treat those names as the vocabulary, because the semantics are what you are actually choosing between.

The reference trajectory for one Beacon support case, written by a human lookup_order → get_refund_policy → request_human_approval → issue_refund_credit Exact match Identical tool calls in identical order. Nothing extra, nothing missing, nothing reordered. The strictest mode - use it only where the sequence IS the contract. In-order match Predicted contains ALL the reference calls in the reference order. Extra calls in between are allowed. It grades the spine of the path and forgives the detours. Any-order match Predicted contains all the reference calls in ANY order. Extras allowed. Use it when the order genuinely does not matter - two independent lookups, say. Trajectory precision = overlap / predicted calls. Falls when the agent makes calls the reference never had. The metric for a flailing agent that tries six tools to do one job. Trajectory recall = overlap / reference calls. Falls when the agent skips a call the reference required. Extras cost nothing here. The metric for a lazy, short-cutting agent. Single tool use Did this one named tool appear anywhere in the trajectory? The cheapest check on the list, and the right one when only one specific call actually matters. One idea, three vocabularies - the names differ, the semantics do not Vertex AI exact match · in-order match · any-order match · precision · recall · single-tool-use agentevals strict · unordered · subset · superset Azure AI Foundry Task Navigation Efficiency: exact_match · in_order_match · any_order_match + P/R/F1 The mode is a product decision, not a default. Pick exact match only where the sequence really is the contract; pick any-order where you would otherwise punish a smarter path than the one you happened to write.
🔍 Click to zoom - six ways to compare a path to a reference, and three vendor names for each of them
LivePrecision and recall are a pair of dials, not a score4 min▶

The binary modes give you a verdict. Trajectory precision and recall give you a diagnosis, and the diagnosis is usually more useful in the week before launch:

  • Recall high, precision low. The agent does everything it should, plus a pile of things it should not. It is exploring. This costs latency and tokens, and every extra call is an extra chance to touch something it should not have touched.
  • Precision high, recall low. Everything it did was legitimate, but it skipped steps. This is the dangerous one: the skipped step is often the verification call, the policy lookup, or the human approval.
  • Both low. The agent is not doing the task. Stop tuning the eval and go look at ten traces.

Azure reports exactly this shape under Task Navigation Efficiency: the three match modes plus precision, recall and F1 over the tool sequence. Report the pair, not the F1, at least until launch - the F1 hides which of the two failure shapes you have, and they have completely different fixes.

Self-studyThe reference trajectory is a design artefact, and it will be wrong3 min read▶

Writing a reference trajectory forces a decision most teams have never made explicitly: what is the approved way to do this task? That is a policy question wearing an engineering costume. The first version of your reference set will encode how you happened to build the agent last month rather than what the business requires, and you will discover this the first time a genuinely better path fails exact match.

The correct reaction is not to loosen every case to any-order. It is to sort the reference calls into two kinds: required calls, which carry policy or safety weight and belong in an in-order match, and incidental calls, which are one valid implementation among several and should not be graded at all. Most reference trajectories shrink by half when you do this, and get sharper as they shrink.

Part 2 · the calls

Tool-call metrics, with the formulas they are actually computing 6 min live

Four libraries, five metric names, and only three underlying questions: were the right tools called, were they called with the right arguments, and did the task get done. Knowing which question a metric answers is the whole skill - the names do not tell you.

RAGAS Tool call accuracy = argument accuracy x sequence-aligned indicator. Strict order is the default; a flexible-order mode is available for genuinely free paths. DeepEval Tool Correctness = correctly used tools / total tools called. Deterministic, not judged, with strictness dials for parameters, output and ordering. DeepEval Task Completion = AlignmentScore(task, outcome). Referenceless, needs the full trace, default threshold 0.5. Grades the destination, not the path. Azure AI Foundry Tool Call Accuracy A 1-5 judge score thresholded to pass/fail, default threshold 3. Tool Input Accuracy grades the arguments as a separate criterion. Azure AI Foundry Intent Resolution + Task Adherence Did the agent understand what was actually asked, and did it stay inside its instructions? The two judged bookends around the tools. Which of these do you actually need? Read your own situation off this You have a reference trajectory and the order is the contract → trajectory match, exact or in-order. You have a reference but the path is legitimately free → tool correctness, or precision and recall as a pair. You have no reference at all, only a task and an outcome → task completion, judged and referenceless. The last one is the cheapest to write and the most expensive to trust. It is a rung-4 grader in agent clothing. Notice the ladder from b1 reappearing. Tool correctness is a rule. Trajectory match is a rule. Task completion and Azure's 1-5 scores are judges. Reach for the rules first, and calibrate anything on the judge rung.
🔍 Click to zoom - five metrics, three underlying questions, and where each sits on the grading ladder
Real world

Task Completion is seductive and it is a judge. It needs no reference trajectory at all - hand it the task and the trace, and it returns an alignment score against a 0.5 default threshold. That convenience is exactly why it spreads through a codebase: it is the only agent metric you can add without doing the work of writing references. But referenceless means there is nothing to disagree with the model, so it inherits every bias from b4 and reports them as task success. Use it as a trend alongside deterministic tool metrics, never as the blocking gate, and calibrate it against human labels before you quote its number to anyone.

Part 3 · the headline

pass@k and pass^k pull in opposite directions 7 min live

These two look like variations on one idea and they are opposites. One asks whether the agent can. The other asks whether it does, every time. Research optimises the first because it measures headroom. Production runs on the second, because production is not a single run.

pass@k - at least ONE of k trials succeeds 1 - E[ C(n-c, k) / C(n, k) ] The capability metric. It RISES with k. Answers: can this agent do it at all? pass^k - ALL k trials succeed E[ C(c, k) / C(n, k) ] The reliability metric. It FALLS with k. Answers: can it do it every single time? One task the agent passes 75% of the time, asked to succeed k times in a row k = 1 75% k = 2 56% k = 3 42% k = 4 32% k = 5 24% k = 6 18% k = 7 13% k = 8 10% tau-bench (Sierra): the same agent, the same tasks, simply asked to be consistent Success is not judged. A task passes when the final DATABASE STATE matches the goal state - execution-rung grading for agents. On the retail domain, GPT-4o-class agents score under 50% at pass^1 and under 25% at pass^8. tau2-bench extends it with dual-control environments, where the user can act too, and a telecom domain. Your dashboard reports a single-run pass rate, which is a pass@k-shaped number. What your users actually experience is pass^k, and it is always lower. Capability is not reliability.
🔍 Click to zoom - two formulas, one decay curve, and the benchmark that made the point stick
The arithmetic nobody does out loud A workflow with three agent steps, each independently reliable 75% of the time, completes end to end 0.75 x 0.75 x 0.75 = 42% of the time. Your quality review saw three green 75% numbers and signed. Your users see a coin flip that loses. Multi-step agents do not add error, they multiply it, and the per-step number that looks acceptable in isolation is the number that destroys the workflow.
LiveWhy tau-bench grades the database and not the sentence3 min▶

tau-bench made one design choice that is worth stealing outright: a task succeeds when the final database state matches the goal state. No judge, no reference answer, no string comparison. Just: did the world end up the way it was supposed to?

That is the execution rung from b1, applied to agents. It is deterministic, it is free of judge bias, and it is immune to an agent that describes doing the right thing while doing the wrong thing - a failure mode that is otherwise very hard to catch, because the narration is generated by the same model that took the action. If your agent writes to anything at all, you have a state to compare, and you should be grading it there rather than asking a judge whether the response sounded correct.

Self-studyThe agent benchmark landscape, in one paragraph each4 min read▶

WebArena puts agents in realistic self-hosted web environments. The best GPT-4 agent scored 14.41% against a human rate of 78.24%. That gap is the honest starting point for anybody about to promise a browsing agent.

GAIA asks questions that are easy for people and hard for assistants: humans reach 92%, GPT-4 with plugins reached 15%. It is the clearest available demonstration that "hard for a model" and "hard for a person" are unrelated axes.

SWE-bench contributes the validation pattern most worth copying. Each task carries FAIL_TO_PASS tests, which must go from failing to passing, and PASS_TO_PASS tests, which must stay passing. That second set is the regression suite in miniature, and it is what stops an agent from "fixing" the bug by breaking the rest of the repository. If your agent produces anything verifiable, build both halves.

BFCL checks tool calls deterministically by parsing them into an abstract syntax tree and comparing structure rather than strings, which is why it can grade function calls without a judge. It is now at V4 with holistic agentic evaluation. Its lesson for you: a tool call is structured data, so grade it as structured data.

Demo 1 of 2

Write Beacon's trajectory spec ★ 11 min · everyone builds

Beacon's support agent can issue refund credits, which is what made it T3 in b9. That capability is a sequence of tool calls, and this is where you decide which parts of that sequence are policy and which are implementation detail.

Take five real traces from your agent - actual traces, not imagined ones - and write down the tool calls each one made, in order. You now have five candidate reference trajectories and, almost certainly, five different paths for tasks you thought were the same.

For each call in each trace, mark it required or incidental. Required means policy, safety or correctness depends on it: the approval call, the policy lookup, the permission check. Incidental means it is one valid way among several. Delete every incidental call from the reference - grading it only punishes better implementations later.

Now choose the match mode per case, not per suite. Cases where a required call must happen before another get in-order match. Cases where two lookups are independent get any-order match. Reserve exact match for the handful of cases where an extra call is itself a violation.

Write one row of the spec in a format you can execute. Keep the required calls, the mode and a comment saying why that mode - the comment is what stops somebody loosening it in six months without knowing what they gave up.

★ one row of Beacon's trajectory spec id: T-014 input: "refund my last order, it arrived broken" reference_trajectory: - lookup_order - get_refund_policy - request_human_approval # required: T3 rail, must precede any credit - issue_refund_credit match_mode: in_order # extras allowed; the ORDER is the policy canary: true # approval-before-credit is a 100% gate, not a rate
The trap in step 3 Teams reach for exact match because it feels rigorous, then spend the next month marking false failures as false and quietly loosening thresholds until the suite means nothing. Exact match on a free-form path does not measure quality, it measures how closely the agent imitates the person who wrote the reference. Choose the loosest mode that would still catch the failure you are afraid of, and write down which failure that is.
Demo 2 of 2

Compute pass^k on a task you already ship ★ 9 min · everyone runs

This takes fifteen lines and one afternoon of compute, and it is the single most uncomfortable number you can put in front of a launch meeting. Do it before somebody else does.

Pick one task your agent already handles. Run it n = 10 times from an identical starting state, with whatever temperature and tooling production uses. Do not lower the temperature for the experiment - you are measuring production, not a laboratory.

Score each run at the execution rung if you can: did the final state match the goal state? Count the successes as c. Resist the urge to grade partial credit; pass^k is a consistency measure and partial credit dissolves it.

Plug n and c into the estimator and read pass^k for k = 1, 3 and 5. Then look at how many steps your real workflow chains together and read the number for that k. That is the number your users meet.

Repeat for your five highest-traffic tasks and put the pass^3 column next to the pass@1 column in one table. The gap between those two columns is the gap between your demo and your support queue.

★ pass^k in fifteen lines from math import comb def pass_hat_k(n, c, k): """n = trials run, c = trials that succeeded, k = successes required in a row.""" if c < k: return 0.0 return comb(c, k) / comb(n, k) # Beacon support agent, one refund task, run 10 times, 8 passed pass_hat_k(10, 8, 1) # 0.800 the number on the dashboard pass_hat_k(10, 8, 3) # 0.467 the number a 3-step workflow meets pass_hat_k(10, 8, 5) # 0.222 the number a 5-step workflow meets # same data, the other direction: pass@k RISES, because one success is enough # 1 - comb(n - c, k) / comb(n, k) -> k=3 gives 1.000
What to do when the number is bad It will be bad. Three responses actually work, and none of them is a better prompt. Shorten the chain: fewer steps multiply less. Make a step deterministic: every step you move out of the model and into code stops contributing variance at all. Add a verification step with a retry: a checked-and-retried step is far more reliable than an unchecked one, which is the whole argument for tool output verification in b9. Notice that all three are architecture changes, which is why this number belongs in a design review and not in a dashboard.
Homework

Try it yourself - this week ◐ 50-60 min total

Source material

Official sources covered

Every framework and figure on this page traces to a primary source - vendor evaluation documentation, published benchmarks, and peer-reviewed papers catalogued in this course's source map. This page covers:

✓Vertex trajectory modes: exact, in-order, any-order, precision, recall, single-tool-usePart 1 · mapped to agentevals and Azure vocabularies
✓RAGAS tool call accuracy; DeepEval Tool Correctness and Task Completion, with formulasPart 2 · thresholds and dials as published
✓Azure agent evaluators: Tool Call Accuracy 1-5 at default threshold 3, Tool Input Accuracy, Intent Resolution, Task AdherencePart 2
✓pass@k and pass^k estimators, and tau-bench's database-state grading with retail pass^1 and pass^8Part 3 + Demo 2 · tau2-bench named
◐Agent benchmark landscape: WebArena, GAIA, SWE-bench, BFCLSelf-study card · surveyed for the patterns, not taught
◐Judge calibration behind Task Completion and Azure's 1-5 scoresNamed here as a caution · b4 owns the procedure
◐Wiring the trajectory suite into a blocking pipelineSpecified here · b10 makes it run
Check yourself

Three questions before you go 🎯 ◐ 90 seconds

1 · Your agent's trajectory scores high recall and low precision against the reference. What is it doing?

Recall is overlap over the reference calls, so a high recall means nothing required was skipped. Precision is overlap over the predicted calls, so a low precision means the agent added calls of its own. That is the flailing shape: correct but wasteful, and every unnecessary call is another chance to touch something it should not have touched. The opposite pattern - high precision, low recall - is the more dangerous one, because the skipped call is usually the verification or the approval.

2 · A task your agent passes 75% of the time is used three times in one workflow. What is the end-to-end success rate?

This is the pass^k arithmetic and it is the reason capability numbers flatter multi-step agents so badly. Three green 75% steps in a design review look acceptable; the workflow they compose fails more often than it succeeds. tau-bench showed the same shape on real agents: GPT-4o-class systems under 50% at pass^1 fall under 25% at pass^8 on retail, with no change to the agent or the tasks. The fixes are architectural - shorten the chain, make steps deterministic, verify and retry - not prompt-level.

3 · Why is DeepEval's Task Completion metric a poor choice for a blocking gate, despite being the easiest agent metric to adopt?

Referencelessness is exactly what makes it convenient and exactly what makes it untrustworthy as a gate. It needs the full trace and the task, and it returns a judged score, so it sits on rung 4 of the grading ladder with all the position, verbosity and self-enhancement biases that implies. Run it as a trend beside deterministic tool metrics, calibrate it against human labels before quoting it, and block on the rules instead.

Builder session 8 cheat sheet · pin this

Grade the path, not only the answerAn agent takes steps. Two failure families - a bad route to a right answer, and a right answer only sometimes - are invisible to output-only evals.
Five modes, one choiceExact (identical + same order), in-order (all reference calls in order, extras fine), any-order (extras fine, order free), precision, recall, single-tool-use.
One idea, three vocabulariesVertex modes = agentevals strict/unordered/subset/superset = Azure Task Navigation Efficiency with P/R/F1. Do not re-learn it three times.
Precision and recall are a diagnosisLow precision = flailing, extra calls. Low recall = skipping steps, usually the verification or approval. Report the pair, not the F1.
Required vs incidental callsOnly policy-bearing calls belong in a reference trajectory. Grading incidental calls punishes better implementations later.
Tool metrics sit on the ladder tooTool Correctness and trajectory match are rules. Task Completion and Azure's 1-5 scores are judges. Rules block, judges trend.
pass@k rises, pass^k fallspass@k = 1 - E[C(n-c,k)/C(n,k)], at least one success. pass^k = E[C(c,k)/C(n,k)], all k succeed. Production is pass^k.
Capability is not reliability0.75 per trial is 42% over three. tau-bench: under 50% at pass^1, under 25% at pass^8 on retail. Grade the final database state, not the sentence.