# 24.2 Golden sets, written with the expert (/building-ai-workers/evaluating-ai-workers/golden-sets)

---
type: Document
title: "24.2 Golden sets, written with the expert"
description: "What a golden set is, which cases belong in it, who may write a case, and where the set lives."
status: stable
order: 324.02
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T00:02:23Z
chapter: '24'
part: III
expert_status: co-build
concepts: [ "24.2" ]
last_verified: '2026-11-29'
sources:
  - id: prep-course-module-4
    title: 'Claude Certified Developer, Foundations prep path, Module 4: Production Engineering, Evals, and Security (Anthropic Partner Academy, sign-in needed, read 2026-11-29)'
    resource: https://anthropic-partners.skilljar.com/path/claude-certified-developer-foundations/production-engineering-evals-security/486745/scorm/1twknqoor0w46
  - id: anthropic-demystifying-evals
    title: Demystifying evals for AI agents (Anthropic, 9 January 2026, verified 2026-11-29)
    resource: https://www.anthropic.com/research/demystifying-evals-for-ai-agents
  - id: academy-minimum-viable-eval
    title: 'Introduction to evals: Build a minimum viable eval (Claude Academy, verified 2026-11-29)'
    resource: https://academy.claude.com/courses/introduction-to-evals/build-a-minimum-viable-eval
generated:
  at: 2026-11-30T00:02:23Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:cc6fd9ac5f72207d4365ecbda63d87d1b64f99e05519b358a45b9f5d9bfd6f8f
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** A teacher writes an exam, and writes the answer key before any student takes it. With the key, two assistants can mark two hundred papers the same way, and the teacher reads only the papers they are unsure about. The key holds her judgment. It is good only if she wrote it herself, and only if it has the hard questions as well as the easy ones. A key made by copying the best student's paper would only repeat that student's mistakes.

**What you will learn.** What a golden set is, which cases belong in it, who may write a case, and where the set lives. You practice it in Lab 24, Task 1.

- What is a golden set?
- Which cases belong in it?
- May a model write cases?
- Where does the set live, and who may change it?

**Why it matters.** Every check in this chapter compares an answer with something. That something is the golden set. If it is wrong, or holds only easy cases, every later number is wrong with it.

**At work.** Ana has twenty minutes on a Monday. She cannot read 40 answers in that time, every time the prompt changes. But she can write her expected answer for 40 cases once, and after that the cases are asked on every pull request without her. For "Who approves a $12,000.00 invoice?" her label is the four things she said in 24.1. For an invoice such as INV-8301 from Midwest Packaging Co., her label gives the value of each field, such as an amount of 482500 cents, which is $4,825.00.

### What is a golden set?

A **golden set** is a fixed list of cases, each with an answer a person checked. A **case** is one input with the answer that is expected for it. Ana's expected answer for a case is her **label**. A label has a different form for each kind of case:

| Kind of case | The input | Ana's label |
| --- | --- | --- |
| A question (25 cases) | A question a clerk asks, as Brightline | The decision, the line it must cite, the words it must contain, and the claim it must not make |
| An extraction (15 cases) | One invoice document | The value of each field |

Brightline's set has 40 cases. In Chapter 17 Ana wrote eight questions with the answers she expected, which that chapter called "acceptance checks". One was "Does INV-8303 match its PO?", with the answer that PO-7003 is $12,000.00 and the invoice is $12,900.00, so it is $900.00 over ([17.6](../connectors-and-mcp/specify-generate-verify.md)). In Chapter 19 the answer check held one Brightline question, the $12,000.00 one ([19.16](../business-data-and-retrieval/measuring-retrieval.md)). Those were the first cases. This chapter gives them one name and one file, and adds the rest.

Ana also makes a second kind of record. She reads 40 recorded answers to the questions and marks each one pass or fail. These are **her marks**. A label says what the answer should be, before any run. A mark says whether one real answer was good. The labels feed the checks by code (24.3). The marks are what the judge is measured against (24.5).

