[Preview] Best Practices for AI Agent Evaluation

Important Note: This feature is available in Preview for select customers. During the Preview phase, AI Agent Evaluation is accessed inside the AI Agents Platform. At General Availability (GA), the experience will move to CXA Operations Center (formerly AI Trainer).

This document outlines best practices for designing datasets, including dataset authoring, choosing metrics, and running evaluations on the AI Agent Evaluation feature (Preview).

 

Table of Contents

Before designing datasets, the core concepts of Agent Evaluation (Dataset, Metric, and Evaluation) and how they fit together should be understood. For more information, see [Preview] Agent Evaluation: Overview in this article.

 

Best Practices for Creating Datasets

  • Starting small and covering critical paths first: 10 to 20 sharp scenarios covering the highest-value flows outperform 200 sloppy ones. Breadth should be added only after the critical paths are solid.
  • Keeping one dataset, one purpose: Routing tests should not be mixed with tool-execution tests, or happy-path scenarios with adversarial probes. Mixed datasets hide both signals behind one aggregate pass rate. Tags make it possible to run each group on its own, but separate datasets keep the aggregate pass rate meaningful.
  • Naming test cases for triage, not sequence: "T007 — Customer data disclosure — Target: Authorized users" is preferable to "Test Case 12."
  • Filling in only the reference fields the chosen metrics need: Each reference field maps to one metric: "Reference Goal" to Goal Accuracy, "Reference Tool Calls" to Tool Call Accuracy, "Reference Application Output" to Application Output Accuracy, and "Reference Answer" to Answer Accuracy. Instruction Adherence and Guardrails require no reference field.

 

Best Practices for Designing Simulated Datasets

A Simulated test case has three fields that jointly drive the conversation. These should be kept cleanly separated:

  • Persona: Who the user is: Identity, channel, language, emotional state. 
  • Instructions: How the user behaves: Pacing, tone, what not to volunteer. 
  • Goals: What the user is trying to get: The facts to reveal and the order to reveal them in.
     
  • Progressive disclosure should be used for multi-turn flows. Without an explicit rule, the simulator states its whole backstory in the first message, and multi-turn coverage collapses. The following should be added to Instructions: "Answer ONLY the specific question just asked — never volunteer unasked information" and "max ONE new fact from your Goal per message." Facts in Goals should be numbered in reveal order. This Instructions block is reusable verbatim across an entire dataset. Only Persona and Goals need to vary per scenario (as seen across a 294-scenario MasOrange routing dataset).
  • Supply sensitive test data only on request. "Only provide if and when asked" should be added to any sensitive value. Without it, the simulator front-loads the value, and the ability to test whether the agent asks before proceeding is lost. This is what makes an authentication-gating goal (for example, "the agent should always ask for the social security number (SSN) and personal identification number (PIN)") testable at all.
  • Never use realistic-looking data in Test Data. Any SSN-, PIN-, or account-number-like value should be synthetic (sequential digits, clear placeholders).

Note: If the Goals field contains a pacing rule like "keep it short," it should be moved to Instructions. Duplicating it across fields makes the dataset harder to maintain.

 

Best Practices for Determinism

Determinism is not exclusive to Scripted test cases. Simulated is the more capable default. It supports every metric and multi-turn flows, and it can still produce reproducible wording.

  • Pinning exact wording inside Simulated Instructions: The literal message can be embedded, for example: "Your first message should always ask your question. Use the following message: How do I go about getting a quote online?" The simulator sends it verbatim while the dataset keeps Simulated's full metric access. (This is how a real EveryPaw FAQ dataset is built, using the Simulated schema, not Scripted, with the question pinned inside Instructions.)
  • Reserving Scripted for the one hard constraint that requires it: Answer Accuracy is Scripted-only and single-turn-only by product design. For every other metric, a deterministic Simulated case provides the same reproducibility, with multi-turn support.
  • Keeping Scripted cases narrow when used for Answer Accuracy: One question and one Reference Answer per test case should be used.
  • Adding phrasing-variant test cases for top intents: One question should be repeated with small wording differences (a greeting added, filler words) against one shared Reference Goal, to catch brittleness that a single "clean" phrasing would not reveal.

