Agent Evaluation

Building AI Agent Evaluation Datasets Without Data Leakage

Build AI agent evaluation datasets with controlled task families, protected holdouts, grounded labels, retrieval leakage checks, and evolving failure sets.

· · 8 min read

Prepared with AI research assistance. Sources are linked throughout; worked examples are illustrative unless stated otherwise. Editorial approach.

An AI agent evaluation dataset is a collection of tasks with controlled starting conditions, evidence, and acceptance criteria. Its purpose is to estimate behavior on work the system has not already been optimized to solve. A large spreadsheet of prompts cannot provide that estimate if the answers leak through examples, retrieval, shared customer records, or repeated tuning against the same holdout.

This guide proposes a dataset design for a hypothetical order-support agent. The counts, records, and policies are illustrative engineering choices, not benchmark findings or a tested evaluation package.

Define the unit of evaluation before collecting prompts

A task should specify the request, environment state, available tools, relevant policy version, and observable success conditions. For an agent that changes an order, a final sentence is insufficient: the evaluator must inspect which record changed and whether the action was authorized.

Anthropic's evaluation guidance distinguishes tasks, repeated trials, transcripts, and outcomes. It emphasizes that the actual environment state can differ from an agent's claim about what happened. That distinction informs the proposed dataset structure below. Demystifying evals for AI agents.

Start with a coverage matrix rather than sampling only successful conversations. For the hypothetical support agent, useful dimensions include cancellation eligibility, missing identity, ambiguous intent, conflicting policy evidence, unavailable tools, and changed order state. Add task language and document format when they materially change behavior.

Keep the task separate from its execution. One task may produce several trials; those trials must not be counted as independent examples of customer demand. Store a trial identifier beneath the stable task identifier so variability can be measured without inflating the apparent diversity of the dataset.

Separate development, validation, and holdout access

The important boundary is access, not the name of a directory. A proposed arrangement is:

Partition Permitted use Exposure policy
Development Prompt edits, examples, debugging, simulator development Full task and label visibility
Validation Compare candidate configurations and tune thresholds Visible to the development team; record repeated use
Holdout Assess a selected release candidate Restricted labels and results until the candidate is fixed
Failure regression Preserve previously diagnosed defects Explicitly known; never presented as unseen generalization

These partitions serve different purposes. A regression set can be extremely valuable despite being familiar to the team. The problem arises when its pass rate is described as evidence about unseen tasks.

Scikit-learn's leakage guidance warns that test information must not influence model selection or learned preprocessing. In an agent system, the analogous risk includes changing prompts, retrieval rules, or tool descriptions after examining holdout failures. This analogy does not mean every agent pipeline trains a statistical model; it means the measurement boundary can be crossed through human iteration too. Common pitfalls: data leakage.

When a holdout result is used to choose the next change, record that exposure. Move the exposed cases into a known evaluation partition and refresh the genuinely restricted set. Do not silently keep calling the old cases unseen.

Imagine a dataset containing four paraphrases of the same cancellation request, all referencing one order and policy paragraph. Randomly splitting those rows can put almost the same task on both sides of the boundary. A model or developer may learn the answer pattern without demonstrating broader capability.

For this proposed dataset, assign a family identifier that follows the underlying incident, source conversation, generated scenario template, and derived variants. Keep every member of a family in the same partition. If multiple conversations share a distinctive customer-specific workflow, consider grouping that customer too, depending on the generalization question.

There is a tradeoff: grouping customers tests transfer to unfamiliar customers, while a chronological split may better test future work for existing customers. Choose the split to match the claim, and report the limitation. Neither split is universally correct.

AWS guidance discusses duplicate examples, inputs unavailable at inference time, distribution changes, and evaluation slices. These are useful warnings when translating historical operational records into agent tasks. Splits and data leakage.

In the hypothetical collection, suppose 600 candidate records collapse into 240 families after reviewing related incidents and generated variants. Allocate families first, then inspect coverage in each partition. Do not move individual difficult rows between partitions merely to improve balance; add independent families where coverage is missing.

Reconstruct what the agent could know at task time

Historical records often contain the eventual resolution. A closed ticket may include the refund decision, internal reviewer notes, and the successful tool result. Those fields are labels or post-task evidence, not necessarily legitimate agent inputs.

Create a starting-state snapshot that includes only information available at the task's defined start time. Keep later events in a separate evaluator-controlled fixture. If the agent is supposed to discover an order's status through a tool, expose that status through the tool simulator rather than copying the answer into the user prompt.

An illustrative task record might look like this:

