Build Agent tests: Datasets, Test Cases, and Evaluations
Define inputs, structure tests, and configure evaluation rules before running them.
Overview
The Agent Component includes a testing structure with Datasets, Test Cases, and Evaluations. These help you test different inputs in a controlled way and check if the outputs meet your requirements before going to production.
Use this structure when you want to:
Check how accurate your AI agent is with different inputs.
Compare different approaches, like prompt changes or new tools.
Avoid regressions when updating prompts.
Compare different Agent versions using the same tests.
Make sure everything is validated before deploying to production.
Core concepts
Dataset: A group of related test scenarios organized as a single test suite. Each Dataset includes Test Cases and Evaluations.
Test Case: A specific input setup that represents one execution scenario. It defines the values for the variables used in your prompt.
Evaluation: A rule used to check a specific field or condition in the model’s output. It is linked to a Dataset and runs for each Test Case.
Prerequisites
Before creating a Dataset, your System or User prompt must include at least one variable declared using Double Braces syntax, for example:
This tells the Platform that the value is dynamic and can be injected from a Test Case. Without Double Braces, values are treated as static text and cannot be configured or tested.
Once a Dataset exists, at least one Test Case must be configured for the component to run. To return to normal execution mode, remove all Datasets.
Step 1: Create a Dataset
A Dataset acts as a test suite for your agent. Each Dataset can contain multiple Test Cases and Evaluations.
In the Agent Component, navigate to the Datasets tab under Output Details.
Click Create Dataset (or click Select a Dataset and then Create a new Dataset if one already exists).
Provide a name and confirm.
Step 2: Create Test Cases
A Test Case provides values for the variables declared in your prompt, simulating a specific input scenario.
Example
Given this User Prompt:
A Test Case would supply:
At execution time, {{ message.topic }} is replaced with this value.
Creating a Test Case
Open the Dataset and click New Test Case.
Select the newly created Test Case.
Provide values for each detected variable.
Click Save.
You can create as many Test Cases as needed to simulate realistic input diversity. When running a Dataset, all Test Cases are executed independently, and each one consumes tokens separately.

Creating a Test Case from an execution log
Instead of typing variable values by hand, you can generate a Test Case directly from an agent execution that already ran in your pipeline. This lets you validate your agent against inputs from real usage, which speeds up test creation and keeps your Datasets closer to production behavior.
To create a Test Case from an execution log:
Go to the Pipeline Logs tab in the Monitor area, switch to the Agents view, and open the log for the execution you want to reuse.
At the bottom of the panel, click Create test case.
Select the target Dataset.
Map the pre-filled variables.
Click Collect execution.
The Test Case is added to the Dataset you selected and is ready to run with your existing Evaluations in the Agent Component. For the full log inspection workflow, read Pipeline Logs.
Step 3: Create Evaluations
An Evaluation is a rule that automatically checks whether the output generated by your Agent meets a specific criterion. For example, whether a field is filled in, whether the response contains a certain word, or whether the tone is appropriate.
Instead of manually reviewing each output, you define the rule once and the system applies it automatically across your test cases.
Creating an Evaluation:
Open the Evaluations tab.
Click Add Evaluations.
Fill in the fields described in the next section.

Configuring the Evaluation fields
Eval Name
A label to identify this evaluation rule. Choose something descriptive, like title_not_empty or tone_check.
JSONPath: Telling the system where to look
When your Agent generates a response, that response is stored internally as a structured object called body. JSONPath is the address you write to tell the system which part of that response you want to evaluate.
Think of it like pointing to a cell in a spreadsheet: instead of saying "column B, row 3," you write a path like $.body.title to mean "the title field inside body."
The path always starts with $.body, followed by the name of the field you want to check.
Scorer Type: How the evaluation will judge the output
The Scorer Type defines what kind of check will be performed on the field you selected. There are two categories: deterministic scorers and the LLM scorer.
Attaching the Evaluation to a Dataset
An Evaluation rule on its own doesn’t run automatically. It needs to be attached to a Dataset (the collection of Test Cases against which the Agent will be tested).
To attach an Evaluation:
Click the three dots menu next to the evaluation name.
Select Add to Dataset and choose the target Dataset.
Click Add.
Once attached, the Evaluation will be applied to every Test Case in that Dataset.
Setting expected values per Test Case
Each Test Case can have its own expected outcome for a given Evaluation. This is where you define what "correct" looks like for that specific case.
To configure:
Open the Dataset and navigate into the Test Case.
Go to the Evaluations section.
Set the expected value based on the scorer type:
For String, Number, Boolean, Array, or Object scorers: Enter the exact value the output must match for the test to pass. For example, if the operator is
Containsand you're testing a product description, you might enter the product name as the expected value.For the LLM scorer: Select whether you expect the result to be Passed or Not Passed for this specific case. For example, if you're testing a known bad input, you might expect the verdict to be "Not Passed" — and the evaluation will succeed if the judge model agrees.

Next steps
Now that you know how to build tests, the next step is to run tests, analyze results, and manage versions.
Last updated
Was this helpful?