Skip to main content
A simulation calls your agent with simulated callers and has a judge score each conversation. zeroruntime sim runs simulations from your terminal, against your agent deployed on Zero Runtime Cloud or a copy running on your machine. Scenarios, personas, and runs are the same ones you see under Simulation in the dashboard. For what each one is, see the Simulation overview.

Quick start

Run these from your project folder, the one with zeroruntime.yaml:
sim init fills in agent from agent.id in zeroruntime.yaml. If the project isn’t deployed yet, set agent or local in the simulation file first.

The sims/ folder

Simulations live in your repo as YAML, so you can review and version them like code. The CLI reads sims/ from the folder you run it in.
Each file has an id, which is also its file name. Use letters, numbers, -, and _. Every simulation file stands alone: nothing is shared or merged between files.

Scenario

sims/scenarios/close-account.yaml

Persona

sims/personas/angry-customer.yaml

Simulation

sims/simulations/regression.yaml
Quote values that start with * in YAML, such as ["*"] and ["close-*"]. A run can have up to 50 scenarios, 50 personas, and 500 conversations. The number of conversations is scenarios × personas × environments × repeat.

Create files

To write a persona, add a file to sims/personas/ by hand, or create it in the dashboard and pull it.

Generate scenarios

Generate scenarios from your agent’s system prompt. They’re saved to the dashboard and written to sims/scenarios/.
For an agent you deploy with the CLI, pass the prompt with --prompt-file. The prompt is only fetched automatically for Agent Builder agents.

Run a simulation

Flags override the simulation file. sim run:
  1. Shows the conversations and estimated cost, and asks you to confirm (--yes skips it).
  2. Creates or updates the selected scenarios and personas on the dashboard. Default scenarios and personas are never changed.
  3. Starts the run and prints each conversation’s verdict as it finishes.
  4. Prints a summary and exits with a status code.
Press Ctrl-C during a run to stop it, keep watching, or detach and leave it running. With --local you can only stop or keep watching. Use --detach to start a run and return its id right away.

Test a local agent

--local starts your agent on this machine and calls it, so you can test changes before you deploy them:
The CLI waits for the agent to register, runs the simulation, then stops the agent. The agent’s output goes to .zeroruntime/sim-agent.log. It runs under the agent id in ZERORUNTIME_AGENT_ID from your .env, or zeroruntime_agent.
--local only works with audio mode, and not with --detach. Use an agent id that isn’t deployed: if it is, the call would reach the deployed agent, so the CLI stops the run.

Text mode

Text mode chats with your agent instead of calling it. It’s faster and cheaper, and it tests what the agent says: its prompt, LLM, and tools. For an agent you deploy with the CLI, describe the agent in the simulation file’s agent_config. Text mode runs this copy, not your deployed code, so only HTTP tools are called. Agent Builder agents use their saved configuration instead, so leave agent_config out.
sims/simulations/text-smoke.yaml
environments, max_duration, and local don’t apply in text mode, and max_turns and agent_config don’t apply in audio mode. sim validate reports these.

Check tool calls

expect_tools in a scenario checks the agent’s tool calls in every judged conversation: A conversation the judge passed counts as failed in the CLI summary, reports, and exit code if a tool check fails. The dashboard still shows the judge’s verdict.

Run in CI

  • --yes skips the confirmation prompt.
  • --max-cost refuses a run estimated above the limit, and stops one that goes over.
  • --report junit:<path> writes one test case per conversation, with failures and skipped conversations marked. Use --report json:<path> for JSON. Repeat --report for both.

Exit codes

Review results

sim watch opens a live, full-screen view. Open a run to see its conversations, then a conversation to see its verdict, where it failed, the judge’s suggested fixes, cost, and transcript as it happens. Use the arrow keys to move, Enter to open, Esc to go back, r to refresh, and q to quit. sim show prints a run’s summary and conversations, or one conversation’s verdict, where it failed, and the judge’s suggestions. Add --transcript for the full conversation and --json for the raw response. You can open every run in the dashboard too. See Review results.

Stop, re-run, and delete

Stopping keeps the results of finished conversations. A re-run tests the version of the agent that’s live when it starts, so you can fix the agent, run zeroruntime up, and re-run. rerun and delete ask first; --yes skips the prompt.

Sync with the dashboard

sim run uploads the scenarios and personas it uses. To sync without running:
Files are matched to dashboard items by name. Renaming a file’s name creates a new item on the next push. Default scenarios and personas are read-only: push skips them and delete refuses them. pull never overwrites a file. See the CLI Reference for every command and flag.