A test case is a recorded conversation with your agent that you want to keep answering correctly. Every AI Fusion test case starts from a real run of the agent: you hold the conversation (or let Studio AI hold it), check the answers, adjust any answer that is not what you expect, and save it. This article describes where test cases are stored, the four ways to create them in AI Fusion Studio, how to choose the evaluation levels of a case, and how to attach run hooks to it.
Test cases are grouped into eval suites. Each suite belongs to one agent and is a CSV file in the agent's Evals folder:
<LU>/AI/Agents/<agent>/Evals/<suite>.csv
Each row of the file is one test case. You normally never edit these files by hand — the Eval Editor and the AI Explorer commands maintain them for you — but knowing the columns helps when you review changes in source control.
| Column | Content |
id |
A stable internal row ID. |
sessionid |
The baseline session the case was saved from. Its snapshots and its token/time figures are what the case replays on and is compared with. |
caseId |
The test case name, unique within the suite. |
initParams |
JSON object of the agent inputs the conversation starts with, for example {"customerId":"1"}. From AI Fusion 3.0.9, keys may contain any character except quotes (', ", `), backslash, ? and control characters; earlier versions accepted only letters, digits and underscores. |
description |
Free-text description of what the case checks. |
disabled |
1 when the case is excluded from runs. |
threshold |
JSON array of thresholds, for example [{"defaultThreshold":{"MIN":"4.0"}},{"Tokens":{"MAX":"20"}}]. See Quality Criteria and Thresholds. |
dimension |
JSON map of dimension name to the description the judge receives. |
transcript |
JSON array of {"role","content"} messages. user messages are the questions that are replayed; assistant messages are the expected answers. |
transcript_edited |
1 while the transcript has changes that were not yet uploaded with Upload Artifacts. |
saved_with_snap |
1 when a snapshot of the business data was captured with the case. Set once, when the case is first saved. |
eval_mode |
The evaluation levels of the case: step, conversation or both. An empty cell (suites written before AI Fusion 3.0.9) means step. Studio always writes the value explicitly, so older files gain step cells the next time Studio saves them. |
conv_criteria |
JSON array of the conversation-level criteria, one plain sentence each, for example ["The agent gave the checking balance","The agent offered further help"]. Empty when the case has no criteria. |
before_hooks |
JSON array of the Broadway flows to run before the conversation is replayed, in run order, for example ["PrepareCustomer"]. Empty when there are none. |
after_hooks |
JSON array of the Broadway flows to run after the evaluation, in run order. Empty when there are none. |
The last four columns require AI Fusion 3.0.9 and AI Fusion Studio 1.0.2. Older suite files, without these columns, still open and run as step-level cases without hooks.
A case can be single-turn (one question, one answer) or multi-turn. In a multi-turn case, every user message is replayed in order within the same conversation, so the case also tests whether the agent keeps context across turns.
Suites are read from the deployed LU. The evaluation runtime reads the copy of the suites that was deployed with the LU, not the files in your workspace. Studio takes care of this: it soft-deploys the agent's LU after every change it makes to a suite and before every run. If you change a CSV outside Studio (for example, by pulling from Git), deploy the LU before running.

In the AI Explorer, expand an agent and its Evals folder. Each suite is shown as a node, and its test cases are listed under it.
To create a suite, right-click the agent (or its Evals folder) and select New Eval Suite…. Enter a name; Studio creates the CSV with one test case named "New test" and opens it in the Eval Editor. Like every case created in Studio, it starts at conversation level with no criteria — see Choosing the Evaluation Levels.
Right-click a suite to:
Right-click a test case to:
Use this method when you want to design a specific scenario from scratch.


The suite file is edited like any other document in Studio: save it with Ctrl+S. Studio asks you to save or discard unsaved changes when you switch to another case.
Use this method when you find an interesting conversation while testing the agent in Preview — a good answer you want to protect, or a bad one you want to fix and keep fixed.
The new case starts at conversation level only, with no criteria. Until you add criteria, its conversation level fails with the note "No conversation criteria defined for this case. Add at least one criterion." Open the case from the AI Explorer, add criteria (or click Ask AI), and turn on Step level evaluation if you also want the stored answers used as expected answers. See Choosing the Evaluation Levels.
Conversations that real users had — especially those with negative feedback or unexpected behavior — make the most valuable test cases. You export them from Observation and import them into Studio Preview, then save them as test cases. See Data Snapshots and Production Import.
The Agent Builder in Studio AI can build a suite for you from a list of business questions. Unlike the AI-assisted generation of AI Fusion 2.x, it does not invent answers: it runs every question through the agent and saves the agent's real answer as the expected answer.
For an entity-scoped agent, the agent needs a working step_start hook that loads the entity with the GetWithSnap actor; otherwise the agent has no customer data and the snapshots are empty. The Agent Builder checks this and offers to fix the hook first.
See AI-Assisted Development for how to start the Agent Builder.
Review generated cases like any other: an answer captured from the agent is a baseline, not automatically a correct answer.
At step level, the assistant answers in a case's transcript are what the judge compares new answers with. They are not used at conversation level. When a recorded answer is wrong or incomplete, correct it so the case describes what the agent should say.

Editing the user questions changes what is replayed; editing the assistant answers changes what is expected. Write expected answers that describe the required content, not exact wording — see Evaluation Best Practices.
A case can be judged on two levels. Each level has its own section in the Properties panel, with an on/off toggle in the section header:
| Section | What it judges | What you configure |
| Step level evaluation | Each answer, against the expected answer of its turn ("Each step is scored against its gold answer"). | Default Threshold, Dimensions and their thresholds, including Token Consumption and Response Time. See Quality Criteria and Thresholds. |
| Conversation level evaluation | The whole conversation, against criteria ("Each criterion is checked against the whole conversation: met, partial or missed"). | The Criteria list. See Conversation Criteria. |
Turn on one level or both. At least one level must stay on: if you try to switch off the only level that is on, Studio shows "At least one evaluation level must stay on. Turn the other level on first to switch this one off." A section that is off is faded and shows Off as its summary. When the conversation level is on, its summary shows the number of criteria, for example 3 criteria.

Which level a case starts with depends on how it was created:
There are no default criteria. While the conversation level is on and the case has no criteria, the criteria list shows the error "Add at least one criterion to evaluate at conversation level." The case can still be saved and run, but its conversation level fails.
Use both levels when you can. The conversation level checks that the conversation reached its goal, whatever path the agent took; the step level checks each answer in detail, and it is the only level that checks token consumption and response time.

To get suggestions, click Ask AI (shown when Studio AI is available). Studio AI reads the case's transcript and proposes three to five criteria. It does not change the case until you answer: approve the list to add it to the case's criteria (existing criteria are kept), ask for changes, or decline.

For how the criteria are judged and how to write good ones, see Conversation Criteria.
Run hooks are Broadway flows that run around a test case: before the conversation is replayed and after it is evaluated. Use them to:
Run hooks require AI Fusion 3.0.9 and AI Fusion Studio 1.0.2. After upgrading AI Fusion, redeploy the aifusion Data Product so that hook results can be stored.

A hook fails when its flow throws an error — for example, an assert actor whose check does not hold, or a flow that cannot be found. The error text becomes the hook's message. A hook passes when its flow completes. A hook does not have to return anything: if the flow has outputs, they are recorded as the hook's output and shown in the results, but they do not affect the verdict. Each hook is reported as passed, failed or skipped.
Every hook flow receives these inputs (flow externals):
A hook flow name is resolved the same way as an agent hook: first in the agent's Data Product, then in the aifusion Data Product. To pin a flow to a specific Data Product, write it as LU__<lu>__<flow> in the before_hooks / after_hooks cell of the suite CSV; the flow picker lists plain names only.
See Run Hooks in the Results for how hook outcomes are shown.
Toggle Disabled in the Eval Editor top bar (or use Enable / Disable in the AI Explorer) to keep a case in the suite without running it, for example while a known issue is being fixed. Disabled cases are skipped by suite runs, and Run Evaluation is not available for them.
Agents that answer relative-date questions ("my bill from last month") get today's date from the current_datetime tool. When a case replays a snapshot captured months ago, today's date no longer matches the data. To pin the date for a case, add a now key to the case's initParams, for example {"customerId":"1","now":"2025-06-01T00:00:00Z"} (a date-only value means midnight UTC).
now is honored only in evaluation runs. The interactive agent endpoints reject it, so you cannot enter it in the New chat dialog; add it to the initParams cell of the suite CSV and deploy the LU.
Next article: Quality Criteria and Thresholds
A test case is a recorded conversation with your agent that you want to keep answering correctly. Every AI Fusion test case starts from a real run of the agent: you hold the conversation (or let Studio AI hold it), check the answers, adjust any answer that is not what you expect, and save it. This article describes where test cases are stored, the four ways to create them in AI Fusion Studio, how to choose the evaluation levels of a case, and how to attach run hooks to it.
Test cases are grouped into eval suites. Each suite belongs to one agent and is a CSV file in the agent's Evals folder:
<LU>/AI/Agents/<agent>/Evals/<suite>.csv
Each row of the file is one test case. You normally never edit these files by hand — the Eval Editor and the AI Explorer commands maintain them for you — but knowing the columns helps when you review changes in source control.
| Column | Content |
id |
A stable internal row ID. |
sessionid |
The baseline session the case was saved from. Its snapshots and its token/time figures are what the case replays on and is compared with. |
caseId |
The test case name, unique within the suite. |
initParams |
JSON object of the agent inputs the conversation starts with, for example {"customerId":"1"}. From AI Fusion 3.0.9, keys may contain any character except quotes (', ", `), backslash, ? and control characters; earlier versions accepted only letters, digits and underscores. |
description |
Free-text description of what the case checks. |
disabled |
1 when the case is excluded from runs. |
threshold |
JSON array of thresholds, for example [{"defaultThreshold":{"MIN":"4.0"}},{"Tokens":{"MAX":"20"}}]. See Quality Criteria and Thresholds. |
dimension |
JSON map of dimension name to the description the judge receives. |
transcript |
JSON array of {"role","content"} messages. user messages are the questions that are replayed; assistant messages are the expected answers. |
transcript_edited |
1 while the transcript has changes that were not yet uploaded with Upload Artifacts. |
saved_with_snap |
1 when a snapshot of the business data was captured with the case. Set once, when the case is first saved. |
eval_mode |
The evaluation levels of the case: step, conversation or both. An empty cell (suites written before AI Fusion 3.0.9) means step. Studio always writes the value explicitly, so older files gain step cells the next time Studio saves them. |
conv_criteria |
JSON array of the conversation-level criteria, one plain sentence each, for example ["The agent gave the checking balance","The agent offered further help"]. Empty when the case has no criteria. |
before_hooks |
JSON array of the Broadway flows to run before the conversation is replayed, in run order, for example ["PrepareCustomer"]. Empty when there are none. |
after_hooks |
JSON array of the Broadway flows to run after the evaluation, in run order. Empty when there are none. |
The last four columns require AI Fusion 3.0.9 and AI Fusion Studio 1.0.2. Older suite files, without these columns, still open and run as step-level cases without hooks.
A case can be single-turn (one question, one answer) or multi-turn. In a multi-turn case, every user message is replayed in order within the same conversation, so the case also tests whether the agent keeps context across turns.
Suites are read from the deployed LU. The evaluation runtime reads the copy of the suites that was deployed with the LU, not the files in your workspace. Studio takes care of this: it soft-deploys the agent's LU after every change it makes to a suite and before every run. If you change a CSV outside Studio (for example, by pulling from Git), deploy the LU before running.

In the AI Explorer, expand an agent and its Evals folder. Each suite is shown as a node, and its test cases are listed under it.
To create a suite, right-click the agent (or its Evals folder) and select New Eval Suite…. Enter a name; Studio creates the CSV with one test case named "New test" and opens it in the Eval Editor. Like every case created in Studio, it starts at conversation level with no criteria — see Choosing the Evaluation Levels.
Right-click a suite to:
Right-click a test case to:
Use this method when you want to design a specific scenario from scratch.


The suite file is edited like any other document in Studio: save it with Ctrl+S. Studio asks you to save or discard unsaved changes when you switch to another case.
Use this method when you find an interesting conversation while testing the agent in Preview — a good answer you want to protect, or a bad one you want to fix and keep fixed.
The new case starts at conversation level only, with no criteria. Until you add criteria, its conversation level fails with the note "No conversation criteria defined for this case. Add at least one criterion." Open the case from the AI Explorer, add criteria (or click Ask AI), and turn on Step level evaluation if you also want the stored answers used as expected answers. See Choosing the Evaluation Levels.
Conversations that real users had — especially those with negative feedback or unexpected behavior — make the most valuable test cases. You export them from Observation and import them into Studio Preview, then save them as test cases. See Data Snapshots and Production Import.
The Agent Builder in Studio AI can build a suite for you from a list of business questions. Unlike the AI-assisted generation of AI Fusion 2.x, it does not invent answers: it runs every question through the agent and saves the agent's real answer as the expected answer.
For an entity-scoped agent, the agent needs a working step_start hook that loads the entity with the GetWithSnap actor; otherwise the agent has no customer data and the snapshots are empty. The Agent Builder checks this and offers to fix the hook first.
See AI-Assisted Development for how to start the Agent Builder.
Review generated cases like any other: an answer captured from the agent is a baseline, not automatically a correct answer.
At step level, the assistant answers in a case's transcript are what the judge compares new answers with. They are not used at conversation level. When a recorded answer is wrong or incomplete, correct it so the case describes what the agent should say.

Editing the user questions changes what is replayed; editing the assistant answers changes what is expected. Write expected answers that describe the required content, not exact wording — see Evaluation Best Practices.
A case can be judged on two levels. Each level has its own section in the Properties panel, with an on/off toggle in the section header:
| Section | What it judges | What you configure |
| Step level evaluation | Each answer, against the expected answer of its turn ("Each step is scored against its gold answer"). | Default Threshold, Dimensions and their thresholds, including Token Consumption and Response Time. See Quality Criteria and Thresholds. |
| Conversation level evaluation | The whole conversation, against criteria ("Each criterion is checked against the whole conversation: met, partial or missed"). | The Criteria list. See Conversation Criteria. |
Turn on one level or both. At least one level must stay on: if you try to switch off the only level that is on, Studio shows "At least one evaluation level must stay on. Turn the other level on first to switch this one off." A section that is off is faded and shows Off as its summary. When the conversation level is on, its summary shows the number of criteria, for example 3 criteria.

Which level a case starts with depends on how it was created:
There are no default criteria. While the conversation level is on and the case has no criteria, the criteria list shows the error "Add at least one criterion to evaluate at conversation level." The case can still be saved and run, but its conversation level fails.
Use both levels when you can. The conversation level checks that the conversation reached its goal, whatever path the agent took; the step level checks each answer in detail, and it is the only level that checks token consumption and response time.

To get suggestions, click Ask AI (shown when Studio AI is available). Studio AI reads the case's transcript and proposes three to five criteria. It does not change the case until you answer: approve the list to add it to the case's criteria (existing criteria are kept), ask for changes, or decline.

For how the criteria are judged and how to write good ones, see Conversation Criteria.
Run hooks are Broadway flows that run around a test case: before the conversation is replayed and after it is evaluated. Use them to:
Run hooks require AI Fusion 3.0.9 and AI Fusion Studio 1.0.2. After upgrading AI Fusion, redeploy the aifusion Data Product so that hook results can be stored.

A hook fails when its flow throws an error — for example, an assert actor whose check does not hold, or a flow that cannot be found. The error text becomes the hook's message. A hook passes when its flow completes. A hook does not have to return anything: if the flow has outputs, they are recorded as the hook's output and shown in the results, but they do not affect the verdict. Each hook is reported as passed, failed or skipped.
Every hook flow receives these inputs (flow externals):
A hook flow name is resolved the same way as an agent hook: first in the agent's Data Product, then in the aifusion Data Product. To pin a flow to a specific Data Product, write it as LU__<lu>__<flow> in the before_hooks / after_hooks cell of the suite CSV; the flow picker lists plain names only.
See Run Hooks in the Results for how hook outcomes are shown.
Toggle Disabled in the Eval Editor top bar (or use Enable / Disable in the AI Explorer) to keep a case in the suite without running it, for example while a known issue is being fixed. Disabled cases are skipped by suite runs, and Run Evaluation is not available for them.
Agents that answer relative-date questions ("my bill from last month") get today's date from the current_datetime tool. When a case replays a snapshot captured months ago, today's date no longer matches the data. To pin the date for a case, add a now key to the case's initParams, for example {"customerId":"1","now":"2025-06-01T00:00:00Z"} (a date-only value means midnight UTC).
now is honored only in evaluation runs. The interactive agent endpoints reject it, so you cannot enter it in the New chat dialog; add it to the initParams cell of the suite CSV and deploy the LU.
Next article: Quality Criteria and Thresholds