Note: Whether Answer Accuracy is specifically required should be confirmed first. If not, Simulated remains the better choice even when the wording must be fixed.

 

Best Practices for Adversarial and Security Scenarios

Reference Goals in this context describe what the agent must refuse, not what it must deliver.

  • Name the attack technique in the title and record severity as a tag. For example, title the scenario "ADV-002 - Indirect Prompt Injection - User Text" and tag it "sev.critical" and "r.injection". The tag makes it possible to run all critical adversarial scenarios together with Run by Tags.
  • Writing Reference Goals as a permission plus a prohibition, not just a prohibition. For example: "The agent may warn that the message looks like a scam, but it MUST NOT disclose internal fraud-detection rules. It should decline and offer to connect the user to fraud support." This scores more reliably than a bare "must not disclose."
  • Scripting a second-push pressure test. Most agents pass a single-shot refusal; guardrail gaps show up on the second attempt. Script the simulator to press once more before closing naturally.
  • Keeping adversarial scenarios in a dedicated dataset, not mixed into happy-path regression, with a stricter promotion threshold for it.

 

Best Practices for Writing Reference Goals

The Goal Accuracy judge reads the full Chain of Thought, including internal agent-to-agent messages. A goal that doesn't name its scope can be scored against reasoning that was never intended to be included.

Avoid (ambiguous) Prefer (scoped)
"The agent does not speak English." "The agent does not speak English to the user — internal messages may be in English."
"The agent is polite." "The agent's replies to the user use a polite, formal tone."
  • Preferring several small, independent goals over one compound goal: Each gets its own pass/fail and reasoning instead of one ambiguous verdict.
  • Covering both directions of a constraint: "The agent should ask for X" can pass for the wrong reason if the user volunteers X and the agent's guardrail simply refuses to use it. Where the distinction matters, it should be written explicitly: "should ask for X, and must not accept X if volunteered without being asked."

 

Best Practices for Managing Datasets 

  • Treating datasets as immutable: Duplicate to change. This guarantees that an evaluation from three months ago and one today, both pointing at the same dataset name, were scored against identical test cases.
  • Versioning with an explicit naming convention (for example, <usecase>_v2, or <usecase>_20260420) so lineage is obvious without opening the dataset.
  • Growing the suite from real production failures. The dataset should be duplicated, the failure added as a new test case, and the result saved as the next version.
  • Building at scale with CSV or JSON. If there are import errors on a metric, the metrics with no available reference should be unpicked. Tags can be added in the same file, in a "tags" column or "tags" array.
  • Watching the 500-scenario ceiling. Large suites should be planned as multiple purpose-scoped datasets.
  • Retire datasets that no longer reflect the orchestration rather than accumulating stale versions.

 

Best Practices for Tagging Scenarios

Tags come from one list shared by the whole account, limited to 100 tags of up to 15 characters each. A few early decisions keep that list useful as more datasets are added. For instructions on creating and assigning tags, see "Tagging Scenarios" in [Preview] Agent Evaluation: Overview.

  • Starting with the default tags: Every scenario should carry one of "happy_path", "sad_path", or "edge_case" to record the expected outcome. A dataset where every scenario carries "happy_path" is not testing how the AI Agent handles failures.
  • Agreeing on a naming convention before creating tags: The list is shared by every team in the account, so a short prefix per dimension keeps related tags together and within the length limit, for example "j.billing" for a journey, "r.pii" for a risk area, or "rel.2611" for a release. One spelling per concept avoids splitting results that belong together.
  • Tagging by what a scenario tests, not by where it lives: The dataset name already identifies the dataset and its version, so tags such as "dataset_v2" or "team_a" add little. Tags work best for slices that cut across datasets: the journey, the expected outcome, the risk area, or the change that motivated the scenario.
  • Keeping two to four tags per scenario: One outcome tag, one journey tag, and, where relevant, one risk or release tag are usually enough. Scenarios with many tags get pulled into almost every tag-based run.
  • Remember that Run by Tags widens, not narrows: A scenario runs if it carries at least one of the selected tags, so each additional tag adds scenarios. To run a narrow slice, such as failed billing requests, a dedicated tag works better than selecting "j.billing" and "sad_path" together.
  • Building a smoke set for quick checks: A shared tag such as "smoke" on the most important scenarios gives fast feedback after each prompt or configuration change. The full dataset should still run before a version is promoted.
  • Comparing like with like: Scores depend on which scenarios ran. Two evaluations should be compared only when both used the same dataset and the same tag selection, or no tag selection.
  • Tagging in the source file when importing: A "tags" column in CSV or a "tags" array in JSON tags many scenarios at once. Unknown valid names are created on upload, invalid names are discarded with a warning, and new tags count toward the 100-tag limit.
  • Retagging before deleting a tag: Deleting a tag removes it from the selectable list, but scenarios that already use it keep it. Reassigning those scenarios first keeps tag-based runs picking them up.
  • Reviewing the tag list regularly: Release and fix tags lose value once the change ships. Tags that describe lasting coverage, such as journeys, outcomes, and risk areas, should stay, and the rest should be retired.

