FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Guides

An LLM wrote 96 tests for your agent. Trust only 50 of them

Anthropic says 20-50 tasks drawn from real failures are enough to start; the skill lies in discarding the cases you cannot grade yourself.

ShareLinkedInFacebookX

In brief

  • Build the dimension tuples before writing any questions, and ground the questions in the customer's real documents.
  • Grade at least 30 traces by hand, and keep only the cases on which two independent graders agree.
  • Synthetic data helps you find failures; it cannot tell you how often they happen in production.
Three horizontal bars with lengths proportional to the figures: 24 dimension combinations, 96 traces (each case run once), and 50 golden cases on which two graders agree. The 50-case bar is highlighted and split into 25 cases where the agent should act and 25 where it should decline.
From 24 dimension combinations, each producing 4 questions, come 96 traces. Only cases on which two independent graders reach the same verdict are kept, leaving about 50, split evenly between act and decline. Source: worked example in the article, based on guidance from Hamel Husain and Shreya Shankar, Anthropic and DeepEval.

Between 20 and 50 simple tasks drawn from real failures make a good starting point for testing an agent, according to Anthropic’s guide to agent evals. An LLM can write hundreds of test questions in a few minutes, but many will be near-duplicates, and for some even you will not be sure what the right answer is.

Volume, then, is easy. The hard part is choosing a few dozen cases you would dare to use as a benchmark.

This guide goes from a list of dimensions to 96 traces, then filters them by hand to 50 cases. You need Python 3, an agent you can run locally (or on staging), access to an LLM, and the customer’s real business documents. The code below is simplified: call_llm and run_agent are wrappers you write yourself, rather than any library’s API.

Step 1: Don’t ask the LLM for questions yet

Hamel Husain and Shreya Shankar recommend generating synthetic questions from tuples of dimensions, with each tuple taking exactly one value from each dimension. Take a hypothetical customer service agent at a delivery company, with four dimensions: intent, customer persona, how complete the information is, and whether the agent should act or refuse.

import itertools, json

DIMENSIONS = {
    "intent": ["track_order", "change_address", "refund"],
    "persona": ["new_customer", "angry_customer"],
    "info": ["complete", "missing_order_id"],
    "expectation": ["should_act", "should_refuse"],
}
tuples = [dict(zip(DIMENSIONS, combo))
          for combo in itertools.product(*DIMENSIONS.values())]
print(len(tuples))  # 3 * 2 * 2 * 2 = 24

Check: you have exactly 24 tuples, and a glance at each line tells you what that case tests. If a combination makes no sense in the real business, delete it now, because dropping it after the questions are written costs far more work. The example below keeps all 24 to make the arithmetic easy; if you delete some, raise the number of questions per tuple so the set stays near 100.

The expectation dimension is there for a reason. Anthropic warns that one-sided evals lead you to optimize the agent in one direction. If every case expects a refund, you will reward an agent that hands out refunds indiscriminately.

Step 2: Write questions in a separate call, from real documents

Hamel and Shreya explain that separating tuple generation from question writing keeps the phrasing from repeating. DeepEval’s documentation treats document-based generation as the strongest default, because the questions stay tied to your knowledge base.

At the other end, letting the LLM invent questions with no documents is the least grounded method, suitable only for simple problems.

policy = open("refund_policy.md").read()  # the customer's real document

def write_queries(t, n=4):
    prompt = (
        f"Using only this policy:\n{policy}\n\n"
        f"Write {n} different customer messages for: {json.dumps(t)}. "
        "One message per line. Vary wording and length."
    )
    return call_llm(prompt).splitlines()  # simplified wrapper

cases = []
for i, t in enumerate(tuples):
    for j, q in enumerate(write_queries(t)):
        cases.append({"id": f"c{i}_{j}", **t, "query": q})
print(len(cases))  # 24 * 4 = 96

Check: skim any 10 questions. If five of them open identically, go back and see whether the prompt is actually receiving the tuple.

Step 3: Run the agent once per case, then read the traces

In this guide, a trace is one run of the agent on one case. Each case runs only once at this stage, so 96 cases yield exactly 96 traces, and each trace carries its case’s id. Hamel and Shreya say that about 100 diverse traces are a useful starting set for finding failures.

with open("traces.jsonl", "w") as f:
    for c in cases:
        out = run_agent(c["query"])  # simplified wrapper
        f.write(json.dumps({**c, "trace": out}) + "\n")

