Agent Evaluation
Score the journey, not just the ending
Evaluating agents needs more than final-answer scoring: tool selection, step correctness, safety, and honest failure each count. Trajectory-aware evals on golden tasks capture what single-answer grading misses.
What you will learn
- Define evaluable agent dimensions
- Build trajectory-aware golden evals
- Track safety and honest-failure rates
What is this?
Agent eval judges the full trajectory: goal completion (task-level success), step correctness (right tools, right args, right order), efficiency (calls/time), safety (no forbidden actions), and honest failure (aborting rightly vs faking). Golden tasks with expected outcomes + rubric scoring, run in harness, replace vibes with metrics.
Why do you need it?
- A right answer by a wrong, fragile route is a latent incident.
- Tool-choice mistakes are earlier signals than final text.
- Safety violations must be caught even when output looks fine.
- Evals become the regression net holding agent changes honest.
Mental model
A flight test of a new checklist
Trajectory eval
Landing (final answer) isn't enough: did the crew fly the right route, call ATC, check fuel, abort on the right trigger? A flight-test matrix scores each phase. Passing the landing while skipping every procedure is a failed test — same for agents.
How it works
- Pick dimensions: success, tool correctness, efficiency, safety, honesty.
- Author golden tasks with expected tool traces + outcomes.
- Run the agent in a harness (sandboxed tools, recordable).
- Score trajectory: rubric and automated checks per dimension.
- Eval in CI: regression signals on every prompt/model/loop change.
Trajectory scoring.
In production
- CI blocks agent changes that regress tool-choice accuracy.
- Support agents are graded on escalated-vs-resolve decisions.
- Safety harness asserts no denied-tool calls on red-team cases.
Best practices
- Score trajectory: tool correctness matters separately from final answer.
- Include failure-mode cases (tool down, ambiguous goal).
- Track honest-failure rate; a good abort is not a failure to punish.
- Automate and run in CI; evals are regression nets.
Common mistakes
- Grading only the final string.
- Golden cases that are easy for agents to game.
- No safety dimension — clean output, messy methods.
Common issues
Evals pass but prod failsGolden cases differ from real tasks
Harvest real sessions into the eval set; weight by traffic.
Safety violations missedNo deny-path cases
Add red-team cases that tempt forbidden tools.
Debugging tips
- High final-score, low trajectory-score → route robos; inspect tool traces.
- Agents diverge on same seed → evaluate deterministically (seeds, tool mocks).
- Eval flakiness → mock external tools; freeze versions.
Interview checkpoint
Hands-on lab
- Run a recorded trajectory through a scorer
- Score tool-choice and order
- Detect safety violations
Score an Agent Trajectory
40 min · advanced
Quick quiz
Trajectory eval scores…
A good honest abort should count as a failure.