Laminar logo
All blog posts

What Is a Golden Dataset? How to Build One for AI Agent Evals

Nov 27, 2026 · Laminar Team

A golden dataset is a set of tasks with human-verified expected outcomes, used to compare agent versions against the same references. For a representative golden suite, sample real work and keep those references stable between versioned releases.

Suppose someone adds twelve incident cases, edits three expected answers, and your pass rate rises from 78% to 84%. You cannot tell whether the agent improved without rerunning both versions on the same references. For a multi-step agent, those references often describe changed application state and prohibited actions rather than an exact reply.

We'll use an illustrative helpdesk suite to show what goes into the dataset and how to version it in Laminar.

Illustrative example: a card-catalog drawer for the helpdesk/golden dataset, pinned to one version, with six task-type tabs totalling 60 tasks. One golden task card is pulled out: a contractor asks for Figma, the expected end state is dana.ruiz · figma · editor, the forbidden call is grant_access with role admin, and a domain owner has verified the reference.

What is a golden dataset?

Google's ML glossary describes automatic evaluation as comparing a model's output to a “golden response.” Agent evaluation tools use the same idea:

  • DeepEval calls each entry a “golden”: an input with an expected output or outcome, optionally including expected tools. The reference is decoupled from any particular run.
  • Braintrust's post on improving golden datasets with human review describes promoting production traces into a dataset and having reviewers write the expected value. It calls leaving that field blank the most common anti-pattern.

The common core is a verified expected outcome. Practitioners differ on how they choose the tasks and how often they change the set.

For an AI agent, a useful golden dataset has four properties:

  • Representative. Tasks are sampled from the work the agent does in production, across task types.
  • Human-verified. A person who knows the domain signed off every expected outcome. A model can draft one; it cannot approve it.
  • Stable between releases. Nobody edits tasks in the middle of a comparison, so two runs on the same version are comparable.
  • Versioned. Changes ship as a new version, and every score records the version that produced it.

"Golden" describes the trust in the references, not the size of the set.

Golden references, regression sets and synthetic data

These terms describe overlapping properties. “Golden” describes the verified reference. “Regression” describes why a task was selected: an earlier run failed it. “Synthetic” describes the input's origin: a model or script wrote it. One task can have all three properties.

Braintrust's post recommends adding new failures and pruning stale cases; its product docs advise against large, static golden datasets. That approach helps catch known failures. A failure-selected set, however, cannot directly estimate performance on typical traffic because its selection favors difficult cases.

If you want that estimate, we recommend two suites with verified references:

Representative suiteRegression suite
How tasks are chosenRandom sample within each task typeRuns that failed
How it changesIn versioned releasesAdd cases after failures
What its score tells youPass rate on production-like workWhether known failures came back

The rest of this guide builds the representative suite and calls it the golden dataset. Turning production traces into an eval dataset covers building the regression suite. Keep deliberately hard or synthetic additions separately tagged and reported.

Do error analysis before building the golden dataset

Hamel Husain and Shreya Shankar's evals FAQ gives an important caution: “Start with error analysis, not infrastructure,” and “Write evaluators for errors you discover, not errors you imagine.” They recommend reviewing at least 100 real traces.

Read those traces and group observed failures before deciding what to measure. Write verifiers for the failure modes that matter, then sample representative tasks that exercise those checks.

Error analysis establishes what you should check. A representative golden suite measures how often the agent passes those checks on the sampled work. Building the suite before examining real behavior risks formalizing the wrong requirements.

What goes into a golden task for an AI agent

An exact expected transcript is usually too restrictive. Two correct runs can call tools in different orders or word the reply differently. Anthropic's guide to agent evals says "it's often better to grade what the agent produced, not the path it took."

Store the user request, starting data and tool environment with each task. Define its reference through:

  • End state: the right grant exists, or the ticket is escalated.
  • Required actions: checks that must precede a grant.
  • Forbidden actions: an admin grant fails the run even if later revoked.
  • Reply criteria: a rubric such as “confirms access and states its expiry.”

Our helpdesk agent has lookup_user, grant_access and escalate_ticket tools. Its policy gives contractors Figma editor access, never admin. The contractor task's tests/expected.json contains:

{
  "grants": [["dana.ruiz", "figma", "editor"]],
  "escalate": false,
  "forbidden_calls": [{"tool": "grant_access", "args": {"role": "admin"}}]
}

A second task requests production-database admin access, which requires manager approval. It expects no grants, an escalated ticket and "forbidden_calls": [{"tool": "grant_access"}], prohibiting any grant.

One verifier serves both access tasks. Each trial must start with an empty grants table and only that case's ticket, as in the tested fixtures. Seed each case's fresh container accordingly. The run script must record every tool call and its arguments in result.json; the verifier reads that log and the database:

import json
import sqlite3

expected = json.load(open("/tests/expected.json"))
result = json.load(open("/logs/agent/result.json"))
db = sqlite3.connect("/srv/app/app.db")

grants = {tuple(row) for row in db.execute("SELECT user, app, role FROM grants")}
end_state = grants == {tuple(g) for g in expected["grants"]}

escalated = db.execute("SELECT COUNT(*) FROM tickets WHERE status = 'escalated'").fetchone()[0] > 0
escalation = escalated == expected["escalate"]


def matches(call, rule):
    return call["tool"] == rule["tool"] and all(
        call["args"].get(key) == value for key, value in rule.get("args", {}).items()
    )


forbidden_ok = not any(
    matches(call, rule) for call in result["tool_calls"] for rule in expected["forbidden_calls"]
)

json.dump(
    {
        "end_state": int(end_state),
        "escalation": int(escalation),
        "forbidden_calls": int(forbidden_ok),
    },
    open("/logs/verifier/reward.json", "w"),
)

In the SQLite fixture tests, the contractor's editor grant scores 1 on all three rewards. An admin grant fails end_state and forbidden_calls. Granting admin, revoking it and then granting editor passes the end-state check but still fails the action check. For the production-database fixture, escalation without a grant passes all three; granting access while leaving the ticket open fails all three.

This verifier does not check employment-status lookup or grade the reply. Add those checks when required; a reply judge should supplement the state checks.

Choose golden tasks by stratifying real traffic

OpenAI's evaluation guide flags datasets that do not reproduce production traffic patterns. Stratify by task type, then sample within each type. Assign each request one primary stratum.

Laminar's Signals Intent template classifies user intent and request complexity. Its intent clusters include event counts you can use to estimate traffic shares. Hand-tagging recent traces also works.

Start proportional to traffic, then add coverage for small, high-consequence strata. This illustrative 60-task suite oversamples approval-gated requests, which are a tenth of traffic but carry most of the risk:

StratumShare of trafficGolden tasks
Standard access requests35%18
Password and MFA resets25%12
Hardware and license requests15%8
Access needing approval10%8
Ambiguous requests10%8
Out of scope5%6

Sample randomly within each stratum from a recent window, without checking whether each run succeeded. Weighting by stratum can correct the mix of task types; it cannot undo selecting failures or difficult cases within a type.

Report per-stratum scores. For an overall production-like estimate, weight them by traffic share. Exclude deliberately hard and synthetic additions from that estimate and report them separately. As Husain and Shankar note, synthetic data cannot establish production failure frequency.

Record stratum and source in task.toml so you can audit the composition:

[task]
name = "helpdesk/access-contractor-figma"

[metadata]
category = "access-request"
source = "production-sample"

[environment]
docker_image = "helpdesk-evals"
workdir = "/case"

Folder names also support targeted runs: lmnr-cli eval run --task "access-*" selects access tasks when their folders use that prefix.

How big should a golden dataset be?

For a rough sizing calculation, assume equally weighted, independent tasks with binary pass/fail outcomes. These intervals do not describe the traffic-weighted score above. The normal approximation is p ± 1.96 × √(p(1 − p)/n), using the same 1.96-standard-error rule as Anthropic's statistical evaluation post. At an 80% pass rate:

Tasks95% interval around 80% (normal approximation)
20±17.5 points
50±11.1 points
100±7.8 points
200±5.5 points

At 50 tasks, the approximate interval spans 69% to 91%; one task changes the score by two points.

Pairing results can reduce variance because both agents attempt the same tasks. For independent tasks with binary outcomes, count fixed and broken tasks and apply an exact two-sided sign test:

Tasks fixedTasks brokenp-value
500.06
600.03
830.23
1550.04
20100.10

On 100 tasks, both 5/0 and 8/3 are five-point gains, but neither meets a 5% significance threshold. On 200 tasks, five points means ten net fixes: 15/5 meets that threshold; 20/10 does not. Detectability depends on both directions of change, not dataset size alone.

Use these calculations to guide growth:

  • Start with 20 to 50 tasks. Anthropic recommends this range for simple, failure-derived tasks. It is also a practical initial representative sample, not a precise production-quality estimate.
  • Grow when comparisons remain inconclusive. Add representative tasks rather than more copies of one scenario.
  • Size strata for your decisions. Eight approval-gated tasks can expose a broken policy; they cannot measure a small improvement reliably.
  • Account for repeated trials. Fifty tasks run three times produce 150 trial results, but only 50 task clusters. Average trials per task, then compute the standard error of those averages as their standard deviation divided by √n. The binary formula no longer applies. For comparisons, analyze per-task differences in means. Anthropic reports clustered standard errors over three times naive estimates on some evals.

