RAG Acceptance Criteria
In this article
- Write the scope of a RAG assistant: who asks, who owns the documents, and what it declines or hands to code.
- Build a corpus manifest and a labelled query set with a held-out split, five slices and abstain rows.
- Write each acceptance gate as a metric, a threshold and the set it is measured on, before any code exists.
- Tell a criterion nobody could mark failed from one a reviewer can check with a number, and rewrite the first into the second.
- Terms defined here: corpus manifest.
Overview
Your team has built a staff assistant that answers questions from the company's policy documents. On day three there is a demo: five questions, five good answers, everyone nods. Then someone asks whether it is ready to ship, and nobody can say. Nobody wrote down what "ready" means, so every later argument about a new index, a new prompt or a release turns into a matter of taste.
The fix is a short document written before the first line of code: an acceptance spec. It has four parts, and this page builds each one for the same assistant:
- Scope and non-goals: who asks, who owns the documents, and what the assistant refuses or hands to other code.
- A corpus manifest: the exact list of documents it may search.
- A labelled query set: test questions with the right evidence for each, including a part you never tune on.
- Gates: one threshold per check, each a number a reviewer can compare a run against.
The assistant is a retrieval-augmented generation (RAG) system: it searches the company's own documents and has a language model answer from what it finds, data the model never saw in training [1]. The company, its documents and every number below are made up for this example.
Why the spec comes first
Microsoft's guide to building RAG solutions starts with a preparation phase that comes before any chunking or indexing: define the business domain, gather test documents that represent the real collection, and gather test queries [1]. The same guide asks you to understand every step of the process before you set acceptance criteria for each step [1]. Criteria written after the first experiment tend to describe what it happened to do; written before, they describe what the business needs.
Scope and non-goals
The business requirements decide which questions the assistant must answer and which documents answer them [2]. So the spec opens with people.
Two personas ask questions: an employee, in the group all-staff, and a manager, in all-staff and managers. Two teams own the documents: HR and Finance. Owners confirm that a test label is correct and announce when a policy changes.
Then the non-goals:
- Personal data about named employees is declined. "How many sick days has Dana taken?" is not the assistant's to answer.
- Exact expense computation is routed to the expense tool, where application code does the arithmetic. A reimbursement must be right to the cent every time, so the model explains the rule and code computes the amount.
Each non-goal becomes a test row whose right answer is known: decline.
The corpus manifest
The corpus is everything the assistant may search. Before building, you need to know its kinds of content, its file formats and its security constraints, such as which content needs authorization to read [2]. The spec records all of this in one list, the corpus manifest.
Here it lists 120 documents: 80 HTML policy pages and 40 PDF handbook sections. Three rows of it:
| id | format | version | owner | access groups |
|---|---|---|---|---|
travel-policy | HTML | v2 | Finance | all-staff |
relocation-faq | HTML | v1 | HR | all-staff |
salary-bands | v1 | HR | hr |
Each column does a job later stages depend on:
- id is what a test label points at.
- version tells you whether the index holds today's rule or last year's.
- owner says who confirms labels.
- access groups form the document's access list. They are a promise the search must keep: when different users may see different content, those permissions have to survive the split into chunks [2].
The two formats also shape the test content. Microsoft's guide asks for at least two pieces of content for each variant and format, and warns against over- or under-representing any kind of content [2].
The query set
The manifest says what can be found. The query set says what must be found. It is an eval dataset of 60 questions, and each question carries a label: either the ids of the expected evidence, or abstain. Those labels are the assistant's qrels, the judged-relevant passages that retrieval results are compared against. Microsoft's preparation phase stores the same three things per test query: the question, the passages that answer it, and a valid answer [2].
Dev and held-out
The 60 questions split into 30 dev and 30 held-out. You read, debug and tune on dev. You run held-out to decide, and never use it to change a prompt, a chunk size or a cut-off. Why waste half the set? Because once a held-out question has shaped a change, its score no longer predicts how the assistant does on questions nobody has seen. Anthropic's own example of a good success criterion is a score measured on a held-out test set [3].
Five slices
Each half has five slices of 6 questions, each aimed at a different way to fail:
| slice | persona | example question | label |
|---|---|---|---|
| easy | employee | How many days do I have to file a travel claim? | travel-policy |
| ambiguous | employee | Can I fly business class? | travel-policy short-haul and long-haul rules |
| multi-hop | manager | Does relocation cover hotel nights, and at what cap? | relocation-faq, travel-policy |
| stale | employee | What is the per-diem for a one-day trip? | travel-policy v2 |
| abstain | employee | What is the top of the salary band for a senior engineer? | abstain |
| abstain | employee | When does the office canteen open? | abstain |
The ambiguous label lists both passages, because the question has two reasonable readings and the answer needs both. Anthropic lists ambiguous cases, where even people struggle to agree, among the edge cases an eval should include [3]. The stale question checks that the answer comes from the current travel policy, v2, and not from the older v1 that still sits beside it.
The abstain slice holds 6 questions in each half, of two kinds. Three ask about salary bands as an employee. The salary-bands document exists, but only hr may read it, so for an employee the only right answer is "I can't answer that". Three ask about things that are not in the corpus at all, like the canteen. Microsoft's guide asks for queries the documents do not answer, so you can test that the system says it does not know [2]. Before reading on: should these 6 questions count toward the retrieval score?
Counting the set
They should not. Here is the arithmetic, computed for the made-up set: 5 slices × 6 questions = 30 per half, so 60 in all. In the held-out half, 30 − 6 abstain = 24 answerable questions.
An abstain question has no expected passage: scoring it 0 punishes the search for missing nothing, scoring it 1 rewards it for nothing. It is scored on its own, abstained or not.
Recall@8 is then counted on those 24 questions only, pooled over passages:
recall@8 = expected passages found among the 8 results passed to the model
/ all expected passages of the 24 answerable held-out questionsPooling means a question with two expected passages, like the multi-hop one, counts twice as much as a question with one. The spec fixes that choice once, so every run is counted the same way.
Which criterion can fail
Here are two criteria for the same assistant, in the spec's own wording:
- "Answers are good."
- "recall@8 at least 0.80 on the 24 answerable held-out queries."
If you were the reviewer, which one could you mark failed?
Only the second. A run that scores 0.78 on those 24 questions fails it, and nobody can argue. The first names no metric, target or set, so every reader fills in their own. Anthropic draws the same contrast: "safe outputs" is a weak criterion, while a strong one names a rate, a limit and how many cases it was measured on [3]. That gives the spec its one acceptance rule: a line goes in only if a person could check it with a number.
Constraints and gates
Two constraints come from the manifest rather than from answer quality.
- Access: 0 restricted chunks in any model context. A passage the model has read is a passage it can repeat, so the filter has to act before the model sees anything. The target is zero, not a rate, because one leaked
salary-bandschunk is already the incident. - Freshness: a source change is searchable within 15 minutes. This is a freshness objective that HR and Finance can hold the system to when they publish a new rule.
With those, the full spec fits in one table. Citation precision is the share of the answer's citations that point at a passage supporting the claim. The baseline is the first recorded run that later runs are compared with.
| persona | owner | gate | metric | threshold | set measured on |
|---|---|---|---|---|---|
| employee, manager | HR, Finance | relevance | recall@8 | at least 0.80 | 24 answerable held-out queries |
| employee, manager | HR, Finance | relevance by slice | recall@8 per slice | no slice more than 0.05 below baseline | each held-out slice |
| employee, manager | HR, Finance | citations | citation precision | at least 0.95 | citations in answered held-out queries |
| employee | HR | abstention | abstain count | 6 of 6 | held-out abstain slice |
| employee, manager | HR, Finance | access | restricted chunks in model context | 0 | every query of every run |
| employee, manager | HR, Finance | freshness | source change to searchable | at most 15 minutes | each source change |
| employee, manager | - | latency | p95 end to end | at most 3 s | held-out run |
| employee, manager | - | cost | cost per answer | at most $0.02 | held-out run |
The slice row exists because an average can rise while one slice falls. Latency is read at p95, from question in to answer out, so the slowest 5 in 100 replies are the ones that set the number.
Each row now reads as a check: citation precision of 0.93 fails, a p95 of 2.6 s passes, 5 of 6 abstentions fails. Most applications need several criteria at once, latency and price among them [3].
Where small sets bite
Small slices are the weak point. In the made-up set, each easy question expects one passage, so one miss in the 6-question held-out easy slice moves its recall by 1/6 = 0.167 (computed), more than three times the 0.05 the slice gate allows. In practice the gate says: no slice may lose a single passage against the baseline. That is strict; the fix for noise is more questions, not a looser threshold.
Common mistakes
- A hand-picked corpus. Ten favourite documents make every number look good. List the real 120, and cover each format with at least two pieces of content [2].
- Labels nobody owns. An ambiguous question labelled by the person who wrote the code gets the label the code already satisfies. The subject matter expert, here the HR or Finance owner, is the quality gate on documents, questions and answers [2].
- Personal data in the test set. Real staff questions can name people. Real content must be cleaned of personal data first [2].
:::note In practice Seed the query set from real questions: a help desk, an FAQ page or a ticket system holds what people actually ask [2]. Review the questions and answers on a schedule so they still match the source documents [2]. Keep the spec in the repository next to the code, and change a threshold only in its own reviewed change, never inside the change it would let through. :::
:::note In an interview Asked "how would you know your RAG system is ready?", answer with the four parts: scope with non-goals, a corpus manifest, a labelled query set with a held-out split and abstain rows, and gates written as metric, threshold and set. :::
Keeping the manifest's promises about versions, access and freshness is the subject of Building a Rebuildable Search Index.
Sources
- Design and Develop a RAG Solution on Azure. Microsoft (Azure Architecture Center). Checked 24 Oct 2026.
- RAG solution on Azure: preparation phase. Microsoft. Checked 21 Nov 2026.
- Define success criteria and build evaluations. Anthropic. Checked 24 Oct 2026.
Check yourself
Check yourself
Question 1 of 13
What is the held-out split of a query set for?
Your first check counts towards your result.