Hamel Husain and Shreya Shankar call error analysis “the most important activity in evals”. The idea is simple: before you write any evaluator, read real traces and write down how the product fails. The failures you find decide which evals are worth building. If you skip this step, you end up measuring generic things like “helpfulness” that nobody asked for.
This page is the vault’s synthesis of their long FAQ, AI Evals: Everything You Need to Know. It teaches by opinion. The authors say so themselves: “sharp opinions about what works in most cases. They are not universal truths.” Read it that way. A short companion for product teams is AI Evals for Product Teams.
The loop
- Get a dataset of traces. A trace is the full record of one interaction: messages, tool calls, retrieved data, final answer. No production data yet? Generate synthetic queries to get started, but see the caveats below.
- Open coding. One person reads traces and writes free text notes about anything that looks wrong. Think journaling. Note the first failure in a trace, because later errors often cascade from it.
- Axial coding. Group the notes into a failure taxonomy and count each category. The authors call this the most important step.
- Refine until saturation. Keep reviewing until new traces stop revealing new failure modes. Aim for at least 100 diverse traces, and keep going while you are still learning.
Three numbers worth remembering:
- Annotate at least 30 traces yourself before you let an agent suggest failures. Early suggestions bias your judgment and you miss product specific problems.
- A working pool of about 100 diverse traces is a sane starting point.
- Re-run the analysis after big changes. Between big runs, look at 10 to 20 traces a week, especially outliers: very long sessions, many retries, traces flagged by monitoring.
Rules that are easy to get wrong
- Do not write a rubric first. Reviewers who check a list overlook problems that are not on it. Your idea of “good” shifts as you read outputs (the paper they cite calls this criteria drift). Write the rubric after the first pass.
- Record problems that are not the model’s fault. A support bot that says “your order shipped” with no tracking link is a failure even if the bot has no way to fetch the link. Do root cause analysis later, after you know which problems matter.
- One domain expert decides. For most small and mid size teams, pick a single “benevolent dictator” for quality. It removes disagreement and the paralysis of too many opinions. If five experts must judge one interaction, the product scope is probably too broad. Only add more annotators when you must, and then measure agreement.
- Do not outsource error analysis. It breaks the loop between seeing a failure and understanding the product. Exceptions: purely mechanical labels, tasks that need no product context (translation), and hiring real subject matter experts as your internal domain experts.
- You can help without domain expertise. Many early findings need none: missing logging, vague queries with no follow up, text only answers where a widget would do.
- Design for verification. If outputs are hard to evaluate, treat that as a product smell. Show intermediate facts with links to sources instead of asking a doctor to judge a finished report.
- Build a custom review tool. The authors say it is the highest value investment, and a coding assistant can produce one in hours. Render the data the way the product would, show progress, add keyboard shortcuts.
What the LLM may and may not do
| Fine to automate, with oversight | Do yourself |
|---|---|
| First pass grouping of your own notes | Initial open coding |
| Suggesting which known failure modes apply to a new trace | Validating the failure taxonomy |
| Proposing prompt changes from your notes | Ground truth labels for judge validation |
| Finding patterns in your annotation data | Root cause analysis |
Their example: users keep saying “lag”, the LLM files it under “performance issues”, and you never create a latency category. The rule is to use LLMs to scale what you learned, not to avoid looking at data. The same logic is behind their advice not to hand prompt writing to an optimizer too early. Optimizers climb a metric you already defined. They cannot find new failures.
From failures to evaluators
The authors put evaluators on a cost ladder.
- Fix the obvious first. Many failures are preferences you never put in the prompt (short answers, a format, step by step reasoning).
- Code assertions for anything a rule can check: a record exists, a regex matches, JSON validates. No human labels needed.
- LLM judge only for failures that need judgment, and only for problems you will iterate on. It needs 100 or more labeled examples and weekly upkeep.
Judge design:
- Binary pass or fail, not 1 to 5. People argue about 3 versus 4, pick the middle to avoid deciding, and you need more samples to see a difference. If you want gradual progress, count sub checks: “4 of 5 expected facts included”.
- One judge per failure mode. The most common mistake is one judge asked to catch everything.
- Give each judge only the context it needs. Extra context can make it worse. Test by removing pieces and comparing with human labels.
- Validate against human labels with separate training, development and test sets. Report two numbers: true positive rate (does it catch real failures) and true negative rate (does it avoid false alarms). If test scores are far below dev scores, you overfit. They suggest at least 50 passing and 50 failing labeled examples when debugging a judge.
- Using the same model as the application is usually fine, because the judge does a narrower task. What matters is agreement with humans.
- Generic metrics (helpfulness, BERTScore, ROUGE) are not quality measures. They can still help you find traces to read. Similarity metrics are legitimate for retrieval and diversity checks.
Running and reporting
- One number: a “pass all” rate, where an example passes only if it passes every check, with drill down to each check. Group checks into themes or by severity (release blockers versus tolerable). Avoid weighted composite scores for the same reason as Likert scales: a jump from 3.2 to 3.7 feels good and means little.
- CI versus production. CI uses small, curated, mostly deterministic checks to stop known regressions. Production monitoring samples live traces and uses reference free judges. Feed new failures from production back into the CI set.
- How often to run an eval depends on three things: cost, saturation (does everything pass?) and the business value of catching the error. A saturated, cheap code check can run on every change. An expensive judge that is fully saturated and low value should be retired or run rarely. See the chart in AI Evals: Everything You Need to Know.
- Guardrails versus evaluators. Guardrails sit in the request path and must be fast and nearly free of false positives. Evaluators run after the fact. An LLM judge is almost never a good synchronous guardrail.
- Model selection comes after error analysis tells you the model is the problem.
Agents and long traces