### Which cases belong in it?

**The usual cases and the hard ones.** Most of the set should look like most of the work: the questions clerks ask every week, and invoices in the layouts Brightline sees most. Anthropic's public course on evaluations keeps 30 typical cases in a set of 50, and chooses the rest as edge cases, as often as real work has them.[^academy-minimum-viable-eval] A hard case is one where a careless answer and a careful one differ. Brightline has several:

- An invoice that is over its purchase order, such as INV-8303.
- A question the policies do not answer, where the right answer is to say so.
- An invoice that prints a subtotal and a total, where the wrong number is easy to take.

**Cases where the behavior should happen, and cases where it should not.** A set that only asks questions with an approver cannot catch a worker that names an approver every time. Anthropic's guide to agent evaluations calls this a balanced set.[^anthropic-demystifying-evals]

**Cases two experts would mark the same way.** The same guide gives a test for a good case: two experts in the field, working apart, would give the same pass or fail.[^anthropic-demystifying-evals] If Ana and Brightline's controller would disagree about the right answer, the case is not ready. The disagreement is a question about the policy, and it is settled there first.

**Expected answers written before any model runs.**[^academy-minimum-viable-eval] If Ana sees the worker's answer first, a fluent wrong answer can pull her label toward it.

How many cases? Anthropic's guide says that 20 to 50 simple tasks drawn from real failures is a great start.[^anthropic-demystifying-evals] Brightline's 40 cases sit inside that range. [24.6](metrics-you-can-defend.md) shows what 40 cases can and cannot show.

### May a model write cases?

A model may draft them. The exam prep course teaches that a model can generate more cases from a small labeled set, and that a person then checks a sample.[^prep-course-module-4] Brightline's rule is stricter, because the set is small and every case is used as a gate: **a drafted case counts once Ana has checked it.** A model can turn her $12,000.00 question into ten more, with other amounts and other wordings. Each one enters the set only after she has read its question and written or corrected its label. A draft she rejects is useful too. It often shows a rule that the policy says less clearly than she thought.

The price is her time, and it is paid once for each case. The other choice is a large set that nobody checked. It measures agreement with the model that wrote it, which is a different thing from Ana's judgment.

### Where does the set live, and who may change it?

The set lives in the repository, beside the code it tests: the cases in `data/golden/cases.yaml`, Ana's labels in `data/golden/labels.csv`, and her marks in `data/golden/marks.csv`. So a change to a label is a pull request, with a history and a reviewer, like any change to code. In the lab, the golden set, the labels and the pass threshold are owned files. A change to any of them needs a named owner's review, and a label changes only when Ana says so.

This matters because the easiest way to make a failing suite pass is to change the expected answer. Ana changes a label when the policy or her judgment changed, never because an answer disagreed with it.

The set also grows, by each live failure Ana labels (24.9).

**The operating rule:** the expert writes each expected answer before any model runs. Keep the usual cases and the hard ones, keep the set in the repository, and add every real failure to it.

**Do this now.** Take one question whose right answer you know well, and give it to your coding agent. Copy this line:

> Draft five more cases from this one: two usual ones, two hard ones where a careless answer would differ from a careful one, and one where the right answer is that the documents do not say. Give each a draft label. Do not run any model on them. Here is the case: a question, and the answer I expect, with the line it must cite and the claim it must not make.

Then check each draft as Ana would. Count how many labels you had to correct. That count is why a drafted case does not count until the expert has checked it.

[^academy-minimum-viable-eval]: Introduction to evals: Build a minimum viable eval, Claude Academy.
[^anthropic-demystifying-evals]: Demystifying evals for AI agents, Anthropic.
[^prep-course-module-4]: Claude Certified Developer, Foundations prep path, Module 4: Production Engineering, Evals, and Security, Anthropic Partner Academy.
