How to build an LLM evaluation golden dataset for agents

For agent builders4 min read

An LLM evaluation golden dataset is a fixed set of test cases with trusted answers or checks, used to score a model or an agent every time something changes. Twenty to fifty good cases beat thousands of careless ones. This post covers where to find cases, a record layout, a script that checks the file itself, and how to keep it useful.

Where the cases come from

Anthropic's guide to agent evals suggests starting with 20 to 50 tasks drawn from real failures, and building from what you already check manually: pre-release checks, bug trackers and support queues. That advice fits a golden set. Cases from real failures are realistic by construction.

Source: Demystifying evals for AI agents(opens in a new tab)

  • Bugs and incidents: one case per failure, kept after the fix.
  • Support tickets: the questions users actually ask, with the right answer written by someone who knows.
  • Hand-written edge cases: empty input, wrong language, missing data, requests the system should refuse.
  • Expert-written cases for areas where the builders are not the experts.

What a good LLM evaluation golden dataset case needs

The same guide says tasks should be unambiguous, so that domain experts would reach the same verdict independently, and that each should have a reference solution to prove it can be solved. It also advises balance: test when a behavior should happen and when it should not.

A record layout that supports this is below, one case per line.

JSON
{"id": "refund-014", "input": "I was charged twice for order 8812. What now?", "check": {"type": "rubric",           "must": ["asks for no card details", "offers to open a refund"],           "must_not": ["promises a refund date"]}, "reference": "Apologise, confirm the duplicate charge, open a refund case.", "tags": ["billing", "should_act"], "source": "support-ticket", "added": "2026-11-03"}

The tags field lets you report scores per area. The source field lets you ask later whether cases from tickets behave differently from hand-written ones.

A script that checks the dataset itself

Test the test set. This script flags missing fields, repeated ids, duplicate inputs and tags with too few cases.

Python
import jsonfrom collections import Counter REQUIRED = ["id", "input", "check", "reference", "tags", "source"] def audit(lines, min_per_tag=2):    rows, problems = [], []    for n, line in enumerate(lines, 1):        row = json.loads(line)        for f in REQUIRED:            if f not in row:                problems.append(f"line {n}: missing {f}")        rows.append(row)    ids = Counter(r.get("id") for r in rows)    problems += [f"duplicate id {i}" for i, c in ids.items() if c > 1]    inputs = Counter(r.get("input") for r in rows)    problems += [f"duplicate input: {i[:30]}"                 for i, c in inputs.items() if c > 1]    tags = Counter(t for r in rows for t in r.get("tags", []))    problems += [f"tag {t} has {c} case(s)"                 for t, c in tags.items() if c < min_per_tag]    return problems sample = [    json.dumps({"id": "a", "input": "x", "check": {}, "reference": "y",                "tags": ["billing"], "source": "ticket"}),    json.dumps({"id": "a", "input": "x", "check": {}, "reference": "y",                "tags": ["billing"], "source": "ticket"}),]print(audit(sample))

Keep it honest

  1. Separate a development set you tune against from a held-out set you check rarely. If you edit prompts until the held-out set passes, it is no longer held out.
  2. Version the file and record which version each score used. Scores from different versions are not comparable.
  3. Review the grader against human judgment on a sample. The eval guide recommends calibrating model graders against humans.
  4. Add a case for every production failure, and remove or fix any case that turns out to be wrong.
  5. Watch for saturation. A set that always scores 100 percent only catches regressions, so add harder cases.

Plan for maintenance from the start. Give the file an owner, review it on a schedule, and write down why each case exists. A case nobody can explain is the first one people delete when it starts failing, and that is how a set slowly stops catching anything.

What it will not tell you

A golden set measures the cases in it. It does not say how the system behaves on inputs that nobody thought of. Use it as a gate before release and a tripwire after changes, and pair it with sampled review of real traffic to find the cases you missed. Each missed case you find goes into the set.

When a score drops after a change, open the cases that flipped from pass to fail first. Often two or three tell the whole story, and they show whether the case was fragile or the change was bad.

Curatrain's experts write reference answers with rubrics and graded labelled data, which is the content a golden set depends on.