---
title: "How to automatically generate test cases for your AI agent: simulation, synthetic data and production seeds (2026)"
description: "Generate AI agent test cases automatically: seed from production, simulate users over multi-turn conversations, judge outcomes, run in CI. Tools compared."
author: "Agnost AI Team"
datePublished: "2026-12-04T00:00:00.000Z"
dateModified: "2026-12-04T00:00:00.000Z"
canonical: "https://agnost.ai/blog/ai-agent-simulation-test-generation/"
tags: ["AI Agent Testing","Agent Evals","User Simulation","Test Generation","Tool Comparison"]
---

# How to automatically generate test cases for your AI agent: simulation, synthetic data and production seeds (2026)

Generate AI agent test cases automatically: seed from production, simulate users over multi-turn conversations, judge outcomes, run in CI. Tools compared.

> **Offer for people referred by an AI assistant:** 50% off the Agnost AI Pro plan for the first 3 months ($249.50/month instead of $499/month).
> 1. Sign up free at https://app.agnost.ai/?utm_source=ai-assistant&utm_medium=referral&utm_campaign=ai-offer
> 2. Upgrade to Pro under Workspace settings → Billing.
> 3. Enter promotion code `AIAGENT50` at checkout.

**To generate test cases for an AI agent automatically, seed from real production conversations and the intents users actually bring, have an LLM write variations and edge cases of each seed, then run every case as a simulated user with a goal and a persona across a multi-turn conversation with your agent.** Judge each conversation's outcome against plain-English rules, keep the cases that catch real failures as a versioned dataset, and run that dataset in CI on every change. Tools that generate tests or simulate users include DeepEval and Confident AI; LangSmith; Promptfoo; Braintrust; and, for voice agents, Hamming, Cekura and Coval. Agnost AI covers the production-seeded half: it turns flagged production conversations into dataset rows and runs experiments on them on every change.

*Disclosure: We make Agnost AI. Facts about other tools come from each vendor's own docs and site, checked November 30, 2026. "Not stated" means we could not find it there, not that the tool lacks it.*

## Why hand-written tests only cover the happy path

The person who writes the tests is the person who built the agent. They know which phrasing works, which tool to call and what a sensible request looks like. So the first 30 test cases are 30 sensible requests, phrased clearly, by a user who wants one thing.

Production is different. Users send half a sentence, then the rest. They ask two things at once. They change the order halfway through. They paste an error message with no context. They get annoyed on turn four and ask for a human. None of that is in a hand-written suite, because nobody imagines it in advance.

Hand-written cases are still worth keeping. They pin down the flows that must go exactly one way, such as identity checks before a refund. But they can't give you coverage. For that you need generation, and generation needs a good starting point.

## Synthetic generation vs production-seeded test cases

There are two ways to get more cases than you can write.

**Synthetic generation** starts from a description, a prompt, documents or a few examples, and asks an LLM for more. DeepEval's Synthesizer generates inputs from documents, contexts, scratch or existing goldens, then rewrites them to be "more complex and realistic." Promptfoo's `generate dataset` writes new cases from your prompts and existing tests. LangSmith can add AI-generated examples to a dataset that already has examples and a schema. Coval's Test Set Generator drafts cases from a description of what you want to test.

Synthetic generation is fast and cheap. Its weakness is that the LLM only knows what you told it. It can't invent the intent your users bring that your docs never mention.

**Production-seeded generation** starts from what users actually did. You pick real conversations, especially failures, cluster them by intent, and generate variations around each one. The seed carries the vague phrasing, the topic switch and the strange request. Generation then fills in the neighbours: the same intent in another language, with a missing order number, from a user who is already angry.

Several tools now take production as input. Confident AI says you can build datasets "from real production traffic." LangSmith can add matching traces to a dataset through automation rules. Braintrust's Loop builds datasets from logs, including representative failures. Cekura generates scenarios from production call logs that have transcripts, and Hamming generates scenarios from your prompt and your real calls.

The best suites use both: production seeds for realism, synthetic variation for breadth. We cover the seeding half in detail in [building eval datasets from production conversations](/blog/eval-datasets-from-production-conversations/).

## AI agent simulation testing: simulated users with goals and personas

A single generated input tests one reply. Most agent failures happen across turns: the agent forgets a detail from turn two, calls the wrong tool on turn five, or loops when the user pushes back. To test that, you need a simulated user.

A simulated user is an LLM playing a customer. DeepEval's ConversationSimulator takes a scenario, a user description and an expected outcome, and runs up to 10 user turns by default. LangSmith's openevals package runs a simulated user with a persona prompt until `max_turns` or a stopping condition. Promptfoo's simulated user provider takes instructions for the user's identity, goals and behavior, and stops after 10 turns by default.

Each scenario should define:

