Why test a conversational agent with simulated users
A support or booking agent can pass every single-turn test you write and still fail the customer. It answers the first question correctly, then loses track of a changed date, repeats a confirmation step, or calls the wrong function three turns later once the customer corrects a detail. Single-turn evals only see one message and one reply, so they cannot show where a conversation goes wrong. The promptfoo simulated user provider (promptfoo:simulated-user) exists for that gap: it places a simulated user on the other side of the conversation so the agent is tested across the whole exchange.
According to the promptfoo documentation, the provider runs a conversation between your agent and a simulated user, and it works with both text agents and function-calling agents. The approach is inspired by the Tau-bench benchmark, which also evaluates agents through multi-turn interactions with a simulated user. Teams usually need this when the agent's job depends on gathering information over several turns, such as collecting a booking reference, confirming a refund policy, or handling a customer who changes their mind. It is also the right tool when a function-calling agent must reach a correct final state, not just produce a plausible reply at each step.
Before you commit to this approach, confirm three things in your own environment. First, check the simulated user's model and the agent's model in the promptfoo simulated user docs, because both calls go to a model provider and add cost and data flow you will need to document. Second, decide what a successful conversation looks like in your business terms, since the grading has to test that outcome. Third, confirm that your agent exposes the tool calls and final state the grader needs. If your agent cannot be driven through a text or function interface from promptfoo, the test will not reflect production.
Configuration options and when each fits
This table compares the settings a team defines for a simulated user test: the agent under test, the customer goal and persona, the model that plays the customer, the grader that judges the full conversation, the turn limit and the variables that vary scenarios. Read each row as a decision about what the test can prove and what it costs to run. Confirm exact key names in the simulated user documentation before you write configs.
| Setting | When it fits | Trade-off it creates |
|---|---|---|
| Agent provider under test | Point the test at the agent you plan to ship, text or function-calling, so tool calls appear in the transcript | Results reflect only the prompt, model and tools wired in that run, so pin the deployed configuration |
| Simulated user goal | State the outcome the customer wants, such as rebooking a flight, so the conversation has an end state to grade | A vague goal produces loose conversations, while a narrow one may skip the paths real customers take |
| Persona | Add tone, patience or background for cases like a frustrated customer or one who changes plans midway | Richer personas widen coverage but make failures harder to reproduce, so keep a fixed set |
| Simulated user model | Choose a model you can review and rerun, so the customer side stays stable across test runs | Its behavior changes with the model and version, which changes what the agent sees and how results compare over time |
| Whole-conversation grader | Judge the full transcript for outcomes such as a completed booking or no unauthorized action | Model-graded checks add cost and some variance, so confirm the grading options in the docs before relying on them |
| Turn limit | Cap how long a conversation runs so loops end and cost stays bounded | A low limit ends before the goal is reached, and a high limit adds runtime and token spend |
| Test variables | Vary customer details, order IDs or scenario per test row to cover several cases from one config | Each added variable multiplies the number of conversations, so start with a small matrix and expand after review |
Setting up a simulated user test in promptfoo
This sequence takes a team from an empty project to a graded, multi-turn conversation between a simulated user and their agent, with a transcript they can review. Each step ends with a check so problems surface before the suite grows.
Install promptfoo on a supported Node.js version
The engineer installing promptfoo confirms the Node.js runtime first. The npm package for the 0.124.1 release requires Node.js 22.22.0 or newer, so older runtimes on a laptop or CI image need upgrading before anything else. Install the package in a dedicated project folder, then run the version command to confirm the CLI starts. The step is done when the CLI prints a version number without errors and the project has a configuration file to edit in the next steps. Confirm the same runtime version in the CI image that will run these tests later.
Connect the agent under test as a provider
Point promptfoo at the agent you want to test, whether it is a chat endpoint, a function-calling service or a local script. The engineer who owns the agent writes the provider entry in the configuration file and supplies any credentials through environment variables rather than inline values. Send one plain request through the provider to confirm the agent answers and returns the fields promptfoo expects. The step is done when a single test prompt returns a complete response and the tool calls, if the agent makes them, appear in the output. Check the agent's own logs too, so you know the request reached the system you intended.
Write the scenario for the simulated user
Add the simulated user provider to the test configuration and describe the person the agent will talk to. The scenario should state the user's goal, the information they hold, what they will reveal only when asked, and when the conversation should end. Support and booking scenarios work well because they have a clear finish point, such as a confirmed reservation or a closed ticket. Keep the first scenario narrow so a failure points to one behavior. The step is done when a dry run produces a conversation that starts with the user's opening message and stops at the defined end point, not at an arbitrary turn limit.
Define grading for the whole conversation
Write assertions that judge the full transcript, not only the last reply. For a booking agent, this usually means checking that the expected function was called with the right arguments, that the final state matches the user's goal, and that the agent did not invent details such as prices or availability. Decide which checks are deterministic, such as a required tool call, and which need a model-based judgment, and document the grader you chose. The step is done when the assertions are written in one place and each one names the behavior it protects. Ask your security or product owner to review the criteria before the suite is treated as a pass or fail gate.
Run the scenario and confirm the tool calls
Run the test file from the command line and wait for every conversation to finish. Open the results and confirm that the agent called the expected tool in the expected order, with arguments that match the simulated user's stated needs. Compare that record against the agent's own logs, because a tool call that appears in the transcript but not in the backend points to a provider mapping problem. The step is done when the run completes without provider errors and the tool calls in promptfoo match the calls the backend recorded. If they differ, fix the provider wiring before reading any grades.
Review transcripts for completeness and grading accuracy
Open the saved transcripts and read them from the first user message to the final turn. Check that no turn is missing, that the simulated user stayed in character, and that the stop condition fired for the reason you intended. Then compare a few grades against your own judgment, including at least one failing conversation and one passing conversation. The step is done when the reviewer can explain why each sampled conversation passed or failed and the transcript is complete from start to end. Record the adjustments you make to the scenario or assertions so the next reviewer understands the baseline.
Designing scenarios that expose real conversation failures
The simulated user is only as useful as the scenarios behind it. The cards below describe the situations that tend to break support and booking agents over several turns, and why a single-turn test would pass them. Scenario coverage is your team's responsibility, so each card ends with what to check.
Goal-driven customers who change their mind
Give the simulated user a concrete goal, then have it revise that goal mid-conversation, for example switching from a refund to a replacement after the agent offers one. Agents often keep the first instruction in context and act on a stale request. A single-turn test never sees the reversal. Check that the agent confirms the final intent before it takes an action and does not execute the superseded one.
Booking conflicts across turns
Ask for a slot that is already taken, then ask for an alternative that conflicts with an earlier booking in the same session. Failures appear when the agent checks availability once, then books without re-checking after the user adds a constraint. Verify that the agent calls the availability function on each change and reports conflicts instead of silently overwriting an existing reservation.
Missing information
Start the conversation with an incomplete request, such as a booking without a date or a support ticket without an account identifier. The simulated user should withhold details until asked, as a real customer would. Single-turn tests usually supply every field, so they miss agents that guess a value or call a tool with empty parameters. Check that the agent asks for what it needs before any function call.
Policy edge cases
Build users who push against a boundary gradually: a refund request just outside the return window, a fee waiver justified by a loyalty tier they claim to hold, or an exception requested after an earlier refusal. Agents tend to yield after repeated pressure even when the policy has not changed. Grade the whole transcript against the written policy, not only the final answer.
Requests the agent must refuse
Include requests that should be declined at some point in the conversation, such as access to another customer's booking, a discount the user is not entitled to, or a tool action outside the user's role. A refusal in turn one can be undone by a later turn that reframes the request. Check that the refusal holds across the full conversation and that the agent does not perform the action in a later step.
How a simulated conversation is graded end to end
The run starts with a test case that sets the goal and the simulated user's instructions. The simulated user sends a message to the agent under test, which replies in text or makes function calls to its tools. Each exchange is appended to a transcript, and the loop continues until the conversation ends. The whole-conversation grader then reads the full transcript against your assertions and returns a pass or fail. Check that the transcript records every tool call, because the grader can only judge what it can see.
The simulated user, agent, tool calls and grader in one conversation run.
Security and data handling for conversation tests
A simulated user conversation is a full transcript of an agent talking to a persona, and the tool calls behind it can reach systems that hold real records. The cards below cover what those conversations contain, where they end up, and which credentials and backends need controls before the first run.
Persona data can look real
Customer personas are written to sound like actual callers, so they often include names, dates of birth, account numbers or addresses. Those details end up in transcripts, grader prompts and stored results. Ask the team to generate personas from synthetic data sets and to review a sample persona file before any run. Make synthetic personas only the rule for the whole test suite.
Tool calls reach live systems
A booking or account agent that calls functions can change reservations, refunds or profile fields if its tools point at production APIs. The simulated user does not stop those calls. Point every tool at a sandbox backend or a recorded stub, and confirm that no production credentials are present in the test environment's configuration.
Transcripts persist where results go
Conversation transcripts, tool arguments and grader reasoning are written to the results store. Local runs keep them on the engineer's machine, while shared results may send them to a team instance. Decide the retention period and who can open results before the first run, and check whether a shared store is a self-hosted instance with its own access controls.
Simulated user model keys
The simulated user is a model call, so its API key is a credential with spending and data-sharing consequences. Store it in the CI secret manager, scope it to a test project with a spending limit, and rotate it on the same schedule as other service keys. Confirm with the provider which data retention terms apply to that account.
Separate test and production runs
Conversation tests and production traffic should not share an API key, tool backend or results space. Mixing them makes it hard to tell which transcripts came from a test and which from a customer. Give the test pipeline its own environment file and label every run with its target, so a misdirected test cannot reach a customer account.
Review what the grader sees
The grader reads the full conversation, including any personal details the persona disclosed. That text may leave your environment if the grader is a hosted model. Ask which model grades each run, where that provider processes the text, and whether the grader prompt can be trimmed to the fields the rubric needs.
Questions teams ask before testing agents with simulated users
How much effort does it take to build simulated user scenarios?
Most of the effort goes into defining scenarios, not into configuring promptfoo. Each scenario needs a persona with a goal, the information the simulated user knows and withholds, the success condition, and the turn at which the conversation should end. Effort rises with the number of business flows a booking or support agent handles, how many edge cases each flow needs (changed bookings, refunds, unclear identity), and how many people must sign off on what counts as a correct outcome. Teams that already keep written support or booking policies usually spend less time turning them into scenarios.
What drives the cost of running simulated user tests?
Cost comes from model calls, and they multiply. Each conversation turn calls the agent under test, the simulated user model, and the grader, so cost grows with the number of turns per conversation, the number of scenarios, the number of repeats used to account for variation in model output, and the number of models you compare. The promptfoo Community edition is free and includes all LLM evaluation features, so the main recurring cost is your own model usage and the infrastructure that runs the tests. Ask any partner to show the expected number of conversations per run, the average turn count, and which model provider bills each role.
Can an in-house team build and run these tests without a partner?
Yes, if the team has someone comfortable with Node.js, YAML test configuration and the agent's API, and someone who owns the business rules the agent must follow. promptfoo runs locally from the command line, so no server is required for a first suite. The harder parts are usually not technical: agreeing on what a correct booking or resolution looks like, building tool stubs that behave like the real systems, and keeping scenarios current as policies change. A partner is most useful for planning the scenario set, setting up a repeatable run in your pipeline, and reviewing results for gaps your team may not see.
How long does a first working simulated user suite take to set up?
The timeline depends on how quickly four inputs are settled: the agent's entry point, the tools it calls, the scenarios that matter most, and the grading criteria. If the agent exposes a stable API and the business owner can name the top flows in a short session, a first suite can be running sooner. If tool responses must be mocked from scratch, or if policy owners disagree about expected outcomes, the schedule moves out. Ask for a written plan that lists these dependencies and states which ones your team must close before build work starts.
What does the team need to provide for simulated user testing?
Four things are needed before work starts. First, access to the agent under test, either as a local or staging endpoint, with a clear way to start a fresh session for each conversation. Second, tool stubs or sandbox systems for every function the agent can call, so bookings and account changes do not touch production. Third, personas and goals written by people who know your customers, including the information each persona should hold back. Fourth, a named owner for the expected outcomes and grading rules, plus test accounts that match the permissions each role should have.
Do simulated user tests work with function-calling agents?
Yes. The promptfoo simulated user provider works with text agents and with function-calling agents, and it is inspired by the Tau-bench benchmark. For function-calling agents, the important questions are which tool calls are expected at each step, what arguments are acceptable, and how the simulated user should react when the agent asks for something it does not have. Those expectations drive how much of the tool layer must be stubbed and how the whole conversation is graded, rather than only the final reply.
What risks should we check before running these tests against a production-like agent?
The main risk is that a simulated conversation triggers real side effects. Confirm that every tool the agent can call points to a stub or sandbox, that test credentials cannot reach live customer data, and that logs from conversations containing personal data are stored under your retention rules. Also confirm which model providers receive the transcripts, because the simulated user and grader send conversation content to whichever models you configure. Ask for these controls to be written into the test plan.
How DeployOpen scopes simulated user testing
DeployOpen approaches simulated user testing as a scoped engagement: we agree which agent, which conversation paths and which grading criteria are in play before any test is written. We then build the promptfoo setup inside your environment, run it against your agent, and hand over the configuration, results and runbook so your team can keep the suite running.
How we scope
- We agree in writing which agent, channels and conversation types the simulated user tests will cover.
- We confirm the goals of each simulated user, the tools the agent may call, and what counts as a successful booking or resolution.
- We record which conversation outcomes are graded, which are reviewed by people, and what data the simulator and grader may receive.
How we build
- We configure the promptfoo simulated user provider against your agent endpoint, with function-calling tools wired to test or sandboxed backends.
- We write multi-turn test cases and grading rubrics that score the whole conversation, not only the final reply.
- We confirm that test identities, bookings and records are synthetic or isolated, and that runs execute on infrastructure you control.
How we hand over
- You receive the promptfoo configuration, simulated user personas, grading rubrics and test data in your repository.
- You receive a written report of the runs, failing conversations with transcripts, and the fixes or retests agreed in scope.
- You receive a runbook covering how to add personas, rerun suites, interpret grades and connect the suite to your delivery pipeline.
How we support
- Fixed-scope engagements cover the agreed agents, conversation paths and deliverables, with timelines confirmed in writing before work starts.
- Ongoing support, upgrades of promptfoo and continuous conversation testing are available as a retainer.
- Before you sign, ask us to confirm which model providers, grader models and agent frameworks are in scope for your environment.

