Skip to main content

AI product evals

A model benchmark helps you choose a starting model. A product eval checks whether your actual application meets a user’s goal, including its prompts, retrieval, tools, permissions, and application code. A fluent answer is not evidence that the requested action succeeded. This workflow synthesizes Hamel Husain’s evals flashcards and FAQ with OpenAI’s evaluation guidance. It complements Agent harness: the harness controls execution; evals provide evidence about its behavior.

Start with failures, not a dashboard

A trace records the path from a user request to its outcome: messages, retrieved context, tool arguments and results, and relevant state changes. For multi-agent work, preserve a shared trace ID and the source and ordering of events.
  1. Collect diverse traces. Mix random samples with different workflows, negative feedback, retries, and unusually slow runs. Keep some random sampling even after you know which failures to search for.
  2. Write open-ended notes first. Have someone who understands the product inspect examples before an automated reviewer suggests labels. Record what went wrong for the user, including ordinary code or design bugs, not just model errors.
  3. Group recurring failures. Turn notes into specific categories such as “booked an unavailable slot” or “claimed success after a tool failed.” Then label pass/fail for each relevant criterion and retain the evidence.
  4. Prioritize and repeat. Consider frequency, impact, and remediation cost. Continue until new reviews stop revealing or changing failure categories; revisit after meaningful product changes.
Hamel suggests a pool of roughly 100 diverse traces, with an initial manual pass. Treat this as a starting heuristic, not a statistical guarantee or a reason to delay starting with a smaller batch. Discovery and measurement need different samples. A batch selected for retries helps find problems, but its failure rate is not the production failure rate. Keep the sampling method with the results; use representative sampling or an explicit weighting scheme for prevalence estimates. Redact secrets and unnecessary personal data before sharing traces or sending them to an external judge.

Turn an observed failure into a regression case

For a long conversation, locate the first upstream failure before counting its downstream consequences as separate problems. Preserve the full trace for investigation, then minimize the reproduction. Consider an illustrative scheduling agent:
The smallest useful test may only need the request and the availability result. In N-1 testing, replay the valid conversation prefix before the failing step and evaluate what the system does next. Keep the expected behavior outside the input; do not feed the original failed answer or its label back to the system under test. A practical test record can include: Run replay tests in a sandbox with mocked tools or isolated test accounts, never against live booking, payment, or deletion endpoints. If the workflow or tool schema changes substantially, rebuild stale fixtures. Keep end-to-end tests too: passing an isolated next-step test does not prove the whole session succeeds.

Use the cheapest trustworthy check

Fix obvious prompt omissions and ordinary bugs first. Add cheap regression tests where useful; invest in an LLM judge when an important semantic failure needs repeated measurement. Do not wait for a real incident to test known safety requirements, such as authorization or irreversible actions. Prefer a narrow pass/fail criterion over an undefined “quality: 4/5.” For the scheduling example, separate “did not book an unavailable slot” from “did not claim an unconfirmed booking succeeded.” Each needs different evidence. Numeric scores or pairwise comparisons can still be useful when their meaning is explicit and validated; binary labels are a practical default, not a universal law. A semantic grader can return a small structured result such as:
This is an illustrative format, not a vendor API. Make it possible for a human to check the cited event. Missing evidence or a grader timeout is an evaluation error requiring review, not an automatic pass.

Check the path, conversation, and final state

LangChain’s agent-evals guide distinguishes several evaluation scopes. Pick the scope that can actually reveal the failure: A sequence of individually reasonable turns can still fail the overall task. Conversely, different tool sequences can achieve the same valid result. Assert necessary constraints—such as approval before a write or no duplicate booking—rather than requiring one exact trajectory unless that sequence is itself a requirement. For state-changing tasks, start every evaluation from a clean, known fixture and inspect the state afterward. A coding task can be scored with the repository’s tests and the resulting diff instead of the agent’s “done” message. Keep the trusted grading checks outside the agent’s editable work products, and do not let success depend only on tests the agent wrote or changed itself. Containers are one way to isolate such tasks, not the definition of every benchmark and not a complete security boundary by themselves. Limit credentials, network access, mounts, and run time to what the test needs. Record the fixture version, tool configuration, grading result, and trace. Repeat stochastic cases when needed and report passes over attempts; record infrastructure errors and timeouts separately rather than silently excluding them or counting them as success.

Calibrate the judge against people

A second model’s opinion is not ground truth. Build a human-labeled set containing both passes and failures for the same criterion, and resolve unclear definitions before tuning the judge. Separate examples by purpose:
  • Train/examples: choose few-shot examples for the judge prompt.
  • Development: revise the rubric and inspect disagreements.
  • Held-out test: check generalization without tuning on these labels. Keep related traces and paraphrases together so they do not leak across splits.
There is no universal split ratio or acceptable score. Hamel’s card shows an example split, while the FAQ emphasizes choosing targets from the costs of missed failures and false alarms. Define the positive class explicitly. Here, positive means an actual failure:
  • TPR / failure recall = TP / (TP + FN): how many human-labeled failures the judge catches.
  • TNR / specificity = TN / (TN + FP): how many human-labeled passes the judge correctly leaves unflagged.
If 95 of 100 cases pass, a judge that always says “pass” has 95% accuracy but 0% failure recall. Report both rates and their sample counts; if a class has no examples, its rate is undefined, not 100%. Small samples leave substantial uncertainty. Recheck agreement after changing the judge model, rubric, or application distribution. Review false alarms and missed failures rather than merely optimizing the aggregate score. Keep the application model/prompt and the grader configuration versioned so score changes remain interpretable.

Separate regression tests, monitoring, and guardrails

A check after the response can discover a bad purchase; it cannot prevent that purchase. Enforce permissions before the side effect, outside the model. Guardrails also need latency and false-alarm budgets. Do not retry payments or other writes blindly when a check fails; see purchase approval boundaries. CI pass rates are not estimates of user satisfaction: regression suites deliberately overrepresent known failures. Likewise, a green suite proves only what it covers. Keep adding independently reviewed production failures and deliberate edge cases, and rerun relevant evals when code, prompts, models, retrieval, or tools change.

A minimal starting checklist

  • Review a small, diverse batch with a product/domain expert.
  • Name one important failure and retain its trace evidence.
  • Reproduce it with a minimal safe fixture and a clear assertion or rubric.
  • Validate any automated judge against both human-labeled passes and failures.
  • Compare the current and candidate systems on the same versioned cases.
  • Assign an owner for failures and feed new production cases back into the suite.

References

Last modified on October 15, 2026