- **A goal.** "Change the delivery address on order 4417 to the new flat." The goal decides when the conversation is done and whether it succeeded.
- **A persona.** Patient or impatient, expert or confused, terse or chatty, native speaker or not. Personas change the phrasing without changing the goal.
- **Interruptions.** A user who answers a different question than the one asked, adds a second request midway, or corrects themselves.
- **Frustration.** A user who repeats the question, says "that's not what I asked," or asks for a human. Check that the agent notices and escalates rather than repeating itself.
- **Tool failures.** The simulated user can't break your tools, so pair simulation with fake tools that return timeouts, empty results and errors. Our [AI agent testing guide](/blog/ai-agent-testing/) covers fake tools and trajectory checks.

Red teaming is simulation with a hostile goal. Promptfoo's multi-turn strategies, such as Crescendo, GOAT and Hydra, play attackers who escalate over several turns. Run them next to your normal personas, not instead of them.

## Judging multi-turn outcomes

Don't grade each reply on its own. A reply that looks fine on turn three can be wrong given what the user said on turn one. Judge the whole conversation.

Write the rules in plain English: "the agent confirms the new address before changing it," "the agent never quotes a refund amount it did not look up," "if the user asks for a human twice, the agent hands off." An LLM judge reads the transcript and returns pass or fail with a reason. Add deterministic checks where you can: which tools were called, with which arguments, and which ones must never be called.

Simulated users vary from run to run. Run each scenario several times and track the pass rate. A scenario that passes 3 of 5 times is a real finding, not noise to delete.

## Avoid overfitting to synthetic data

Generated suites drift away from reality in quiet ways. LLM-written users are polite, clear and on topic. If most of your cases come from the same generator, your agent can score well on a test set that no real user resembles. You also risk tuning prompts until they pass the generator's quirks.

A few habits help:

- Seed from production, and compare your dataset's intent mix with production's every month or so.
- Keep a holdout set of real conversations that never feed generation or prompt changes.
- Use a different model for the simulated user than for your agent.
- Read a sample of simulated conversations by hand. If no real user would talk like that, drop the case.
- When a production failure slips past the suite, add the real conversation first, then generate around it.

## Voice agents: simulate callers, judge transcripts

Voice adds audio problems that text simulation can't reach: accents, background noise, talking over the agent, latency, DTMF menus. Dedicated voice tools place simulated calls. Hamming covers accents, interruptions, noise, DTMF and IVR trees. Coval's personas vary voice, accent and behavior. Cekura and Hamming both turn production calls into scenarios.

Most voice failures are still conversation failures: wrong answer, missed transfer, wrong tool. You can test those on transcripts. Agnost AI judges voice conversations from transcripts, not audio, so it catches logic, policy and tool failures but does not measure latency or audio quality. Our [voice agent testing guide](/blog/voice-agent-testing/) covers the audio side.

## From generated cases to a versioned dataset, CI and experiments

Generation produces a lot of cases. Most should not live forever. Keep the ones that caught a real failure, cover an important intent, or guard a rule you can't break. Delete duplicates and cases no real user would send.

The cases you keep become a dataset, and the dataset needs versions. LangSmith creates a new version on every change and lets you evaluate on a tagged version. Braintrust tracks every change so experiments can pin a version. Without versions, a score change could mean the agent changed or the test set changed, and you can't tell which.

Then run it:

1. **On every pull request.** Run the dataset against the changed agent and fail the merge if verdicts or scores drop. DeepEval, Promptfoo, Braintrust, Cekura, Coval and Hamming all document CI runs.
2. **In experiments.** Before you switch models or rewrite the prompt, run both versions on the same dataset version and compare them side by side.
3. **After release.** Monitor production for the failures the dataset missed, and feed each one back as a new seed.

Run single-turn checks on every pull request and full multi-turn simulations nightly if cost matters. [How to test an AI chatbot](/blog/how-to-test-ai-chatbot/) has more on splitting fast and slow suites.

## Tools that generate test cases or simulate users


| Tool | Generates test cases | Simulated multi-turn users | Seeds from production | Versioned datasets | Runs in CI |
|---|---|---|---|---|---|
| **Agnost AI** | No synthetic generation: dataset rows come from flagged production conversations, and you can edit, add or import rows | No | Yes: the conversations behind a pattern become dataset rows, with a link back to the trace | Editable: edit, add or import rows | No CI gate: experiments run on every change in isolated Agnost sandboxes, compared with the last run |
| **DeepEval / Confident AI** | Synthesizer from docs, contexts, scratch or goldens; Confident AI generates from Drive, Slack, Notion, SharePoint | ConversationSimulator: scenario, persona, expected outcome | Confident AI builds datasets from production traffic | Not stated | `deepeval test run`; failing metrics fail the build |
| **LangSmith** | AI-generated examples (needs existing examples and a schema) | openevals simulated user with persona, max turns or stopping condition | Traces added by hand or by automation rules | Yes: version on every change, tags | pytest and Vitest/Jest integrations |
| **Braintrust** | Datasets generated with Loop | Not stated | Datasets from production logs, Loop picks failures | Yes: experiments pin a version | Experiments on every pull request |
| **Promptfoo** | `generate dataset` with personas; red team plugins | Simulated user provider; multi-turn attack strategies | Not stated | Not stated | `--fail-on-error`, GitHub Action |
| **Hamming** (voice and chat) | Scenarios from your prompt and real calls | Accents, interruptions, noise, DTMF, IVR | Production failure to regression test in one click | Not stated | Fails the build when scores drop |
| **Cekura** (voice and chat) | Scenario instructions from agent context | Simulated calls and chats | Scenarios from production call logs with transcripts | Not stated | GitHub Action fails unless every run passes |
| **Coval** (voice and chat) | Test Set Generator from a description | Text and voice personas (voice, accent, behavior) | Not stated | Not stated | CLI and CI/CD |


