Golden Datasets, Synthetic Data and Simulation

Your evaluation can only be as honest as the cases inside it. Collect them with care, label them clearly and keep them under version control.

BeginnerIntermediateExpert · 13 min read · Last updated:

In short

A golden dataset is a reviewed set of tasks with agreed success criteria. Build it from real failures and real requests, fill gaps with expert-written and synthetic cases, keep it free of duplicates and leakage, and version it. Use a seeded simulator when the agent must act in a world that changes.

What you will learn: what belongs in a test case, where cases come from, how to check a dataset, how to generate synthetic data responsibly, how to make tests repeatable and how simulation works.
Prerequisites: Agent Testing: Unit to End-to-End and Agent Evaluation Framework.

Versions used

The example runs in November 2026 with Python 3.13 and only the standard library. All orders, customers and cases are invented.

Beginner Cases and where they come from

Why the dataset matters most

Graders, dashboards and release gates all depend on one thing: the list of situations you test. If the list holds only easy requests, a high score says little. If it holds cases that the prompt already quotes, the score is inflated. If nobody can say why a case expects a certain answer, a failure starts an argument instead of a fix.

A good dataset lets two people agree on whether a change helped. It records the knowledge your team gains about users, policies and failure modes, so that the same mistake is not rediscovered every quarter.

What a test case contains

FieldPurposeExample
Stable IDTrack history across versionscancel-014
InputWhat the user or system provides"Cancel order B200 please"
Starting stateThe world before the runB200 is still being packed
Expected outcomeWhat must be true afterwardB200 canceled, nothing else changed
Forbidden actionsWhat must never happenNo refund without approval
Slice labelsReport results by groupcancel, mobile, Spanish
Source and ownerExplain where it came fromProduction, support team
RationaleWhy this is the right answerPolicy section on cancellations
Review dateCatch cases that went out of dateNext review in 90 days

Describe the outcome rather than the exact path where you can. An agent may reach a correct result by a route you did not expect, and a test that demands one fixed sequence of calls will reject it. Reserve path checks for steps that really are required, such as an approval before a payment.

The two-reviewer test

Give a case to two knowledgeable people and ask whether a sample answer passes. If they disagree, rewrite the criteria before using the case to judge a model.

Where cases come from

Productionreal requests and failures, with private data removed
Expertspolicy edges, refusals and rare high-risk tasks
Syntheticvariations that fill known gaps
Reviewa person confirms the expected outcome before the case counts
SourceStrengthWatch out for
Production logsRealistic wording and mixPersonal data; rare dangers may be absent
Reported bugsDirectly tied to harmOverweighting one loud complaint
Subject expertsCovers rules and edge casesTidy wording that real users never type
Synthetic generationCheap breadthRepetitive, unrealistic or wrongly labeled cases
Public benchmarksExternal reference pointNot your tools or users; possible training overlap

Anthropic's engineering guidance on agent evaluation suggests that teams start with roughly 20 to 50 tasks drawn from real failures rather than waiting for a large collection. That is a starting point, not a target. Add cases until each important kind of task and each serious risk is covered.

Build the first version in an afternoon

  1. List the jobs the agent is meant to do, in the users' words.
  2. Collect two or three real or realistic requests for each job.
  3. Add refusals: requests the agent must decline or hand over.
  4. Add unclear requests where the right move is to ask a question.
  5. Write expected outcomes in terms a program or reviewer can check.
  6. Run the current agent and read every result, including the passes.
  7. Fix the cases that turn out to be ambiguous or impossible.

Reading the passes matters. A case that passes for the wrong reason, perhaps because the grader accepts any confident sentence, gives false comfort until someone looks.

Intermediate Quality, coverage and repeatability

Coverage, slices and balance

One overall pass rate hides weak areas. Label every case with slices and set a minimum number for each. A useful starting grid crosses task type with difficulty and risk.

SliceIncludesWhy separate it
Common tasksThe everyday requestsRegressions here affect most users
Edge casesMissing data, odd formats, limitsWhere brittle logic breaks
RefusalsOut of scope or not permittedA helpful-looking answer can be a violation
Hostile inputPlanted instructions, misuse attemptsNeeds its own pass threshold
Failing toolsTimeouts, empty or wrong resultsTests recovery and honesty
Languages and groupsThe people you actually serveAverages can hide unequal quality

Your dataset does not need to mirror production traffic exactly. It often helps to include more rare, serious cases than real life would. If you do, report results per slice, and weight them deliberately when you want an estimate of everyday performance.

Duplicates, leakage and contamination

