> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usetuner.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Test your agent before every change

> A testing workflow for voice agents: what to test before launch, how to build a regression suite, what to rerun after every change, and how production failures become tests.

<Info>
  Testing in Tuner happens under **Simulations**. You need a plan with Call Simulation and an agent set up for [inbound](/docs/simulation/inbound/setup) or [outbound](/docs/simulation/outbound) simulation. Replays of Dataset calls need an inbound agent.
</Info>

This guide ties together [generated runs](/docs/simulation/run-a-simulation), the [Scenario Library](/docs/simulation/scenarios) and [replays](/docs/simulation/replays) of [Dataset](/docs/datasets/overview) calls. It covers four stages: before launch, building a regression suite, after every change, and turning production failures into tests. For the production side, see [Best practices for agent monitoring](/docs/guides/agent-monitoring).

## Which tool for which question

| Question | Tool | Why |
| - | - | - |
| Where does my agent break that I haven't seen yet? | Generated run (**AI generated** Scenarios) | Tuner writes new Scenarios each run: Routine callers from your Intents, Pressure tests from your Pass/Fail evals. |
| Did this change break something that used to work? | Scenario Library (a Regression Run) | You rerun the same saved Scenarios. Each one keeps a **Run history**. |
| Does my fix work on the exact call that failed? | Replay of a Dataset call | The caller is the real recorded audio, identical on every run. |
| Is a new model or provider better on my callers? | Replay of a Dataset call | Same calls and same scoring on both setups, with latency measured on every run. See [Benchmarking](/docs/datasets/use-cases/benchmarking). |
| Does my agent hold up with an accent, a language or noise I have no recordings of? | Generated run or Scenario Library | You choose the language, accent, background noise and test profile on every run. Replays use whatever the real call had. |
| Does the conversation branch correctly on my agent's answers? | Generated run or Scenario Library | The Simulated Caller reacts to your agent. In a replay, [the caller doesn't adapt](/docs/datasets/use-cases/capturing-failures#the-caller-doesnt-adapt). |

## Before launch

Simulation grades calls on your **Pass/Fail** evals, so set those up first. Pressure tests are generated from them, the Scenario Library needs at least one, and a replay without any only measures latency.

* **Add Pass/Fail evals** in **Agent Settings > Evaluation Rules**. New agents start with **Hallucination**, **Prompt injection resistance** and **Politeness**. Add the tool-call evals if your agent uses tools, and [custom evals](/docs/evaluation/custom-evals) for your business rules. Score (1 to 5) evals don't decide a call's result.
* **Set up your Intents**, since Routine callers are generated from them. See [Call classification](/docs/evaluation/call-classification).
* **Create [test profiles](/docs/simulation/test-profiles)** for the data your agent needs from a caller, such as a name, an account detail or an appointment date. Without a profile, the Simulated Caller has no caller-specific context.
* **Run a generated simulation** with a mix of Routine callers and Pressure tests. The default is 10 calls with 30% Pressure tests. Read the failures, fix your agent, and run again.
* **Match your callers' conditions.** Set **Language:** to the languages and accents your callers use, and **Environment:** to the noise they call from (**Café**, **Office**, **Street** or **Car**, at **Low**, **Medium** or **High**). Each setting applies to the whole run, so run once per condition you care about.
* **Narrow the targets** with **Narrow down ›** when you change one Intent or one eval, so the run spends its calls there.
* **Upload recordings you already have** (inbound agents). If you have real calls from another system, [upload them](/docs/datasets/add-calls#add-a-call) to your Dataset and replay them before your agent takes a call in Tuner.

## Build a regression suite

Your suite is two sets: Scenarios in the Scenario Library and calls in your Dataset. Add to both every time something fails.

* **Save the Scenarios that caught a failure.** On the **Runs** tab, expand the run, tick the calls and click **Save to library**. The call you saved from becomes the first entry in the Scenario's **Run history**. See [Save to library from a run](/docs/simulation/scenarios#save-to-library-from-a-run).
* **Write Custom Scenarios** for edge cases you know about but haven't seen in a run. For a Pressure Scenario, set a **Target eval** so it passes or fails on that eval alone. See [Write a Custom Scenario](/docs/simulation/scenarios#write-a-custom-scenario).
* **Tag your Scenarios** (for example by Intent or by the eval they target) so you can find the right set for a change.
* **Add real failing calls to your Dataset.** On **Simulations > Dataset**, click **Add call** and pick the call from **Production**. Name it after the problem. See [Capturing failures](/docs/datasets/use-cases/capturing-failures).
* **Add golden calls**: ordinary calls your agent handles well today. They show when a fix for one problem breaks something that used to work.

Saved Scenarios keep the situation, goal, type, Intent and **Target eval**. They don't keep the language, background noise or test profile, so choose those on each rerun.

## After every change

Rerun your suite after a prompt edit, a model swap, a new STT or TTS provider, or a deployment.

<Steps>
  <Step title="Rerun the Scenario Library">
    In **Run Simulation**, click **Change** next to **Scenarios**, choose **From library**, and tick up to 20 Scenarios. Use the same language, noise and test profile as the runs you're comparing with. See [Rerun after every change](/docs/simulation/scenarios#rerun-after-every-change).
  </Step>

  <Step title="Replay your Dataset">
    Go to **Simulations > Replays** and click **New Replay**. Pick the Dataset calls that cover what you changed, and replay each one more than once so you can tell a real change from normal variation. See [Replay a Dataset call](/docs/simulation/replays#replay-a-dataset-call).
  </Step>

  <Step title="Run a generated simulation">
    Generated runs write new Scenarios, so they look for failures your suite doesn't cover yet. Narrow the targets to the Intents or evals you changed.
  </Step>

  <Step title="Compare the runs">
    * **Scenario Library:** on the **Scenarios** tab, **Last result** shows each Scenario's latest result. Open a Scenario to see its **Run history**, for example "Passed 3 of last 5 runs".
    * **Replays:** keep the same calls, repeats, **Max call duration** and **Advanced turn-taking** settings between runs, then compare the run cards and open matching calls. There's no side-by-side view.
  </Step>
</Steps>

Only one simulation run can be in progress per agent at a time, shared by generated runs, library runs and replays. A run whose calls have all ended doesn't block the next one.

When you compare two setups, change one thing at a time so any difference has one cause. See [Compare two setups](/docs/datasets/use-cases/benchmarking#compare-two-setups).

## Turn production failures into tests

When [monitoring](/docs/guides/agent-monitoring) finds a failure, such as a failed eval, a [red flag](/docs/evaluation/red-flags) or a failure outcome, add it to your suite before you fix it.

| What you found | Add it as | How |
| - | - | - |
| A production call that failed on audio, timing or STT (noise, accent, interruptions) | A Dataset call | **Add call** > **Production**, then replay it to reproduce the failure before you change anything. See [From failure to verified fix](/docs/datasets/use-cases/capturing-failures#from-failure-to-verified-fix). |
| A failure that depends on how the conversation goes, or an outbound call | A Custom Scenario | Write the caller's situation from the call in **Situation**, and set the eval that failed as the **Target eval** for a Pressure Scenario. |
| A red flag or eval that keeps failing | A narrowed generated run | Narrow **Pressure tests target:** to that eval, then save the Scenarios that fail to your library. |

Simulation calls don't appear in the **Production** list when you add a Dataset call. To keep a failing simulated call, save its Scenario to the library.

## Read the results

Each call shows one result. What to do depends on which one. See [Run statuses](/docs/simulation/run-statuses) for every status.

| Result | What it means | What to do |
| - | - | - |
| **Passed** | No Pass/Fail eval that decides the result failed. | Nothing. For a Scenario that used to fail, check its **Run history** to confirm the fix held across runs. |
| **Failed** | An eval that decides the result failed, or the call didn't run. | Open the call to see which eval failed and why. Fix your agent, save the Scenario or add the call to your Dataset, and rerun it. |
| **Unreported** | The call ran, but no matching call arrived from your agent within 15 minutes. | This is an integration problem, not an agent failure. Follow [Fix an Unreported run](/docs/simulation/run-statuses#fix-an-unreported-run). |
| **Analysis failed** | The call arrived, but its evals didn't come back within 10 minutes. | Run the Scenario again. If it keeps happening, contact support. See [Fix Analysis failed](/docs/simulation/run-statuses#fix-analysis-failed). |

The Simulated Caller improvises, so the same Scenario can pass once and fail once. Rerun a failing Scenario before you treat it as fixed or broken, and use a replay when you need the exact same caller.

## Limits

| Limit | Value |
| - | - |
| Generated run | 5 to 20 calls, default 10 |
| Scenarios from library per run | 1 to 20, each runs once |
| Replay run | 1 to 10 calls, each 1 to 20 times, at most 20 calls in total |
| Max call duration | 1 to 12 minutes (default 3 for simulation runs) |
| Runs in progress per agent | 1, shared by all simulation runs |

## Next steps

<CardGroup cols={2}>
  <Card title="Scenario Library" icon="books" href="/docs/simulation/scenarios">
    Save Scenarios and rerun them after every change.
  </Card>

  <Card title="Capturing failures" icon="bug" href="/docs/datasets/use-cases/capturing-failures">
    Reproduce the call that failed and prove your fix.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.