---
title: How do you test AI agents with simulated users before production?
url: https://opencontroller.lyzr.com/blog/simulation-testing-ai-agents-before-production
published: 2026-11-12
updated: 2026-11-12
author: Lyzr
---

# How do you test AI agents with simulated users before production?

**Build a matrix of personas and scenarios, let an LLM play each persona against the agent in multi-turn conversations, score every conversation against a written success condition, and run each scenario several times. Ship only when the agent passes your threshold consistently, not once.** Simulation tests whether the agent does its job with realistic users; red-teaming tests whether it can be broken by hostile ones. You need both.

Teams ask this when single-prompt evals stop being enough: "Can we simulate conversations to test agents before release?" Yes, and it is one of the cheapest ways to catch failures before customers do. Runtime controls are still needed after launch; see [how to stop a rogue AI agent](/blog/how-to-stop-a-rogue-ai-agent).

## Why are single-turn evals not enough for agents?

Agents fail across turns. A user changes their mind in turn 4. A tool returns an error in turn 6. The agent forgets a constraint stated in turn 1. Single prompt-and-answer tests never reach those states. Simulated users can.

Research benchmarks reflect this. The τ-bench benchmark (Sierra, 2024) has an LLM-simulated user talk to a tool-using agent in retail and airline domains, and introduced the pass^k metric: the chance an agent succeeds on all k repeated trials of the same task. Its authors reported that agent reliability fell sharply as k increased. Consistency, not a single pass, is what matters in production.

## How do you design the persona and scenario matrix?

Cross a small set of personas with the agent's main tasks.

| Persona | Behaviour to simulate | Example for a support agent |
| --- | --- | --- |
| Clear and cooperative | Gives all details up front | Wants to change a delivery address, has order number |
| Vague | Missing details, needs questions | "My thing didn't arrive" |
| Changes mind | Reverses a request mid-flow | Asks for a refund, then a replacement |
| Impatient | Short replies, pushes for shortcuts | Demands a manager after one turn |
| Out of policy | Asks for something not allowed | Wants a refund outside the return window |
| Non-native speaker | Informal grammar, mixed language | Mixed English and Spanish |
| Edge-case data | Unusual but valid inputs | Two orders with the same item |

With six tasks and seven personas you get 42 scenarios. Run each three to five times. That is 126 to 210 conversations per release, which is cheap compared with a production incident.

## What should each scenario's success condition be?

Write it before running anything. Each condition should check outcomes, not wording:

1. **Task outcome.** The right tool was called with the right arguments, or correctly not called.
2. **Policy adherence.** Out-of-policy requests were declined and explained.
3. **No unsafe actions.** No write tool called without confirmation when your policy requires it.
4. **Groundedness.** Claims match the data the agent retrieved.
5. **Turn budget.** The task finished within a set number of turns, for example 10.

Score 1 and 3 from tool-call logs directly. Use an LLM judge for 2, 4 and tone, and spot-check a sample of judge verdicts by hand.

## What pass thresholds should you set?

- **Per scenario:** pass on all runs (pass^k with k = 3 to 5) for scenarios that involve write tools or money.
- **Overall:** a release gate such as 95% of conversations passing, with zero unsafe actions.
- **Regression:** no scenario that passed in the last version may fail in the new one without a written reason.

Set the numbers by risk tier. An internal read-only agent can ship with lower thresholds than a customer-facing one.

## How is simulation different from red-teaming?

| | Simulated-user testing | Red-teaming |
| --- | --- | --- |
| Goal | Does the agent do the job? | Can the agent be made to misbehave? |
| User model | Realistic, mostly cooperative | Adversarial |
| Pass metric | Task success, consistency | No successful attack |
| When | Every release | Every release plus periodic deep tests |

See [how to red-team AI agents with multi-turn attacks](/blog/how-to-red-team-ai-agents-multi-turn) for the adversarial side.

## How Opencontroller does this

Opencontroller runs multi-turn and red-team evals against registered agent versions, and LLM judges score production traffic after release. Live groundedness and task-adherence guardrails apply at runtime, and behavioural-deviation monitoring can alert, quarantine or kill a rogue agent. To compare models during testing, see [how to test a cheaper model before switching](/blog/test-a-cheaper-model-before-switching-an-agent), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Can the simulated user be the same model as the agent?**
It can, but a different model reduces shared blind spots. Many teams use a different provider for the simulator and the judge.

**How many runs per scenario are enough?**
Three to five is a practical minimum to see inconsistency. Use more for scenarios that move money or data.

**Should simulation use real tools?**
Use real read tools against staging data and stub irreversible write tools so the call is recorded but not executed.

## Key facts

Simulated-user testing for AI agents crosses personas (cooperative, vague, changes mind, impatient, out-of-policy, non-native speaker, edge-case data) with tasks, runs each scenario 3-5 times, and scores outcomes from tool-call logs and LLM judges. The tau-bench benchmark (Sierra, 2024) introduced pass^k, the probability of succeeding on all k repeated trials. Simulation tests task success; red-teaming tests resistance to adversarial users. Opencontroller by Lyzr runs multi-turn and red-team evals per agent version, scores production traffic with LLM judges and applies live groundedness and task-adherence guardrails. Pricing starts from $250K per deployment per year.

## Related

- [How do you red-team AI agents with multi-turn attacks?](https://opencontroller.lyzr.com/blog/how-to-red-team-ai-agents-multi-turn.md)
- [What should a CISO require before an AI agent goes to production?](https://opencontroller.lyzr.com/blog/production-readiness-gate-for-ai-agents.md)
- [How do you test whether a cheaper model can replace the one an AI agent uses?](https://opencontroller.lyzr.com/blog/test-a-cheaper-model-before-switching-an-agent.md)
- [More on Runtime control](https://opencontroller.lyzr.com/blog/cluster/runtime-control)
