Most agents ship after a dozen manual spot checks and a good feeling. Fifty carefully chosen test cases will tell you more than that, and more than hundreds of random ones.

Quick Summary – TLDR:

Start your eval set with real failures from logs, support tickets and your own manual testing, not with cases an LLM invents for you.
A set of about 50 cases can catch a 15-point drop in pass rate but will miss a 3-point one, so size it for the regressions you care about.
Score with plain code checks first, then a written rubric, and use an LLM judge only for what the first two can’t measure, after checking it against your own labels.
Run every case several times, because Sierra’s tau-bench found agents that passed a task once often failed it on repeat attempts.
Wire the set into CI so every prompt edit, tool change or model swap triggers a run, and turn each new production failure into a new test case.

In February 2024, a Canadian tribunal ordered Air Canada to pay a passenger about C$812 after the airline’s website chatbot invented a bereavement refund policy that didn’t exist. The sum was small. The failure was the kind that one test question would have exposed: ask the bot about bereavement fares and compare its answer with the policy page. If you want to know how to build an eval set for AI agents, that case is a decent starting point, because it shows what an eval is for. It’s a list of things your agent must not get wrong, written down before a customer finds them.

Frankly, most startups skip this. They try the agent on ten or fifteen prompts, it looks good, and it goes live. Then someone changes the system prompt, or the model provider ships a new version, and nobody can say whether the agent got better or worse. Here’s a process that takes a week, not a quarter.

The most common mistake is asking a model to generate 500 test cases from your product description. You get 500 polite, well-formed questions that look nothing like what your users type, and your agent will pass nearly all of them. Real traffic is messier. People paste half an email, mix two requests into one message, misspell the product name, or ask for something you don’t offer.

So begin with what already exists. Pull the last few weeks of conversations or traces and read them yourself. Hamel Husain, an engineer who writes and teaches widely on LLM evals, has argued for years that error analysis on real outputs should come before any tooling, and he’s right. Read until you stop finding new kinds of mistakes. For most agents that takes 50 to 100 traces, and you’ll end up with a rough list of failure types: wrong tool called, right tool with a bad argument, invented policy, ignored instruction, endless loop.

Your support inbox is the next source. Every ticket that starts with the agent said something wrong is a ready-made test case with the original input attached. After that, your own manual testing: if you or a teammate ever typed a nasty prompt to see whether the agent would break, save it. Those prompts usually live in someone’s chat history and vanish. Put them in the file.

If you have no production traffic yet, write cases by hand, and write the hostile ones first. DPD, the parcel company, disabled part of its customer chatbot in January 2024 after a customer got it to swear and criticise the company in public. A list of ten ways a user might push your agent out of character is cheap to write and would have caught that.

Each case needs three things: the input, including any conversation history and the state of the tools or database the agent will touch, a description of what a good outcome looks like, and a tag for the failure type. Keep it in a JSONL file or a spreadsheet in the same repo as your prompts. Tools like Promptfoo, Braintrust and LangSmith can run and store these for you, but the file comes first. If the cases live only inside a vendor’s dashboard, you’ll hesitate to change vendors.

How big a golden test set for AI agents needs to be

Fifty is a good number to aim for at the start, and the arithmetic explains why. If your agent truly passes 70% of cases, a 50-case run will land anywhere from roughly 57% to 83% just from sampling noise and the randomness in model outputs. The standard error is about 6.5 points. That means a set this size will reliably flag a 15 or 20 point drop, which is the kind of break a bad prompt edit or a model swap causes, and it will not reliably detect a 3 point wobble.

That’s fine. Early on, you aren’t trying to measure small improvements. You’re trying to catch the big breaks before users do. Getting from 50 cases to 500 narrows the noise, but only if the extra 450 are as good as the first 50, and they usually aren’t. Random cases cluster around the easy middle of your traffic. Fifty cases chosen to cover distinct failure types give you more information per case than 500 that all ask where the order is.

A workable mix for a first set: around 20 cases pulled straight from real failures, 15 or so common requests that must never break, 10 adversarial or out-of-scope inputs where the right answer is to refuse or hand off to a human, and 5 where a tool errors out or returns something strange. Adjust the ratio to your product, but keep each bucket small enough that you can name why every case is there. If you can’t explain why a case exists, delete it.

Grow the set slowly and only from evidence. When a new failure shows up in production, it gets added. When two cases test the same thing, one goes. A set that reaches 200 after six months, each case earned by an actual incident, is far more valuable than one that started at 200 on day one.