Verify every reference with a person

A wrong reference can penalize correct runs and reward incorrect ones. Anthropic's test for a well-specified task is that “two domain experts would independently reach the same pass/fail verdict.”

Have a domain owner approve each reference. Resolve policy disagreements before admitting the task. Seed a known-good outcome and confirm that every required reward is 1, then test a plausible wrong outcome and confirm the appropriate reward drops. The revoked admin grant above tests a failure that final-state checks miss.

Keep references out of the agent's reach. A Harbor task's tests/ folder arrives only when the verifier runs, so do not COPY the whole repo into the agent's image.

Version the golden dataset in Laminar

This workflow uses Laminar agent evaluations, currently in beta, with a working Harbor harness. Dataset versioning is shared across eval platforms; Braintrust, for example, supports pinned snapshots.

Keep the suites in separate datasets:

evals/
  helpdesk-golden/
    harbor.yaml
    agent/
    tasks/
      dataset.toml
      access-contractor-figma/
      access-prod-db-admin/
  helpdesk-regressions/
    harbor.yaml
    agent/
    tasks/
      dataset.toml

Name the golden dataset in its dataset.toml:

[dataset]
name = "helpdesk/golden"

After reviewing a batch of tasks, push it:

npx lmnr-cli@latest eval dataset push helpdesk-golden

push hashes each task, uploads versions Laminar does not have, and pins each task's version in dataset.toml with a digest. Laminar stores every task version and has no implicit “latest” version. The manifest records which versions the dataset uses.

Commit that file. A pull request changing the manifest becomes a dataset release; reviewers can inspect each new task version on the Datasets page.

In CI or on another machine, pull the pinned versions before running:

npx lmnr-cli@latest eval dataset pull helpdesk-golden
npx lmnr-cli@latest eval run helpdesk-golden --n-attempts 3

eval run scores local files and never pulls. It warns about missing or changed pinned tasks. Keep task files unchanged after pulling, and resolve warnings before treating runs as a controlled comparison.

By default, runs share the helpdesk/golden evaluation group. Use the same manifest for both agents: grouping does not enforce identical references. Each trial records its task version, and its Files view shows that version.

Open the newer run and choose the older run in Select compared evaluation. Comparing runs matches rows by task ID. When tasks have multiple trials, it compares their averages. Inspect per-task differences and traces rather than treating fractional averages as binary flips.

The regression dataset runs in its own group, separate from the representative suite's trend line.

Refresh the golden dataset without breaking comparisons

Refresh when traffic shifts, policies change or the agent gains a workflow. Resample affected strata with the same sampling rules.

Batch edits in one release. Push added or changed tasks and commit the manifest. To remove a task, delete its manifest entry; the next pull removes its folder. Record the reason, such as “Resampled MFA tasks after the passkey rollout.”

Rebaseline by running the current production agent on the new release before comparing a candidate. Husain and Shankar's FAQ is relaxed about the cost: as the set changes, scores "may no longer be directly comparable with older scores. That is ok!" Rerunning the baseline makes the new comparison interpretable.

Repeatedly tuning against golden failures can overfit the suite. Debug with fresh traces and regression cases, and use the golden set as a release check.

FAQ

Can an LLM generate my golden dataset?

An LLM can propose inputs and candidate references, including variations around a documented policy. Record how you generated the inputs in the task's review notes so reviewers can audit their origin. A domain expert must still approve each reference. Tag generated tasks source = "synthetic" and keep their results separate from the production-weighted estimate.

What should I do when the golden set hits 100%?

Keep it: a representative set at 100% still catches regressions on typical work. Anthropic's guide notes that such an eval provides no signal for improvement. Put harder tasks in a separate challenge slice or capability suite. Replacing representative tasks with harder ones changes what the headline score measures.

Why does one golden task fail on every trial?

Check the task before blaming the agent. Anthropic's guide says a 0% pass rate across many trials is most often a broken task. Look for a reference that contradicts policy, a verifier reading the wrong table, or case data the agent cannot reach. Inspect the trial's trace and Files view together.

What happens to old results when I edit a golden task?

Editing a task does not re-evaluate earlier runs. Laminar retains the task versions those trials used. If you correct a reference, rerun both agents on the corrected release rather than treating the old scores as corrected too. The datasets docs explain how push and pull handle changed tasks.

How often should I run the golden dataset?

Run it before shipping prompt edits, model swaps or tool changes. For a costly suite, use a relevant task slice while iterating, then run the full pinned suite for the release decision. Keep that distinction visible when reporting results. The guide to running agent evals covers the execution workflow.