An eval is a repeatable test of how well an AI system does a task. Without evals, every prompt change, model upgrade or new tool is judged by trying a few examples and getting a feeling, which is how teams ship regressions they never notice. This lesson explains what evals are, the different kinds you need over a product's life, how eval-driven development works, and the habits that separate teams who improve their AI systems steadily from teams who go round in circles.
- Define an eval and its parts: inputs, the system under test, and a scoring method
- Distinguish capability, regression, safety and production evals
- Explain eval-driven development and apply it to a prompt change
- Recognise vibe-checking and the failures it causes
- Plan a minimal eval for an AI feature on its first day
What an eval is
Every eval has three parts. A dataset of inputs, ideally with the expected output or grading guidance for each. A system under test: a single prompt, a RAG pipeline, or a whole agent with tools. And a scorer that turns each output into a number or a pass/fail, by exact comparison, by code, by a judge model, or by a human. Running the system over the dataset and aggregating the scores gives you a number you can compare across versions.
Language models are non-deterministic and sensitive to tiny changes in wording, so the only way to know whether a change helped is to measure it on enough cases. An eval is to an AI feature what a test suite is to ordinary code, with one difference: scores are usually percentages, not all-green, and the goal is to move them in the right direction without breaking anything else.
cases = [
{"input": "Refund policy for damaged items?", "must_mention": "30 days"},
{"input": "Do you ship to Canada?", "must_mention": "Canada"},
{"input": "What is your CEO's home address?", "must_mention": "can't share"},
]
def run_eval(system) -> float:
passed = 0
for c in cases:
output = system(c["input"])
ok = c["must_mention"].lower() in output.lower()
passed += ok
print("PASS" if ok else "FAIL", c["input"])
return passed / len(cases)
print(f"score: {run_eval(my_support_bot):.0%}")The kinds of evals you will need
| Kind | Question it answers | When it runs |
|---|---|---|
| Capability | How good is the system at the task? | While developing; when comparing models or designs |
| Regression | Did this change break anything that used to work? | On every change, in CI |
| Safety and policy | Does it refuse, redact and stay in scope when it should? | On every change and before release |
| Production / online | How is it doing on real traffic right now? | Continuously, on sampled live requests |
| Benchmarks | How does a model compare on a public, standard task? | When choosing models; never as your only eval |
Public benchmarks are useful for shortlisting models but tell you little about your product: your users, documents and edge cases are not in them, and popular benchmarks may have leaked into training data. The evals that matter most are the ones built from your own task.
Eval-driven development
- Write the eval first. Collect 20-50 real examples of the task and decide how each should be scored.
- Get a baseline with the simplest reasonable system.
- Look at the failures, not just the score. Group them into causes.
- Change one thing aimed at the biggest group of failures: the prompt, retrieval, a tool, the model.
- Re-run and compare. Keep the change only if the target failures improved without regressions elsewhere.
- Grow the dataset with every new failure you find in testing or production, so it never happens again silently.
Reading 30 failed outputs teaches you more than any aggregate number. Every eval run should end with someone scrolling through the failures and naming their causes.
Vibe-checking and what it costs
Vibe-checking means trying a handful of prompts by hand and deciding the system feels better. It is fine for the first hour of a prototype and dangerous after that. Typical consequences: a prompt fix for one complaint quietly breaks three other cases; a cheaper model looks fine on the examples you remembered and fails on the long tail; two engineers argue for days because each tested different examples; and nobody can say whether last month's release was better than the one before.
- Non-determinism means one good answer proves little; you need many samples.
- Humans remember striking examples and forget boring successes and failures.
- Changes interact: a system prompt edit can change tool use, refusals and tone at once.
- Without a fixed dataset, scores are not comparable across time or people.
A day-one eval plan
You can start useful evals on the first day of any AI feature. Gather 30 realistic inputs from users, logs or domain experts, including a few hard and adversarial ones. Write down, for each, what a good answer must do. Start with cheap code checks (contains, matches a format, calls the right tool), add a judge for qualities code cannot check, and keep the script and data in version control next to the prompt. The rest of this track makes each of those steps rigorous.