Your tracing dashboard is green. Latency is steady, token cost per session is down, and the logs show no errors. Then a user sends a screenshot: your agent answered confidently, completed every step without a single exception, and got it wrong.
This is the gap most teams running AI agents in production fall into. Observability tells you what happened. Evaluation tells you whether it was any good. They are not the same thing, and the second one gets built far less often.
This piece follows our earlier article on AI agent observability, which covered tracing, token costs, and failure recovery. That one covered how to see inside an agent. This one covers the layer that usually gets skipped: how to grade its work.
The Gap: Tracing Yes, Grading No
LangChain's State of Agent Engineering survey paints a clear picture. It was collected between November 18 and December 2, 2025 from roughly 1,340 respondents, so treat these numbers as a late-2025 snapshot, not a current reading:
| Practice | Share of respondents (late-2025 data) |
|---|---|
| Any form of observability | 89% |
| Can inspect individual agent steps and tool calls | 62% |
| Run offline evaluations on test sets | 52.4% |
| Use LLM-as-judge | 53.3% |
| Run online evaluations | 37.3% |
Among teams with agents in production, 94% have observability, yet only 44.8% run online evals. Meanwhile quality was named the single biggest barrier to production by 32% of respondents.
Marmelab's audit of agent harness repositories (September 2026) shows the same pattern from the code side: of 97 harnesses large enough to test, 60% have neither a test nor an eval, and only 5 of 391 repositories record anything about how their harness is actually used.
Anthropic's The 2026 State of AI Agents report (a survey of more than 500 US technical leaders in late 2025) found that 80% of organizations say agents already deliver measurable ROI. That claim is reasonable, but without an evaluation layer it is hard to prove the agent keeps doing good work after a prompt, model, or tool changes.
Three Evaluation Types and When Each Applies
Anthropic's evals guide splits graders into three families. In practice they complement each other.
1. Deterministic checks (code-based)
String matching, JSON schema validation, static analysis, or outcome checks (was the record actually saved, did the tests pass). Fast, cheap, objective, and reproducible. The downside: brittle against valid answers phrased differently, and blind to nuance.
Use when: the output has a clear shape, such as JSON format, correct tool calls, or code that must pass tests. This is what Geoffrey Huntley calls an "oracle that cannot lie": a test, a linter, or a type checker.
2. Golden sets
A frozen set of tasks with known good answers, run end to end and scored. Both Marmelab and Anthropic suggest starting with 20 to 50 tasks drawn from real failures, each with a clean starting state.
Use when: you want a fair comparison between two agent versions, or you need to keep behavior that already works from regressing.
3. LLM-as-judge (model-based)
Another model grades the output against a rubric or through pairwise comparison. Flexible for open-ended tasks such as summaries or support replies, but non-deterministic, more expensive, and it must be calibrated against human judgment.
Use when: quality cannot be captured by simple rules. Do not make it your first layer; make it the last one, for what genuinely needs judgment.
| Type | Strength | Weakness | Best for |
|---|---|---|---|
| Deterministic | Fast, cheap, reproducible | Brittle, no nuance | Format, tool calls, tests |
| Golden set | Fair version-to-version comparison | Needs upkeep | Behavioral regressions |
| LLM-as-judge | Grades open-ended tasks | Costly, needs calibration | Tone, relevance, accuracy |
Build the Golden Set from Production Traces
A common mistake is writing test cases from imagination. The result is a suite that passes at 100% while users keep complaining. Anthropic's guide is explicit: converting user-reported failures into test cases ensures your suite reflects actual usage.
This is where the tracing you already have pays off. The workflow:
- Flag problem traces. User complaints, answers that were corrected by hand, or sessions where the user gave up.
- Freeze the input and context. Store the prompt, retrieved documents, and initial state so the task can be replayed from a clean start.
- Write the correct answer, or at least its pass criteria.
- Make it two-sided. Test cases where a behavior should occur and where it should not. One-sided evals produce one-sided optimization, such as an agent that searches for almost everything.
- Read the transcripts. Before trusting a score, read the transcripts and grades from many trials. Often a "failure" turns out to be a grader rejecting a valid solution.
Anthropic also distinguishes capability evals (low starting pass rate, giving the team something to climb) from regression evals (near 100%, catching backsliding). Capability evals that saturate can graduate into the regression suite.
Decide What "Good" Means Before Writing a Judge Prompt
A judge prompt that says "rate this answer from 1 to 10" is close to useless. First define, per task, what good means:
- Support agent: the answer matches the policy documents, never promises refunds outside the rules, escalates when asked.
- Coding agent: tests pass, no other tests are deleted, the change could be merged without cleanup.
- Research agent: every claim has a source, no invented numbers.
Anthropic's write-up on harnesses for long-running agents gives a concrete example: agents often marked features "done" after only unit tests or a curl call, without confirming the feature worked end to end. The fix was an explicit definition of done (a JSON feature list where only the pass status may change) plus testing "as a human user would" through browser automation.
Pick the right metric too. pass@k (at least one success in k attempts) fits when one good result is enough. pass^k (all k attempts succeed) fits customer-facing agents. A 75% per-trial success rate yields only about 42% for pass^3.
A line from Marmelab is worth pinning to the wall: "Scripts measure and never judge; the agent judges and never measures." Keep measurement (deterministic) apart from judgment (the judge), and let the evaluator see only what it needs: the spec, the tests, and the diff.
Wire Evals into CI So Regressions Cannot Slip Through
A one-sentence prompt edit or a model swap can lower quality without raising a single error. That is why evals have to run automatically:
- Every pull request that touches a prompt, a tool, or model configuration runs the regression suite.
- Set a threshold, for example the regression pass rate may not drop below the baseline. A failure blocks the PR.
- Change one part at a time. Marmelab recommends swapping one harness component and measuring its effect, then removing components to see what each contributes.
- Run it in two places: on the developer's machine and in CI, because not every developer uses the same harness.
- Keep measuring in production. The VS Code team runs offline benchmarks before shipping, then keeps measuring through A/B tests and weekly reporting.
Anthropic stresses that automated evals and production monitoring complement each other: evals are reproducible and never touch users but can give false confidence, while monitoring captures real usage but is reactive.
Conclusion
Tracing tells you the agent is running. Evaluation tells you it is running correctly. Start small: take 20 problem traces from last week, write their pass criteria, add deterministic checks, and wire them into CI. LLM-as-judge comes later, once you know exactly what you want to grade.
Need help building an evaluation pipeline for the agents in your product? The katili.dev team can help, from golden set design to CI integration.