How to build evals for an agent, starting with its traces
From the first trace to an evaluator you can trust, and how to tell when the eval itself is wrong.
outcome › Sent for human review. The amount check reported a $250 cap.
The scores look fine. Users still get wrong answers.
I built a small expense-review agent
- LangGraph
- gpt-5-nano
- 5 tools
- 10-section policy
- 42 requests, run 3 times
- Right tools
- Right policy
- Real citation
- Decision and reason
- ✕ Was the decision right?
A $320 hotel night in Port Selene.
The agent sends it to a reviewer.
Four checks. Four passes.
A valid claim is stuck in a queue.
An eval is a repeatable check of one behavior, with evidence.
Repeatable. Rerun it after any change.
One behavior. Say exactly what you check.
Evidence. A record anyone can inspect.
Seven steps. The first two happen once.
The rest repeat every time the agent changes.
Step 6 is the one teams skip.
So what should we have checked?
Three people rely on every review.
Each one leaves different evidence.
A review can work for one and fail another. 23 of 126 did.
“I lost the receipt for my hotel stay. Can you check whether I can still claim it?”
Don't generate 150 queries in one go.
Pick dimensions first.
Combine them into a request.
Run the agent on each. I had 42, three times each.
A trace records everything one run did.
Follow the calls in order.
There: the tool used the standard cap, not Port Selene's.
Write a note where it goes wrong.
9 wrong decisions in 126 runs.
Group them. A $240 dinner for two broke the same way.
Count. Now I know what to fix first.
Now make it a check you can trust
saved = [ node.inputs.get("decision") for node in session.nodes if node.tool_name == "recommend_decision" ] … passed=len(saved) == 1, passed=saved == [reply],
One evaluator per failure mode.
Code, when the trace has the evidence.
A judge, only when it takes judgment.
This code check passed 103 of 126 runs.
Number oneFailures the judge caught
Number twoGood replies it passed
A wrong evaluator is worse than none. Two of mine were wrong.
Give each one four small tests.
For a judge: human labels, two numbers.
Change one thing: the amount check tool.
Predict what should change, and what must not.
A lazy fix passes every row. Add the case that catches it.
Five decisions fixed. Four new finance failures.
Rerunning an agent touches the world.
So replay the recording. Only the changed tool runs live.
One run per case is not proof. Replay each three times.
- Name who relies on the agent
- Design cases from dimensions
- Capture full traces
- Read and note every trace
- Group notes into failure modes
- Write one evaluator per failure mode
- Give each evaluator four small tests
- Add human labels for any judge
- Predict which cases should flip
- Replay, and read regressions first
Traces, time set aside to read them, and the habit of asking how each check could be wrong
Figures from 126 recorded runs of 42 requests. Diagrams are schematic.