Evaluating AI Agents
Evaluating an AI agent differs from evaluating a single response. The path to the result matters alongside the result itself.
Why Output Alone Is Not Enough
An agent reaches its result through several steps. A correct final output produced by a flawed path will not reproduce.
| Situation | Final output | Path | Assessment |
|---|---|---|---|
| Ideal | Correct | Right tools, minimal steps | Good |
| Accidental success | Correct | Wrong tools tried repeatedly | Low reproducibility |
| Near miss | Wrong | Sound procedure, one bad step | Easy to fix |
The second case may well fail next time under identical conditions. Looking only at output hides that difference.
Evaluate the Trajectory
A trajectory is the record of the steps an agent took. Evaluate it along these lines.
| Aspect | What to look at |
|---|---|
| Tool selection | Were the right tools chosen, without wasted calls |
| Order | Were prerequisite steps skipped |
| Step count | Could the same result come from fewer steps |
| Retries | Was the same failure repeated |
| Stopping decisions | Were approval-required operations correctly held |
Trajectory records come from automatic logging through hooks.
Common Metrics
| Metric | Description |
|---|---|
| Task success rate | Share of runs meeting the completion condition |
| Step efficiency | Steps and tool calls needed to finish |
| Safety | Share of approval-required operations correctly held |
| Recovery rate | Share of failures the agent resolved on its own |
Do not collapse these into a single number. Optimizing success rate alone tends to inflate step count and cost.
Build a Task Set
Agent evaluation needs a reproducible set of tasks with known correct outcomes.
- Extract representative cases from real work
- Always include cases that failed previously
- State completion conditions in a form that can be checked mechanically
Including past failures matters most: it reveals whether an intended improvement quietly reintroduced an old problem.
Summary
- Agent evaluation covers the execution trajectory, not just the final output
- Accidental and reproducible successes are indistinguishable from output alone
- Evaluate tool selection, order, step count, retries, and stopping decisions
- Maintain a reproducible task set that includes past failure cases