Best Practices for Choosing Metrics

Two to three metrics should be chosen that together answer: Did the agent do the right things, for the right reasons, and end up in the right place?

Use case Suggested metrics
Complex tool execution Goal Accuracy 
Identity verification / PII gates Goal Accuracy · Guardrails
RAG-based troubleshooting / FAQ Goal Accuracy · Answer Accuracy
Front-door routing Application Output Accuracy

Note: PII refers to personally identifiable information. RAG refers to retrieval-augmented generation.

  • Goal Accuracy: Should be used for a one-off, scenario-specific outcome. It is fastest to author.
  • Custom Metric: Should be used when a check is reusable across scenarios, needs per-criterion pass/fail, or must happen in a specific order (use the “Steps” toggle). It is defined once in the Metrics Library and can then be attached anywhere and edited once.

 

Custom Metric vs. Reference Goal (Goal Accuracy)

Both can validate the same underlying behavior; the difference lies in reuse and visibility, not capability.

Reference Goal (Goal Accuracy) Custom Metric
Best for A quick, one-off goal defined directly on the test case — e.g., "the agent books the appointment." or for specific goals per scenario A check that needs to be reused across many scenarios, or where you need to know which individual criterion failed rather than one score for the whole goal.
Where it's defined On the test case itself (Reference Goal field) Once, in the account-level Metrics Library, then attached to any scenario
Maintenance Duplicated per scenario — diverges over time if the same check is copy-pasted Edit once, updates everywhere it's attached
Granularity One score (or one score per goal, if multi-goal) Per-criterion pass/fail, plus an overall metric score
Ordering Not supported Steps toggle evaluates criteria in sequence, not just independently
Non-negotiable gating Not supported Critical toggle. Failing that one criterion fails the whole metric
Setup location Dataset (test case) Metrics Library

If the same Reference Goal is about to be written into a third or fourth scenario, that's the signal to move it into a Custom Metric instead. A recurring check like "Did the agent ask if the caller is a new or existing patient?" applies to every patient-intake scenario. Defining it per scenario creates duplicates that drift over time, whereas the library model lets you define it once, attach it anywhere, and update it everywhere when you edit it.

The two approaches are not mutually exclusive. A common pattern combines Goal Accuracy for the scenario's outcome with a Custom Metric for a cross-cutting quality bar (tone, disclosure, offer-to-escalate) that applies regardless of outcome.

  • Reserve Critical for genuine non-negotiables, such as compliance requirements or promises the agent cannot break. Quality and tone checks are better left non-critical.
  • Preferring Goal Accuracy over Tool Call Accuracy when authoring effort is a concern. A well-scoped goal can often confirm a tool was called without the maintenance cost of a full tool-call reference.
  • Set Number of Runs > 1 before trusting a verdict, since judges are non-deterministic.

 

Best Practices for Running and Iterating

  • Test one change at a time in the agent's instructions or orchestration, then re-run before making another change.
  • Always evaluate the version intended for promotion. Orchestration and Version should be confirmed in the wizard, not left on a stale draft.
  • Re-run before escalating a surprising result. A single unexpected fail isn't yet evidence of a regression.
  • Gate promotion on a threshold agreed in advance, before looking at results.
All Articles ""
Please sign in to submit a request.