> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.jambonz.org/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.jambonz.org/_mcp/server.

# Simulations

A simulation runs your agent in text. For each scenario, a model plays the caller you described, and the agent
answers with its real prompt, tools and situations. When the conversation ends, a judge scores each of your success
criteria and points to the turn that shows why.

There is no audio and no phone call. Open **Simulations** in the agent's builder.

## What it tests

| Tested                                           | Not tested                                  |
| ------------------------------------------------ | ------------------------------------------- |
| What the agent says and decides                  | Voice, speech recognition and pronunciation |
| Prompt, situations and tool use                  | Timing and latency                          |
| Transfers, knowledge answers and ending the call | Interruptions (barge-in)                    |

Use simulations to check that prompt changes still behave, then use [Testing](/agent-studio/testing) to hear the
agent.

> **Note**
>
> Simulations are not available for Realtime voice API or Connected agent agents; the **Simulations** section is greyed
> out for them. Custom harness agents can be simulated, but you must pick a simulator model because there is no **Same
> as agent** option.

Simulation transcripts are always kept so you can review them, even if the agent doesn't record calls. Each
simulation appears in **Calls** marked **Test**, and **Usage** counts it only with **Include test calls**. The agent's
model and the simulator model run on your own credentials, so those vendors bill the tokens.

## Write a scenario

Click **New scenario** (or **Write one yourself** when the list is empty). A scenario is a simulated caller with a goal
and success criteria.

| Field                                        | What to set                                                                                     |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| **Name**                                     | up to 200 characters                                                                            |
| **Caller**                                   | who the simulated caller is and how they talk, for example "Lan, 45, in a hurry, short answers" |
| **Caller's goal**                            | what the caller wants to get done                                                               |
| **Success criteria (each judged pass/fail)** | one to 20 criteria, each marked **must** or **should**                                          |

Under **Advanced**:

| Field         | What to set                                                                                |
| ------------- | ------------------------------------------------------------------------------------------ |
| **Max turns** | a whole number from 2 to 30; 12 by default                                                 |
| **Variables** | a JSON object the agent receives as call variables, for example `{"customer_name": "Lan"}` |

A **must** criterion decides the verdict: if any Must is not met, the scenario fails. A **should** criterion is
reported but does not fail the scenario.

Click **Save**, or **Save and run** to save and run it at once. An agent can have at most 50 scenarios. At 50,
**New scenario** is disabled with the hint **50 scenarios is the most. Delete one to add another.**

If you close the drawer with unsaved edits, Studio asks **Discard changes?** with **The scenario has edits that aren't
saved.** Choose **Keep editing** or **Discard**.

### Edit, duplicate, delete

Use the row menu on a scenario:

* **Edit** opens the drawer.
* **Duplicate** opens a new scenario with the same content and **(copy)** added to the name. It is saved only when you
  click **Save**.
* **Delete** removes it and shows **Scenario deleted.** with an **Undo**. If the agent has reached 50 scenarios by
  then, the restore fails with **Couldn't restore: this agent already has 50 scenarios.**

Editors and above can change scenarios and start runs. Viewers see the results only.

## Suggest scenarios

Studio can write scenarios for you. Click **Suggest scenarios** (or **Suggest more** below the list). It reads:

* the agent's prompt text
* the parts of the agent a caller can exercise: situations, tools (HTTP and MCP), transfer, applications, knowledge
  and ending the call
* the scenarios that already exist, so it doesn't repeat them

It adds up to 12 scenarios per click, marked **Suggested**, and never goes past 50. Suggest also lists up to 10
rules it finds in the prompt, things the agent is told to do or never do that a caller can test. Reading can take a
couple of minutes.

Suggest always tries these common situations too:

| Situation                          |                                                       |
| ---------------------------------- | ----------------------------------------------------- |
| **Everyday request**               | The most common, ordinary reason to call.             |
| **Off-topic question**             | A caller asks about something the agent is not for.   |
| **Difficult caller**               | Impatient, vague, interrupting or upset.              |
| **Asks for a person**              | The caller wants a human.                             |
| **Asks for something not offered** | A caller asks for something the agent does not offer. |
| **Changes their mind**             | The caller changes their mind mid-call.               |
| **Leaves out a detail**            | The caller leaves out a detail the agent needs.       |

### The coverage banner

After Suggest runs, a banner shows what your scenarios cover:

* **Scenarios cover N of M parts of this agent. Not covered: …** or **Every part of this agent has a scenario (M of M).**
* **Prompt rules covered: …** or **Prompt rules not covered yet: …**
* **Common situations covered: …** or **Common situations not covered yet: …**
* a note when something was skipped: **Too many to check** (parts or older scenarios left out), or **Only the first
  part of a long prompt was checked for prompt rules.**

When something is not covered, **Suggest more** in the banner writes scenarios for the gaps. The banner comes back
when you return to the page, until you change the agent's parts, its prompt or a scenario.

Suggest skips an agent that only presses keys: **This agent only presses keys, so simulations can't talk to it.**

