Start with the task contract
Before choosing metrics, define what successful execution means for each task family. A useful task contract describes:- the user intent and relevant context;
- the allowed tools and side effects;
- the expected intermediate decisions;
- the evidence required before answering;
- the acceptable fallback or escalation path;
- the conditions that must never occur.
Score the trace, not only the answer
A final-answer score hides where the workflow failed. Trace-level evaluation separates the system into observable decisions:| Layer | Questions to evaluate |
|---|---|
| Routing | Did the agent select the correct workflow and risk policy? |
| Retrieval | Did it query the right source and preserve relevant evidence? |
| Tool use | Were the tool, arguments, sequence, and retry behavior valid? |
| Synthesis | Is the answer supported, complete, and appropriately uncertain? |
| Policy | Were authorization, privacy, and escalation rules respected? |
| Operations | Were latency, cost, and failure signals captured for diagnosis? |
Turn evaluation into a release decision
An evaluation run is useful only if it changes what the team does. I use three kinds of decision rules:- Hard blockers for security, privacy, authorization, or destructive-action failures.
- Segmented quality checks for critical intents, languages, sources, and user groups.
- Trend checks to catch a regression that a global average would hide.
Close the loop with production feedback
Offline tests protect known behavior, but production traffic reveals new language, intents, source gaps, and integration failures. The feedback loop should collect:- explicit user feedback with the associated trace;
- fallbacks and human escalations;
- tool errors, timeouts, and repeated calls;
- low-confidence retrieval and missing citations;
- corrected answers from subject-matter experts;
- incidents grouped by task family and root cause.
Diagnose failures before changing the model
When an evaluation fails, changing the model first is often the most expensive response. I classify the failure before choosing a fix:- contract failure: the expected behavior was never defined clearly;
- context failure: required information was missing or stale;
- retrieval failure: the right evidence was not found or ranked;
- orchestration failure: the workflow chose a wrong branch or tool sequence;
- tool failure: an integration returned an error or ambiguous result;
- generation failure: the model misinterpreted good evidence;
- policy failure: a guardrail or confirmation boundary was bypassed;
- evaluation failure: the test or judge itself is unreliable.