{
  "task_id": "cancel-example-042",
  "family_id": "incident-example-017",
  "partition": "holdout",
  "request": "Please stop the order I placed this morning.",
  "environment_fixture": "orders-start-v3",
  "policy_snapshot": "cancellations-v8",
  "allowed_tools": ["list_orders", "check_eligibility", "request_cancellation"],
  "grader_ref": "cancel-ambiguous-order-v2",
  "provenance_ref": "restricted-provenance-042"
}

The evaluator resolves grader_ref; the agent does not receive the grader's expected outcome. The fictional identifiers illustrate separation of concerns rather than an API contract. Use access controls and different storage paths to enforce that separation, not a prompt instruction asking the agent to ignore visible answers.

Treat retrieval as another leakage channel

A private holdout prompt can still be compromised if the agent searches a corpus containing the evaluation question and its answer. Separate the evidence needed to perform the task from answer keys, benchmark exports, grader code, and past evaluation transcripts.

The original Search-Time Data Contamination paper examines this specific problem for search-enabled agents: retrieval can surface test questions with ground-truth answers. Its experiments concern particular public benchmarks, not every production retrieval system. The relevant lesson here is to audit what tools actually return, beyond checking whether prompts were held out. Search-Time Data Contamination.

In the proposed harness, tag evaluator artifacts so ingestion jobs cannot add them to the agent's searchable corpus. Give the agent identity no permission to read the evaluation bucket. Add a canary task whose answer exists only in an evaluator-only artifact; successful retrieval of that artifact should fail the harness integrity check, regardless of the agent's task score.

This is also a reason to test tenant isolation across retrieval and tools. A leakage boundary that exists only in the evaluation script may disappear when a shared index is used.

Label outcomes with evidence and explicit ambiguity

A useful label describes acceptable behavior, prohibited effects, and evidence needed to decide. For the ambiguous cancellation task, acceptable behavior may require clarifying which order the user means and making no cancellation yet. It need not require one exact sentence.

Use multiple acceptable trajectories when the business policy permits them. Otherwise a grader can punish a safe alternative simply because the recorded human agent followed another path. Separate factual outcomes, authorization checks, and communication quality into distinct assertions.

Have reviewers annotate independently before resolving disagreement on difficult examples. Record the disputed policy interpretation and revise the task if the evidence cannot support a unique judgment. Mark unresolved cases as ambiguous instead of forcing a convenient gold answer. If an LLM helps grade open-ended communication, apply the calibration practices in LLM-as-a-judge evaluation.

Validate the dataset before comparing agents

Run integrity checks before spending model calls:

  • Assert that task families do not cross restricted partition boundaries.
  • Check exact duplicates and review likely near-duplicates, including translations and template variants.
  • Verify that fixtures reset between trials and that one trial cannot leave clues for the next.
  • Inspect tool-visible files and retrieved documents for labels, grader instructions, and prior transcripts.
  • Confirm that required evidence exists and that prohibited actions are observable to graders.
  • Version tasks, policies, fixtures, graders, and partition assignments together.

Then inspect results by coverage slice as well as in aggregate. An oversampled adversarial set is a stress test, not a direct estimate of ordinary traffic. Keep traffic-weighted reporting separate from safety and failure-mode suites. Use repeated trials to examine nondeterminism, while retaining the task family as the unit for dataset diversity.

Grow the collection without losing its meaning

When a production incident becomes a regression case, record its origin, remove unnecessary personal data, and construct a reproducible starting state. Add related variants to the same known family. A fresh paraphrase of yesterday's debugging case is not a fresh holdout.

Maintain a small, restricted stream of newly collected tasks alongside the expanding regression suite. The regression suite asks whether known mistakes returned; the restricted stream asks whether the current system generalizes to less familiar work. Preserve both questions rather than blending them into one reassuring percentage.

Frequently asked questions

Is a public benchmark useless for agent evaluation?

No. It can support reproducible comparisons, but public availability creates exposure risks. Report the benchmark version, tool access, contamination checks, and the narrower claim its results support.

Can synthetic examples go into a holdout?

Yes, if their lineage is controlled and their realism is validated. Keep variants from the same source scenario or generator template together, and avoid treating synthetic coverage as proof of production representativeness.

How many tasks are enough?

There is no universal number. Required coverage and uncertainty depend on task diversity, failure severity, and the effect you want to detect. Start by identifying missing families and measurable outcomes, then justify sample size for the intended decision.

Source reference list

AI Agent Evaluation
Evaluation Datasets
Data Leakage
AI Testing