Leakage happens when information about the test reaches the system being tested. The most common forms in agent projects are small and accidental.

  • A test input is copied into the system prompt as an example.
  • The expected answer sits in a file, ticket or index the agent can read.
  • Engineers tune prompts against the same cases used to approve a release.
  • Near-identical cases appear many times, so one behavior counts for many points.
  • Public test items may already be part of a model's training data.

Keep a held-out set that people do not tune against. Use a development set for daily work, run the held-out set at release time, and replace held-out cases once the team has studied them closely. Agent Benchmarks and Datasets shows how contamination has affected well-known public tests.

A dataset checker and a seeded simulator

The script below checks a tiny dataset for duplicates, prompt overlap and thin slices, prints a content-based version, then runs a small simulated order system twice with the same seed.

"""Check a small golden dataset, then run a seeded simulation (invented data)."""
import hashlib
import json
import random
from collections import Counter

PROMPT_EXAMPLES = ["Where is my order A100?"]

CASES = [
    {"id": "c1", "slice": "status", "input": "Where is my order A100?",
     "expect": "report_status", "source": "production"},
    {"id": "c2", "slice": "status", "input": "Has order B200 shipped yet?",
     "expect": "report_status", "source": "production"},
    {"id": "c3", "slice": "cancel", "input": "Cancel order B200 please",
     "expect": "cancel", "source": "expert"},
    {"id": "c4", "slice": "cancel", "input": "cancel order  B200 PLEASE",
     "expect": "cancel", "source": "synthetic"},
    {"id": "c5", "slice": "refuse", "input": "Show me another customer's orders",
     "expect": "refuse", "source": "expert"},
]
REQUIRED_SLICES = {"status": 2, "cancel": 2, "refuse": 2, "unclear": 1}


def normalize(text):
    return " ".join(text.lower().split())


def check(cases):
    problems = []
    seen = {}
    leaked = {normalize(t) for t in PROMPT_EXAMPLES}
    for case in cases:
        key = normalize(case["input"])
        if key in seen:
            problems.append(f"{case['id']}: duplicate of {seen[key]}")
        seen.setdefault(key, case["id"])
        if key in leaked:
            problems.append(f"{case['id']}: also used as a prompt example")
    counts = Counter(c["slice"] for c in cases)
    for name, minimum in REQUIRED_SLICES.items():
        if counts[name] < minimum:
            problems.append(f"slice {name}: {counts[name]} of {minimum} cases")
    return problems


def version(cases):
    blob = json.dumps(cases, sort_keys=True).encode()
    return hashlib.sha256(blob).hexdigest()[:12]


def simulate(seed, turns=4):
    """A simulated customer and order system. The same seed gives the same run."""
    rng = random.Random(seed)
    state = rng.choice(["packing", "shipped"])
    log = [f"order starts as {state}"]
    for _ in range(turns):
        wish = rng.choice(["ask_status", "ask_cancel", "change_mind"])
        if wish == "ask_cancel" and state == "packing":
            state = "canceled"
        log.append(f"{wish} -> {state}")
    return log


if __name__ == "__main__":
    print("dataset version:", version(CASES))
    for problem in check(CASES):
        print("PROBLEM", problem)
    print()
    print("\n".join(simulate(seed=1)))
    print("replay identical:", simulate(1) == simulate(1))

Output:

dataset version: 2877bdf8f34b
PROBLEM c1: also used as a prompt example
PROBLEM c4: duplicate of c3
PROBLEM slice refuse: 1 of 2 cases
PROBLEM slice unclear: 0 of 1 cases

order starts as packing
change_mind -> packing
ask_status -> packing
ask_cancel -> canceled
ask_status -> canceled
replay identical: True

Four problems appear before any model is called: one case repeats a prompt example, one differs only by capital letters and spacing, and two slices are too thin. The simulation then shows a cancellation that succeeds because the order had not shipped. Because every random choice comes from the seed, the run can be replayed exactly. The duplicate check is deliberately simple; reworded copies need review or similarity search.

Version the dataset like code

A score means nothing without knowing which cases produced it. Store cases in plain text, review changes, and record an identifier such as a content hash with every result.

ChangeHow to handle it
New cases addedNew version; run old and new agents on both sets once
Expected outcome correctedNote the reason; rescore affected history if you compare it
Case retiredKeep it in history with a reason; do not delete silently
Policy changedFind all cases citing the policy and review them
Private data discoveredRemove it everywhere, including old copies and results

Never remove a hard case just because it fails. If the case is wrong, say why. If it is right, it is doing its job.

Deterministic tests for a non-deterministic system

Model output varies, but much of an agent does not have to. Fix everything you can, so that a failure points at what changed.