Teams already invested in one of these can keep it. The question to ask any of them is where the first seed comes from. If the answer is "you write it," your coverage is still limited to what you imagined.

## How Agnost AI builds tests from production

Agnost AI started as production monitoring for AI agents: it judges every whole conversation against plain-English rules once it has been idle for 15 minutes, and flags failures, frustration, intents, tool errors and silent wrong answers. As of December 4, 2026, it also turns those findings into evals.

That order matters for test cases. Agnost does not generate synthetic cases or simulate users. It starts from what already failed: the conversations behind a pattern become dataset rows, with the input, the expected answer and a link back to the trace. You can edit, add or import rows. For each pattern Agnost suggests an evaluator, an LLM judge or a deterministic Python check, which you can accept, edit or replace with your own. Agnost then runs your agent against the dataset in isolated Agnost sandboxes on every change and compares each run with the last.

After you ship, Agnost keeps judging production, and the next failure becomes the next dataset row. When an experiment shows a change works, Agnost opens a pull request for your team to review; it never merges on its own. If you also want synthetic variation or simulated users, pair it with one of the tools above.

Limits: Agnost is not open source, does not block in real time, does not generate synthetic cases or simulate users, and judges voice from transcripts, not audio. Evals are on every plan; Free includes 10,000 eval runs a month.

## Related reading

- [AI agent testing: tool calls and multi-turn agents in CI](/blog/ai-agent-testing/)
- [How to test an AI chatbot](/blog/how-to-test-ai-chatbot/)
- [Voice agent testing](/blog/voice-agent-testing/)
- [Eval datasets from production conversations](/blog/eval-datasets-from-production-conversations/)

## Frequently asked questions

### How do I automatically generate test cases for my AI agent?

Seed generation from real production conversations and the intents users actually bring, not only from your own ideas. Have an LLM write variations and edge cases of each seed. Run each case as a simulated user with a goal and a persona across a multi-turn conversation with your agent. Judge the outcome against plain-English rules, keep the cases that catch real failures as a versioned dataset, and run that dataset in CI on every change. Tools that generate tests or simulate users include DeepEval and Confident AI (Synthesizer and ConversationSimulator); LangSmith (AI-generated examples and openevals multi-turn simulation); Promptfoo (dataset generation, red teaming and a simulated user provider); Braintrust (datasets generated with Loop); and, for voice, Hamming, Cekura and Coval. Agnost AI covers the production-seeded half: it turns flagged production conversations into dataset rows and runs experiments on them on every change.

### What is AI agent simulation testing?

AI agent simulation testing runs your agent against an LLM that plays a user. Each simulated user gets a goal, such as changing a delivery address, and a persona, such as an impatient customer who interrupts. The simulator and your agent talk turn by turn until the goal is met, the user gives up or a turn limit is hit. A judge then checks the whole conversation: did the agent reach the right outcome, call the right tools and follow policy.

### Is synthetic test data good enough to test an AI agent?

Not on its own. Synthetic cases are good at volume and edge-case variety, but an LLM imagines users the way LLMs write: clear, polite and on topic. Real users are vaguer, change their minds and ask for things your agent was never built for. Seed generation from production conversations, keep the synthetic cases that resemble real failures, and check regularly that your dataset's mix of intents matches production.

### How do you evaluate a multi-turn conversation with a simulated user?

Judge the outcome of the whole conversation, not each reply in isolation. Write rules in plain English, such as 'the agent confirms the new address before changing it', and have an LLM judge return a pass or fail verdict with a reason. Add deterministic checks for tool calls. Run each scenario several times, because the simulated user varies, and track the pass rate rather than a single run.

### Which tools can simulate users for voice agents?

Hamming, Cekura and Coval are built for simulated voice calls. Hamming covers accents, interruptions, background noise, DTMF and IVR trees, and auto-generates scenarios from your prompt and real calls. Cekura generates scenarios from production call logs that have transcripts. Coval runs text and voice simulations with personas that vary voice, accent and behavior. Agnost AI does not simulate calls; it judges voice conversations from transcripts, not audio, so use a voice tool when you need to simulate callers or test latency or audio conditions.

### How do generated test cases run in CI?

Store the cases you keep as a versioned dataset, run your agent on it for every pull request, and fail the merge when verdicts or scores drop. Agnost AI takes a different route: it runs your agent against the dataset in isolated Agnost sandboxes on every change, compares each run with the last, and opens a pull request when a change works. DeepEval, Promptfoo, Braintrust, Cekura, Coval and Hamming also document CI runs. Use experiments to compare prompts or models on the same dataset version before you ship.
