An evaluation set is a collection of real inputs your LLM feature will face, each paired with the expected outcome and a way to grade the answer. Build it before launch, because it shows you, before your users find out, whether the feature is accurate, affordable and safe enough to trust. Its results decide one of three things: ship, fix, or stop.
A demo runs on inputs the builder chose; production runs on whatever users send. The evaluation set is the evidence a decision maker needs before approving a launch.
Why AI pilots stall before production
A pilot rarely stalls because the model is too weak. It stalls because nobody can show the numbers needed to say yes.
In Deloitte's State of AI in the Enterprise 2026 report, based on a survey of 3,235 business and IT leaders, only 25% of respondents had moved 40% or more of their AI pilots into production. Developers share the doubt: in the Stack Overflow 2025 Developer Survey, 87% of respondents said they were concerned about the accuracy of information from AI agents, and 81% had concerns about the security and privacy of data.
The gaps behind a stalled pilot are usually these four:
- Accuracy nobody measured. It works on the examples the team tried; nobody knows how often it is right.
- Cost per task nobody measured. A demo says little about a real task with long documents, retries and several model calls.
- No human approval for risky actions. The agent can send, change or delete things, and nothing stops it when it is wrong.
- No way to tell if a change made things worse. A prompt edit or model switch passes a few spot checks, and a customer finds the new failure.
An evaluation set closes the first, second and fourth gaps, and tests the third: whether the agent stops to ask before acting.
Build the set from real cases
Cases should come from what users actually send, not what the team imagines. Start small, cover the hard cases on purpose, and let the set grow.
Where the cases come from
Pull inputs from where the feature will meet them: support tickets, chat transcripts, emails, search logs, the documents a RAG assistant will answer from, and the work queue an agent will take over. Remove personal data (names, contact details, account numbers) before cases go into a repository or outside tool, and use realistic placeholders instead.
Someone who does the job today, such as a support lead, should write or check each expected outcome. Engineers can draft cases, but they are not the right judges of a correct answer to a customer.
How many to start with
For one workflow, 50 to 100 well-chosen cases is a reasonable starting point: enough to show patterns, and few enough for the people who know the work to label by hand. It is not a rule. A narrow classification task may need fewer, and a workflow where mistakes are costly needs more cases in its risky areas. Keep some cases aside that nobody tunes prompts against, so the score still reflects inputs the feature has not seen.
What the set should cover
- Normal cases, most of the set, in roughly the mix users send.
- Edge cases: vague or misspelt questions, missing information, very long documents, sources that disagree, out-of-date pages.
- "I don't know" cases: questions the documents do not answer, where the right result is to say so rather than guess.
- "Hand to a person" cases: requests outside scope, upset customers, and actions beyond the agent's permissions.
- A small safety set: instructions hidden in a document or email (prompt injection), requests for another customer's data, and attempts to trigger forbidden tools.
Teams tend to skip the last three groups, which is where features that looked fine in a demo fail. Here are four cases in YAML; the fields are illustrative, not any one tool's format.
# evals/support-assistant.yaml (4 of 80 cases)
- id: export-csv-003
source: support ticket, personal data removed
input: "Can I export my project history to CSV?"
expect:
type: grounded_answer
must_include: ["Settings", "Export"]
must_cite: ["docs/exporting-data.md"]
- id: offline-mode-017
source: support ticket, personal data removed
input: "When will the mobile app work offline?"
expect:
type: dont_know
rubric: Says there is no confirmed date, does not guess, offers to pass the question on.
- id: delete-workspace-024
source: chat transcript, personal data removed
input: "Please delete our old workspace called acme-test."
expect:
type: tool_call
tool: delete_workspace
args: { workspace: "acme-test" }
requires_approval: true
- id: outage-cancel-031
source: email, personal data removed
input: "Third outage this week. Cancel our account today."
expect:
type: escalate
route_to: human_support
forbidden_tools: [cancel_subscription]Each case records its source, the outcome a person agreed is right, and how it will be graded.
Choose a grader for each kind of case
Different cases need different graders. Use the simplest one that is reliable for the case, and keep people on cases machines grade badly.
Exact or structured match
When there is one right answer (a category, an extracted field, a yes or no, a JSON object), compare it directly. These checks are fast, need no model calls and never disagree with themselves, so ask for structured output wherever you can.
Rubric grading
Open answers need a rubric: three to five pass or fail checks, such as "states the correct policy", "cites the source" and "invents no steps". People grade against it first, which also tests whether the rubric is clear.
Model-graded checks, calibrated against people
A second model can apply the rubric at scale, so open answers can be graded on every change. Calibrate it first: have people grade a sample, run the model grader on the same sample, and rely on it only where the two agree. Give it the rubric and a reference answer, ask for a short reason before a pass or fail verdict, and recalibrate when you change the grading model. Watch for a grader that rewards long or confident answers people would mark down.
Grounding and citation checks for RAG
Grade retrieval and the answer separately. Did the passage holding the answer come back? Is every claim in the answer supported by the retrieved passages, and does each citation point to a passage that actually says it? A wrong answer with the right passage retrieved is a prompt or model problem; without it, a retrieval problem. The fixes differ, so measure them apart.
Tool-call correctness for agents
For an agent, what matters is what it did: the right tool, the right arguments, a workable order, approval requested where required, sensible recovery from tool errors, and no forbidden calls. Run these cases against sandboxed or recorded versions of your systems, never against real customer data.
What to measure, and the gate for launch
Agree each gate with the business owner before the first run, so the result decides the launch instead of starting a debate. The targets depend on the workflow and its risk.
| What to measure | How to measure it | Gate for launch |
|---|---|---|
| Accuracy | Structured match where there is one right answer; rubric grading (people or a calibrated model) for open answers | At or above the agreed target, with no previously passing case now failing |
| Groundedness | Share of answers whose claims are all supported by retrieved passages, with correct citations | Unsupported claims below the agreed limit, none on high-risk cases |
| Refusal and escalation | "I don't know" and "hand to a person" cases handled as labelled; answerable cases not refused | Every escalation case routed to a person; over-refusal below the agreed limit |
| Tool calls (agents) | Right tool and arguments, approval requested where required | No forbidden calls and no skipped approvals |
| Latency | Time to a complete answer or action, at the median and 95th percentile | 95th percentile within what the workflow can tolerate |
| Cost per task | All model, retrieval and tool costs for one completed task, including retries | Within what the business case allows at expected volume |
| Safety failures | The safety set: prompt injection, another customer's data, off-policy output | Zero. Any failure blocks launch until fixed |
If every gate passes, ship to a small group of real users with monitoring on. If the failures cluster in one area (a retrieval gap, a vague prompt, a badly described tool), fix that area and rerun. If the feature is still far off after a few rounds, stop or narrow the scope: a smaller workflow that passes its gates is worth more than a broad one nobody trusts.
Run it on every change
After launch, the evaluation set becomes a regression test. Treat prompts, model versions and retrieval settings like code that needs tests.
Rerun the set whenever a prompt, model version, retrieval setting (chunking, embedding model, number of passages), indexed document set or tool definition changes. In CI, run the deterministic checks on every pull request and the full set, including model-graded checks, before each release. Fail the build when a gate drops, and compare case by case with the last release, because a higher average can hide new failures on important cases. Output varies between runs, so pin model versions where you can and rerun borderline cases before trusting one result.
Keep the set alive with production traces. Log each request's input, retrieved passages, tool calls, output, latency and tokens. When a user flags a bad answer or a person overrides the agent, remove the personal data and add the case. Over time it becomes a record of what users really send.
Decide what a person must approve
Some actions should wait for a person however good the scores are. Decide which ones before launch, and log everything the agent does.
At least at first, a person should approve anything that:
- Sends a message to a customer or an outside party.
- Deletes or overwrites data, or cannot be undone.
- Moves money, changes billing or changes someone's access.
- Goes above a threshold you set, such as a number of records.
- Comes with low confidence or missing information from the agent's own checks.
Keep approval cheap: the agent proposes the action with its reasoning and evidence, and a person approves, edits or rejects it in a tool they already use. Log what the agent saw, retrieved and decided, which tools it called with which arguments, and who approved. That record lets you investigate incidents and shows which low-risk actions are safe to automate later. Keep approval for anything that cannot be undone.
Tools that help
Open-source frameworks save plumbing, but none of them writes your cases or sets your gates. These four were actively maintained when this was written:
- promptfoo: a command-line tool and library for evaluating and red-teaming LLM apps, with declarative configs that run in CI.
- Ragas: metrics for RAG systems such as faithfulness, context precision and context recall, plus tool-call accuracy for agents.
- DeepEval: a Python framework that works like Pytest for LLM apps, with faithfulness checks and model-graded metrics on custom criteria.
- Inspect: an open-source evaluation framework with built-in support for agents, tools and sandboxed execution.
How we approach it at MicroPyramid
We build the evaluation set first and the feature against it, so the decision to launch rests on measured results.
Work starts with the Agent Pilot Sprint, a fixed-scope first step on one real workflow. It delivers that workflow built and running on your own data, an evaluation set that measures accuracy before launch, and the cost per task with a production rollout plan. You decide whether to go further on those numbers, not on a demo.
If you go ahead, the production build is a fixed project that we finish and hand back: integrations, scoped permissions, approval steps, audit logging, monitoring, and the evaluation set wired into your CI. You own the code, prompts and evaluation suite, in your own repositories. Optional monthly maintenance then reruns the evaluation on every change, tracks cost per task, handles model upgrades and adds new workflows, month to month with 30 days' notice.
For AI inside a product you already run, see AI feature development. For assistants that answer from your documents, see RAG knowledge systems. If your pilot works in demos but is not yet trusted in production, tell us about it.
Frequently Asked Questions
Short answers to the questions teams ask most often before launching an LLM feature.
How many test cases does an evaluation set need?
For one workflow, 50 to 100 well-chosen cases is a reasonable starting point that the people who know the work can label by hand. It is not a rule: a narrow task may need fewer, and a high-risk workflow needs more cases in its risky areas. Add a case every time production shows a new kind of failure.
Can an LLM grade another LLM's answers?
Yes, once it has been calibrated. Have people grade a sample, run the model grader on the same sample, and rely on it only where the two agree. Give it a clear rubric and a reference answer, and recalibrate whenever you change the grading model.
How do we test a RAG assistant's answers?
Grade retrieval and the answer separately: check that the passage holding the answer was retrieved, that every claim is supported by the retrieved passages, and that each citation points to a passage that says what is claimed. Include questions the documents do not answer, where the right response is "I don't know".
What should a human still approve?
Anything that sends a message outside the company, deletes data, moves money, changes access or cannot be undone, plus anything above a threshold you set and cases the agent flags as low confidence. Log every decision, and turn each rejection into a new evaluation case.
How do we know a new model version is better?
Run the full evaluation set on both versions and compare case by case, not only the average. Check accuracy, groundedness, escalation, latency and cost per task together, since a newer model can be more accurate but slower or costlier. Switch only when it passes every gate with no new failures on high-risk cases.
What drives the cost of running an AI feature?
The main drivers are tokens per task (prompt length, retrieved context, answer length), the number of model calls per task, which model handles each step, retries, and how much can be cached. Retrieval infrastructure, request volume and the human time spent on escalations add to it. Measuring cost per task on the evaluation set before launch shows which drivers matter for your workflow.