Source of variationControl in tests
Model responsesScripted or recorded replies for logic tests; repeated trials for quality tests
External servicesFakes that return fixed results and chosen errors
Current timeA clock passed in as a parameter
Random choicesA seeded generator owned by the test
Shared dataA fresh environment for each trial
ConcurrencyControlled ordering, plus separate stress tests

With a scripted model you can assert exact behavior: which tool ran, what was refused, what was saved. With a real model, assert invariants that must hold in every trial, for example that no refund exceeds the order total, and measure the rest as a rate. Settings that reduce randomness help but do not promise identical output.

Recordings go stale

A recorded reply proves how your code handles that reply. It says nothing about what today's model would send. Refresh recordings when the model, prompt or tool schema changes, and keep some live trials.

Expert Synthetic data and simulation

Generate synthetic cases responsibly

Synthetic cases are most useful when you know which gap they fill. Ask for "more cancellation requests with a missing order number", not "more test data".

MethodHow it worksGood for
TemplatesFill slots with values from listsExact labels and full control
MutationsChange typos, order, tone or length of real casesRobustness with a known answer
State generationCreate records first, then ask about themAnswers that can be computed
Model generationAsk a model for varied requestsNatural wording and unexpected angles
Fault generationCombine tasks with tool failuresRecovery behavior

Prefer methods where the correct answer follows from how the case was built. If a model writes both the question and the answer, a person should verify a sample, and every case that gates a release.

Checks before synthetic cases count

  1. Is the request something a real user could plausibly send?
  2. Is there exactly one defensible expected outcome, or a clear list of acceptable ones?
  3. Does it add a behavior the set did not already test?
  4. Is it free of real names, secrets and copied private text?
  5. Is it labeled as synthetic so results can be reported separately?

Simulation environments

Many agent tasks are conversations or sequences of actions, so a single input is not enough. A simulator provides a world the agent can change and, often, a simulated user who answers back.

User simhas a goal and facts
Agenttalks and calls tools
Worldsandbox records
Checkerfinal state against goal

The tau-bench paper is a published example of this design: a language model plays the user, the agent works with domain tools under written policy rules, and grading compares the database state at the end with an annotated goal state.

Design choiceRecommendation
FidelityModel the rules that decide success; skip detail that never affects behavior
ResetEach trial starts from the same state
User behaviorInclude vague, impatient, mistaken and changing users
FaultsMake errors selectable by case, not random surprises
LoggingRecord every message, call and state change
LimitsCap turns and cost so a stuck pair cannot run on

Mind the gap between simulation and reality

A simulated user may be more patient, clearer or more cooperative than a real one. A fake service may never return the strange response the real one sends once a week. Compare simulator transcripts with real ones, add the behaviors that are missing, and confirm important results in a staging environment with real integrations and test accounts. Check the simulated user too: if it forgets its goal or reveals the expected answer, the trial is invalid and should be fixed, not counted.

Privacy, rights and safety of test data

Test data often travels further than production data: into laptops, build systems and vendor dashboards. Apply the same care.

Keep the dataset alive

Set a rhythm. After each incident, add a case that would have caught it. Each month, review a sample of production runs and ask which situations are missing. Each quarter, retire cases for features that no longer exist and check that expected outcomes still match policy. Track which cases never fail; they may still guard against regressions, but they no longer show progress, so add harder ones as scores approach the ceiling.

Assign one owner for the dataset as a whole and an owner for each slice. Without ownership, expected answers drift away from the business rules they were meant to represent.

Common mistakes

MistakeBetter approach
Waiting for thousands of casesStart small with real failures and grow
Only successful, polite requestsAdd refusals, unclear input and tool faults
Tuning on the release setKeep a held-out set
Unreviewed model-written answersVerify before a case gates anything
Changing cases without versionsRecord a dataset version with each score
Raw production logs as test dataMinimize and replace personal data first

Dataset checklist

  • Each case has an ID, input, starting state, expected outcome and owner.
  • Refusals, unclear requests and failing tools are represented.
  • Every important slice meets a minimum count.
  • Duplicates and overlap with prompts or indexes are checked.
  • A held-out set exists and is used only for release decisions.
  • Synthetic cases are labeled and sampled for human review.
  • Simulator runs reset cleanly and can be replayed from a seed or recording.
  • The dataset version is stored with every result.

Frequently asked questions

How is a golden dataset different from a benchmark?

A golden dataset reflects your tasks, rules and risks; a benchmark is a shared external test used for comparison.

Can synthetic data replace real examples?

It can widen coverage, but real requests and failures show what you did not think to generate.

What if there are several correct answers?

Check required facts and forbidden actions, or list acceptable outcomes, instead of matching one reference text.

How often should held-out cases be replaced?

Whenever the team has studied or tuned against them, and on a regular schedule as the product changes.

References and further reading

Next steps