Scoring: code first, rubric second, judge last

Many teams reach for an LLM judge straight away because it feels like the modern answer. Don’t. Start with checks that need no model at all. Did the agent call the refund tool? Did it pass the correct order ID? Did the final database state match what was expected? Did the response contain a policy number it shouldn’t know? These are assertions, they run in milliseconds, they never disagree with themselves, and for agents that take actions they cover a surprising share of what matters. Sierra’s tau-bench, a benchmark for customer service agents, scores tasks largely by comparing the database state at the end of a conversation with the expected result, not by asking a model whether the chat seemed fine.

What’s left is quality that code can’t check: was the tone right, did the agent explain the denial clearly, did it avoid promising something it can’t deliver. For those, write a rubric. A rubric is a short list of yes-or-no questions with a definition attached to each, such as Does the reply state the refund window as 30 days? or Does the reply offer a human handoff when the user asks twice for a manager? Yes-or-no questions beat a 1-to-10 score. Nobody, human or model, can tell you what the difference between a 6 and a 7 means.

Then, and only then, hand the rubric to an LLM judge for the items that need reading comprehension. The research here is encouraging but comes with warnings. The 2023 MT-Bench paper from Zheng and colleagues found that GPT-4 as a judge agreed with human preferences more than 80% of the time, about the same rate at which humans agreed with each other. The same paper documented position bias, where the judge favours whichever answer comes first, and verbosity bias, where it favours longer answers. A judge isn’t neutral. It’s another model with its own habits.

So test the judge. Take 30 to 40 outputs, grade them yourself, and compare your labels with the judge’s. If it disagrees with you on one case in four, fix the rubric wording before you trust a single number it produces. Use a different model for judging than the one running the agent where you can, and have it give its reasoning before its verdict, so you can read why it failed a case when you look into a drop.

One more habit: keep a human in the loop on the failures. Whenever the pass rate changes, read five failing transcripts yourself. A score tells you that something moved. Only the transcript tells you what.

Run every case more than once

Agents are not deterministic, and a single pass on a single run hides that. The tau-bench authors introduced a metric called pass^k, the chance that an agent solves the same task correctly on all k of k attempts. In their results, GPT-4o succeeded on under half of the retail tasks on a single try, and its reliability fell off sharply as k went up, to below 25% at eight attempts. An agent that works sometimes is a different thing from an agent you can leave alone with customers.

In practice, run each case three to five times and track two numbers: the average pass rate, and the share of cases that passed every time. The gap between them is your flakiness. A case that passes four times out of five is telling you something about the prompt or the tool design, and it’s usually more interesting than a case that fails every time, which tends to be an obvious bug. This costs more in tokens, so keep the set small enough to afford it. With 50 cases and five runs each, that’s 250 conversations per evaluation, which on most current models costs a few dollars.

AI agent regression testing on every change

An eval set that someone runs by hand before big launches will be skipped the first week things get busy. Put it in CI. Any change to a prompt file, a tool definition, a retrieval setting or the model name should trigger a run, with the result posted to the pull request. Pin the model version in your config rather than using a floating alias, so that the day a provider updates what the alias points to doesn’t silently change your product, and so that a model upgrade is a deliberate pull request with a before and after score attached.

Set a rule for failing the build. Because your set is small, don’t gate on the overall number moving by two points. Gate on things that matter: no drop of more than about 10 points in overall pass rate, and zero regressions on a short list of must-never-fail cases, like the ones involving refunds, money or personal data. Ten to fifteen cases tagged critical can carry that rule on their own.

When the build fails, resist the urge to loosen the threshold. Look at which cases flipped. Sometimes the new prompt really is worse. Sometimes the old expected answer was wrong and the agent is now doing the better thing, in which case you fix the case and note why in the commit. Both are good outcomes, since each one makes the set more accurate.

The loop that makes the whole thing pay off runs from production back into the file. Each time a user reports a bad answer, reproduce it, add it as a case, fix the agent, and confirm the case now passes. After a few months your eval set is a written history of everything that has gone wrong, which is a better description of your product than any spec.

The Air Canada tribunal ordered a payment of roughly C$812 for one invented refund policy. A 50-case set with a handful of policy questions in it costs less than that to run for a year.

Also read: How To Measure Dark Funnel Attribution Before You Cut A Channel • How To Calculate Your Startup’s Bus Factor Before It Costs You • How to Verify Email Addresses and Choose the Best Email Verification Service in 2027

The Metropolix, from Startup Fortune

→

This article is posted in AI News, check it out for more related stories.