Decide what a good answer is, in numbers, before you build. Collect 20 to 50 real cases, including the awkward ones. Grade with code where you can, a second model where you must, and people for the cases that matter most. Run every test several times, re-run the whole set after every change, and keep sampling real conversations after launch.
Most AI systems are tested the same way before launch. Someone on the team types in ten questions, reads the answers, nods, and says it looks good. OpenAI's documentation has a name for this: "vibe-based" evaluation, and it lists it first among the mistakes to avoid.
The trouble is not that the ten answers were bad. It is that nobody can say what happens on the eleventh question, or after next week's prompt change. Ordinary software has test suites for this. AI systems need the same thing, built a little differently, and it is less work than it sounds.

Why AI needs its own kind of test
Two things make an AI system harder to test than a normal program.
First, there is rarely one right answer. A reply can be correct and rude, or polite and wrong, or right in English and clumsy in Gujarati. Second, the same input can produce a different output each time. Anthropic's engineers give a neat illustration of what that means: an agent that succeeds on 75% of single attempts will get three in a row right only about 42% of the time (source). One good run tells you very little.
So the method has to cope with fuzzy answers and with chance. Here it is in six steps.
1. Say what "good" means, in numbers
"The bot should be helpful and safe" cannot be tested. Anthropic's guide to success criteria asks for criteria that are specific and measurable, and gives the contrast itself: "safe outputs" is a bad criterion, while fewer than 0.1% of outputs flagged for toxicity across 10,000 trials is a good one.
Most systems need several measures at once. Is the answer correct? Is the tone right? Did it stay within what it is allowed to do? How long did it take, and what did it cost? Agree these with the person who owns the process before the build, not after. It is the same number we ask for in step two of taking a pilot to production.
2. Collect real cases
You need fewer than you think. Anthropic's engineering team says that 20 to 50 simple tasks drawn from real failures is a great start, and that there is no need to wait for hundreds (source).
The best cases come from what people already ask: support emails, chat logs, call notes, the questions your front desk answers every day. Strip out names and phone numbers first. For each one, write down what a good response is. A useful check from the same article: if two people who know the job would disagree on whether an answer passes, the case is too vague.
3. Add the awkward ones
Clean questions flatter a system. Real traffic does not. OpenAI's guide lists the cases worth adding: typos, several questions in one message, very short requests, long conversations, mixed languages, and attempts to talk the system out of its rules.
Test both directions too. If the agent should hand over to a person when a customer is angry, include angry messages, and also ordinary ones where it should not hand over. A system that escalates everything passes the first test and is useless.
4. Choose how each case is graded

There are three options, and a good test set mixes them.
- Code. Did the reply include the booking reference? Is the output valid for the next system? Fast, cheap and exact, but blind to nuance.
- A second model. Give another model a rubric and ask for pass or fail. This is how open-ended answers get graded at volume. OpenAI's guide warns that model graders have biases of their own, so compare their verdicts with human ones before trusting them. Anthropic adds two tips: let the grader reason before it scores, and use a different model from the one under test.
- People. The most reliable judge and the slowest. Save them for the cases where a mistake is expensive, and for checking the other two graders.
One rule for agents that take actions: grade the outcome, not the claim. Do not check whether the agent said the room was booked. Check whether the booking exists.
5. Run it more than once, then try to break it
Because outputs vary, run each case several times and look at the pass rate, not a single result.
Then set the test sheet aside and attack. This is red teaming: people deliberately trying to make the system leak data, ignore its rules or say something damaging. Microsoft's guidance is clear that this does not replace measurement. A handful of nasty examples shows a problem exists, not how common it is. Whatever the red team finds goes into the test set, so it is checked every time from then on.
6. Keep the tests after launch
A test set you run once is a certificate. A test set you run on every change is a safety net. Anthropic's article draws the line well: tests the system now passes become a regression suite that should stay near a full pass, and run continuously.
This matters because things change under you. The model provider ships a new version. Someone edits the prompt to fix one complaint and breaks three other answers. Run the suite before every release and you find out in minutes.
And keep reading real conversations. The US standards body NIST warns in its generative AI risk profile that testing before deployment may fail to reflect the conditions a system meets in real use. No test set predicts everything customers will ask. A weekly sample of live conversations, with failures added back to the tests, closes that gap.
What this costs
For a focused system, the first version of all this is a few days of work, most of it spent agreeing what a good answer is. That conversation is worth having anyway. It is far cheaper than discovering the answer in front of customers, and it is one of the items we suggest checking in any quote for building an AI agent.
If a builder cannot show you their test set, they are testing by feel. Ask to see it.
Questions people ask
What is an eval in AI?
An eval is a repeatable test for an AI system: a set of inputs, a description of what a good output looks like, and a way of scoring the result. It does for an AI system what a test suite does for ordinary software.
How many test cases do I need before launch?
Fewer than most teams expect. Anthropic's engineering team suggests that 20 to 50 simple tasks drawn from real failures is a good start. What matters is that they look like real traffic and include the awkward cases.
Can one AI model grade another?
Yes, and it is often the only way to grade open-ended answers at volume. But a model grader has to be checked against human judgement first, given a clear rubric, and ideally be a different model from the one being tested.
Does testing end at launch?
No. Real users ask things nobody predicted, and models and prompts change. Keep the test set as a regression suite, re-run it on every change, and review a sample of real conversations each week.
Sources
- Define success criteria and build evaluations (Anthropic documentation)
- Demystifying evals for AI agents (Anthropic Engineering, January 2026)
- Evaluation best practices (OpenAI developer documentation)
- AI Risk Management Framework: Generative AI Profile, NIST AI 600-1 (July 2024)
- Planning red teaming for large language models and their applications (Microsoft Learn)