Check: the file has 96 lines. Open it and read the traces yourself; counting lines is not enough. This is when you note the first failures.

Step 4: Trust a case only when two graders agree

This step decides whether the test set can be trusted. Hamel and Shreya advise annotating at least 30 traces yourself instead of relying on automated suggestions. DeepEval likewise says generated goldens should be reviewed, corrected and supplemented before you treat them as ground truth.

The clearest filter comes from Anthropic: a good task is one on which two domain experts, grading independently, would reach the same pass or fail verdict.

So you grade the 96 traces in one file, someone on the customer’s side who knows the business grades them in another, and neither sees the other’s work. Because each case has a single trace, grading by id covers both the case and the trace.

import csv

def load(path):
    return {r["id"]: r["verdict"] for r in csv.DictReader(open(path))}

a, b = load("labels_me.csv"), load("labels_ops.csv")
agreed = [i for i in a if i in b and a[i] == b[i]]
disputed = [i for i in a if i in b and a[i] != b[i]]
print(len(agreed), len(disputed))

Say that of the 96 traces, the two of you disagree on 30. Don’t rush to delete all 30.

Each disagreement is a policy question the customer has not clearly answered: for example, whether an angry customer demanding a refund for an order one day late should get one.

Keep the cases whose task can be rewritten to be clear, and drop those that are ambiguous at the root.

Step 5: Rerun, cut to 50 cases and balance both sides

Only now is it time for repeated runs. For the cases you agreed on, run the agent three more times each, because Anthropic stresses that you can tell whether your graders are working only by reading the transcripts and scores from many trials.

with open("trials.jsonl", "w") as f:
    for c in cases:
        if c["id"] not in agreed:
            continue
        for trial in range(3):
            out = run_agent(c["query"])  # simplified wrapper
            f.write(json.dumps({"id": c["id"], "trial": trial, "trace": out}) + "\n")

Look for cases the agent fails all three times. According to Anthropic, a task that never passes usually signals a broken task and rarely an incapable agent. Reread the task: the question may demand information that appears nowhere in the policy document.

Then count along the expectation dimension. A reasonable target is about 25 cases where the agent should act and 25 where it should refuse, with every intent represented. Write these 50 cases to golden.jsonl, along with the agreed pass/fail verdict and one line explaining why.

Common mistakes

The costliest mistake is reporting the failure rate on a synthetic set as the real failure rate. Hamel and Shreya say plainly that synthetic data does not tell you how prevalent a failure is in production. If the agent fails 10 of 50 cases, you know it has kinds of failure worth fixing. You do not know that 20% of customers will encounter one.

Another mistake begins with a prompt that includes no documents. Suppose you ask the LLM for refund questions without pasting in the policy: it may assume a 30-day refund window when the customer allows only seven days.

An agent that follows the real policy is then marked as failing, the kind of risk that leads DeepEval to class generation from scratch among the least grounded methods.

A one-sided test set is hard to detect because the scores look excellent. If all 50 cases involve customers eligible for a refund, an agent that refunds every request scores 50 out of 50. You find out it is wrong only when it meets an ineligible customer in the real world.

The last mistake sits in the automated grader. Suppose it passes every answer containing the word “refunded”, even when the agent refunds an order the policy does not allow. The overall score still looks good, and the problem surfaces only when you open and read the transcripts from many trials, as Anthropic advises.

Where this skill shows up in customer work

At a customer site, you often have to demo an agent before there are enough real logs. These 50 cases give you something to measure against from the first week. The joint grading session with the customer’s operations team is effectively customer discovery: every case the two sides grade differently is a business rule nobody has written down.

Once real traffic arrives, add cases drawn from real failures to the test set, since those are the kind of tasks Anthropic considers a good starting point.

If you want this skill on your CV, describe the process and the numbers: built a 50-case eval set from 96 traces, with two independent graders, balanced on both sides.

A hiring manager for an FDE role who reads that line will see that you can measure an agent as well as demo one.

The final result sits in golden.jsonl. But the cases you struck out, and the reasons you did so, are what the customer most needs to read, because they record the business rules nobody had ever written down.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
3 sources
Read next on the roadmap · Stage 6: MeasurementAn LLM judge with 85% agreement can still miss most real failuresAt Arize AI, FDEs build trace-to-eval programmes with client teams; the core skill is catching a weak judge before it becomes a release gate.