Production agents
Golden datasets for Claude agents
A golden dataset for Claude is a named, versioned set of real cases with invariants, not a folder of happy-path chats. Here is how we build one that CI can fail.
April 27, 2026/2 min read/Claude Certified Engineers
A golden dataset for a Claude agent is a versioned set of real inputs, labeled invariants, and safety tags that CI can score. If the cases only exist in a notebook on someone's laptop, you do not have a dataset. You have folklore.
We treat the set as a product artifact on every Production Agent Build. It lands in the client repository in week one, beside the eval harness, not after the demo.
What belongs in the first eighty cases
Steal from production. Tickets, traces, redacted transcripts, the PDF that always arrives truncated.
| Bucket | Count to start | Purpose |
|---|---|---|
| Happy paths | 10 | Prove the job still completes |
| Messy inputs | 10 | Truncation, mixed language, missing IDs |
| Adversarial | 10 | Injection in documents, "ignore previous instructions" |
| Cost traps | 10 | Huge attachments, retry loops, cache misses |
| Policy | 10 | PII, refusals, human handoff |
| Regressions | grow | Every production incident becomes a case |
Name cases like invoice-missing-po-v3. case_47 cannot be discussed in standup.
Invariants, not canonical prose
Claude will not match a golden paragraph. Write what must be true:
- Must cite the invoice number from the tool result.
- Must not call
refundwithout an approval id. - Must refuse to export the full customer table.
- Tool calls must pass the same JSON Schema the MCP server uses.
Those invariants are what an LLM-as-judge rubric scores. Deterministic checks run first. The judge fills the gaps humans would argue about.
Version it like code
Keep the set in git. A pull request that changes prompts without touching cases is a smell, not a virtue. When an incident happens, add the case in the same change that fixes the agent. That is how the suite stays honest.
If you already have an agent and a folder of screenshots, start with a Claude Readiness Audit. Two weeks is enough to turn folklore into a set CI can fail.
Questions
- What is a golden dataset for a Claude agent?
- A named, versioned collection of inputs, invariants, and safety labels checked into the repo. It is the thing CI scores. A Slack export of "good answers" is not a dataset.
- How large should the first golden set be?
- Forty to eighty cases is enough to fail a bad prompt change. Grow it when production surprises you, not to look complete in a slide.
- Should we rewrite cases when the product changes?
- Add cases. Retire a case in a separate commit if the behavior is no longer required. Do not silently edit gold to make a new prompt look good.