### When Suggest is available

Suggest needs Tuning turned on for your account (the owner does this in **Settings > Tuning > Turn on Tuning**) and an
Anthropic key added there. Suggest uses that key, so Anthropic bills those tokens to you.

* Without the key, the owner sees **Add one in Settings**; other members see that the workspace owner needs to add an
  Anthropic key.
* On a Studio where Tuning is not offered at all, the page says **Suggested scenarios aren't available on this
  Studio.**

You can always write scenarios yourself.

## Run

Click **Run all**, or **Run** on one scenario. The draft is saved first, so the run uses what you see in the builder.

The **Simulator model** button sets the model that plays the caller and judges the criteria. It starts as the model
of the last run, or **Same as agent**; choose **Choose a different model** to pick another credential and model. Except for Custom harness agents, the agent needs a model in
**Model & voice** first.

| Status                  | Meaning                                                            |
| ----------------------- | ------------------------------------------------------------------ |
| **Not run yet**         | The scenario has no result yet.                                    |
| **Queued**              | Waiting to start. One simulation runs at a time in this workspace. |
| **Running**             | The conversation is in progress.                                   |
| **Passed** / **Failed** | The judge scored it.                                               |
| **Couldn't run**        | No verdict (see below).                                            |
| **Cancelled**           | The run was cancelled before the scenario finished.                |

An agent has one open run at a time. Starting another shows **A run is already in progress for this agent. Wait for it
or cancel it.** Click **Cancel run** to stop: queued and running scenarios are cancelled; finished results are kept.

If a run stops unexpectedly the page says **This run stopped unexpectedly. Finished results are kept.** with **Run
again**.

## Read the results

Each row shows its last result and the version it ran on, for example **draft · 5 min ago**.
The **Last result** column reads like:

* **All N criteria passed**
* **N of M criteria met · K Should missed**: passed, but some Shoulds were missed
* **N of M criteria failed**
* the number of turns, and a **was Failed on v17** note when the verdict changed since the previous decided run

Above the table, **Last run** shows the totals: **N passed · N failed · N couldn't run**.

Click a row to open the result drawer:

* **Criteria**: each one with a check or cross, **Must** or **Should**, the judge's reason and **Go to turn N**, which
  scrolls to the turn that is the evidence. A pass that missed Shoulds says **Passed: every Must was met.** and how many
  Shoulds were missed.
* **Transcript**: every turn, with tool calls and events.
* **Run again** (**Retry** when it couldn't run).

### When a scenario couldn't run

**Couldn't run** is never counted as Failed. The drawer says why:

| Reason                 | What the page says                                                                                                             |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Agent silent           | The agent didn't reply. Check its model and credential in Model & voice.                                                       |
| Agent error            | The agent's model returned an error mid-conversation, so there is no verdict. Check its model and credential in Model & voice. |
| Simulator model failed | The simulator model failed: the vendor's message. Pick another model above and retry.                                          |
| Judge                  | The conversation finished but the judge returned no verdict. The transcript is kept; run again.                                |
| Time limit             | Stopped at the 10-minute limit. Lower Max turns or tighten the caller's goal.                                                  |
| Ended                  | The call was ended from outside the simulation before it finished, so there is no verdict. Retry.                              |
| Scenario deleted       | This scenario was deleted while the run was going, so it was skipped. Retry to run it now.                                     |
| Run error              | The run stopped unexpectedly before this scenario finished. Retry.                                                             |
| Stalled                | The run stalled on our side before this scenario finished, so there is no verdict. Retry.                                      |
| Session lost           | The session stopped responding mid-conversation. Retry; if it repeats, check this agent's jambonz connection.                  |
| Session failed         | jambonz couldn't start the session, with jambonz's reason. Check this agent's jambonz connection, then retry.                  |
| Other                  | Something went wrong on our side. Retry; if it repeats, contact support.                                                       |

## Tools and webhooks during a simulation

Tools run for real during a simulation. A tool that books, charges or sends will do it. Studio marks every request so
your server can skip side effects. The value is the scenario's id.

| Where          | How the flag appears                      |
| -------------- | ----------------------------------------- |
| HTTP tools     | the `X-Studio-Simulation` request header  |
| MCP tools      | `simulation` inside the request's `_meta` |
| Event webhooks | a `simulation` field in the JSON body     |

The header is not part of the signed headers. The `simulation` field in a webhook is inside the signed body. Real
calls never carry the flag.

## Requirements

* Your jambonz must be a release that supports text simulation sessions. If it is too old, the result says **jambonz
  rejected the session (400). This usually means that jambonz is too old to run simulations; ask whoever runs it to
  upgrade its api-server and feature-server. If it is up to date, check this agent's jambonz connection, then
  retry.**
* The agent needs an LLM model in **Model & voice** (Custom harness agents: choose a simulator model).
* The draft must have no blocking issues, the same as a test call.

## Next

* [Testing](/agent-studio/testing): call the agent from your browser or phone
* [Webhooks](/agent-studio/webhooks): the event payloads your server receives