For agentic workflows, measure in two phases. First, treat the agent as a black box and decide if the user’s goal was met. Then run step level checks: tool choice, parameters, error handling, context retention, efficiency, goal checkpoints. Test tool name, arguments, result and resulting state as separate checks, and check authorization and preconditions too. A valid call can still be wrong if the user never approved it.
A transition failure matrix puts the last successful state in rows and the first failure in columns. The counts show where failures cluster, for example one handoff in a text to SQL agent causing 12 failures while another causes 2.
For long traces, focus on the first upstream failure, collapse tool output in the review tool, and reproduce the problem in the simplest test that still fails. A wrong return policy on turn 4 can often be reproduced as a single question. For multi turn tests, simulate users, or give the system the first N minus 1 turns of a real conversation and see what it does next.
For coding agents, public benchmarks suit general agents. Narrow agents need private tasks with a working environment and code based tests, built from your own failure review.
Where this disagrees with the rest of the vault
Contradictions to keep in view
- Eval first development. Eval-Driven Agent Development says to write the eval before the agent can pass it. Hamel says “generally no”: LLM failure modes are too open ended to predict, so write evaluators for errors you found, not errors you imagine. His exception is a constraint you fully understand, such as “never mention competitors”. The two can be reconciled by sequence: Anthropic’s roadmap also starts from real failures and transcript reading, but it does push you to write capability evals ahead of model progress. They differ on how much you can specify before you have seen data.
- Pass rate targets. Hamel warns that a 100 percent pass rate means the evals are not challenging the system and a 70 percent rate may be more useful. Capability vs Regression Evals treats a saturated capability eval as something to graduate into a regression suite. Compatible if you keep the regression copy cheap and add harder cases to the capability side.
- Annotators and agreement. LLM-as-Judge Calibration recommends 2 to 3 human labelers and kappa thresholds. Hamel starts with one expert and only measures agreement when you must have several. His own test for a judge is true positive and true negative rate on held out labels, not kappa. Different statistic, same goal: do not trust a judge you have not checked.
- Judge ensembles. Hamel’s one judge per failure mode matches the dimension split in LLM-as-Judge Calibration and Gold Standard Dataset Workflow.
Caveats
- This is one practitioner pair’s view, taught in a paid course that the page promotes. The numbers (for example 60 to 80 percent of development time spent on error analysis) are experience, not measurements.
- The page is a living document. The captured copy was published 2026-09-18 and modified 2026-09-21.
- Synthetic data is a start, not a substitute. It fails for specialized documents, low resource languages, high stakes domains and underrepresented users, and whenever you cannot check how realistic it is.
- The FAQ names TypeSafe’s Jev classifier as an example evaluator. That is a vendor example, and the authors’ own rule applies to it: validate it on your labels before you trust it.
Related
- Evaluating AI Agents: Anthropic’s vocabulary of tasks, trials and graders
- Gold Standard Dataset Workflow: a solo builder version of the same loop
- Agent Metrics System: measuring value and behavior beyond offline evals
- Session Observability and Replay: the trace data error analysis depends on
- Hamel Husain