# How to test voice AI agents

> Voice agent testing is four layers: one decision, a text conversation, the audio path, and the real calls that supply the next case.

**The short version**

- A decision eval checks one next action, from the transcript text and the state.
- A text simulation is a fake caller, many turns, no audio, and you can run it often.
- An audio simulation sends synthetic speech through the real speech path. It is the layer that can hear a misheard date.
- Real calls do not gate the release. They supply the next case.
- Trust a pass rate only after the uncertainty is narrower than the gap you care about.


## What is voice agent testing?

Voice agent testing checks the next decision, the full chat, the audio path, and real calls.

A voice agent can pass a chat test and still book the wrong day on a phone. The model never heard the caller. It read whatever speech-to-text wrote down. Testing is how you keep those two facts apart: what the caller said, and what the agent did next.

**Short answer.** Test the next action on the transcript first. Then run a text simulation of the whole call. Move a scenario to synthetic audio only when the bug is in hearing, timing, or turn-taking. Turn real-call transcripts into the next case. One green call is not a pass rate.

This is for voice-agent builders and agent engineers who already ship a voice agent. Each layer below says what it can see, what it costs, and when to skip it.

The example is illustrative, not a measured call, and not the contact-update task used elsewhere on this site. The caller says “the fifteenth of March”. The transcript says “the 50th of March”. The agent books 15 March anyway.


## How does voice agent testing work?

Use four layers, and let each layer see only the failures it can see.

The real call comes last, because that is where the missing case shows up.

*A test pyramid. Decision evals check one action. Text simulations check the chat. Audio simulations check the speech path. Real calls supply the next case.*

| Layer | Catches | Misses | Cost | Runs |
| --- | --- | --- | --- | --- |
| Decision eval | Wrong tool or slot on known text | Hearing, timing, a long chat | One model call | Until the pass-rate width is small enough |
| Text simulation | A missed goal across turns | A mishearing, a pause, barge-in | Model calls, no speech bill | Many. Text is the cheap repeat. |
| Audio simulation | Bad transcript, barge-in, slow first audio | Callers you did not synthesise | Real time, plus speech providers | Few. Only bugs text cannot see. |
| Real-call review | A failure nobody scripted | A path that has not happened | Reading time | The calls already stored |

Two published cuts are worth knowing, and neither is a score. [OpenAI’s GPT-Live evaluation guide](https://developers.openai.com/cookbook/examples/audio/voice_agent_evaluation.md) starts with synthetic audio, then a saved recording, then a simulated caller, and it says a transcript-only check misses speech failures. [LangChain’s voice-agent eval guide](https://www.langchain.com/blog/how-to-evaluate-voice-agents-execution-outcomes-and-experience) splits a call into execution, outcome and experience. This page did not run either harness. The pyramid here spends text first.


## What can a decision eval see?

It sees one next action, given the transcript text and the state you pass in.

You freeze one moment. You pass the transcript, the slots already filled, and any tool result already returned. The agent returns one next action. A check says whether that action was allowed. [Vapi’s eval guide](https://docs.vapi.ai/test/evals-best-practices) calls this a mock at the text and model layer. It says the mock does not test voice, the transcriber, audio quality or turn-taking. [LiveKit’s unit tests](https://docs.livekit.io/testing/unit-tests/) are the same shape: one turn, scripted input, an assertion, cheap enough for every commit.

**What it can see.** The model read “50th” and called `book_appointment` with day 15. That is a wrong action on known text. The pass is the opposite: it asks which day, and it does not book. Guessing that “50th” meant the 15th is the bug.

**What it cannot see.** The caller said “fifteenth”. The transcript is an input, not a result, so barge-in, a pause, an accent and noise are invisible. Cost is one model call and a code check, with no speech bill. Skip it for a new recogniser, or for a bug that only shows up after the caller changes their mind. That second case is a simulation.

```yaml
name: misheard-fifteenth
caller_said: "Book a cleaning for the fifteenth of March."
stt_text: "Book a cleaning for the 50th of March."
state:
  intent: book_cleaning
  month: march
  day_in_transcript: 50
expect:
  tool: ask_to_confirm
  must_not_call: book_appointment
note: illustrative, not a recorded call
```

Any call to `book_appointment` fails, whether the day is 15 or 50. `ask_to_confirm` with no day passes. The list in the code is illustrative. This page ran it.

```python
import math

def grade(action):
    booked = action["tool"] == "book_appointment"
    asked = action["tool"] == "ask_to_confirm" and action.get("day") is None
    return (not booked) and asked

def summarise(flags):
    flags = list(flags)
    n, k = len(flags), sum(1 for ok in flags if ok)
    p = k / n
    return k, n, p, 1.96 * math.sqrt(p * (1 - p) / n)

def runs_for(p, half):
    return math.ceil((1.96 ** 2) * p * (1 - p) / (half ** 2))

actions = ["book", "ask", "ask", "book", "ask", "book", "ask", "ask", "book", "ask", "ask"]
mapped = [{"tool": "book_appointment", "day": 15} if a == "book" else {"tool": "ask_to_confirm"} for a in actions]
print(summarise(grade(a) for a in mapped))
print(runs_for(0.5, 0.1))
```

The print is 7 passes in 11 runs, then 97. The arithmetic is in the run-count section. A decision eval is one kind of [eval](https://tryabracadabra.com/blog/what-is-an-eval/): a known case, a pass rule, and a run you can repeat.


## How do you run a text simulation?

A model plays the caller in text, for many turns, and you grade the ending.

You write the caller’s goal and the facts they may reveal. A second model plays the caller. Your agent plays itself, tools included, still in text. [Pipecat’s scenario file](https://docs.pipecat.ai/pipecat/evals/scenario-configuration) stays in text when you set no audio, which the docs call the fastest start. [The overview](https://docs.pipecat.ai/pipecat/evals/overview) says text mode skips speech-to-text and text-to-speech. [LiveKit’s text simulations](https://docs.livekit.io/testing/simulations/) test the model, the tools and the chat, and the docs call text faster and more deterministic than audio.

**What it can see.** The caller says “fifteenth” in text, and the agent books the wrong day, books nothing, or asks and never confirms. It can see a recovery, and it can see a path you did not script, because the caller model picks its own words.

**What it cannot see.** It cannot mishear. The string you hand the caller model is the string the agent gets. Latency, barge-in and a hard accent are out of reach. Cost is a model call per turn, on both sides, and no speech bill. LiveKit’s docs say text does not wait in real time, and audio does. Skip text when you already know the exact wrong tool. Grade the booked day, not the caller’s manners.

Illustrative text, not a log. The caller says “Book a cleaning for the fifteenth of March”, and the agent replies “Booked for 15 March”. That ending can pass in text and still be the phone bug, because the phone never delivered “fifteenth”.


## How do audio simulations work?

Synthetic speech goes through the real speech-to-text, model, and speech path.

A text-to-speech voice speaks the caller’s lines into the same speech-to-text, turn-taking, model and speech path a phone call uses. LiveKit’s audio mode scores turn-taking, interruption handling, and transcription of numbers, names, addresses and codes. The same page says an audio run is real time, calls your speech providers, and costs more than text. [Vapi’s voice-testing guide](https://docs.vapi.ai/test/voice-testing) says to rerun important scenarios in voice for transcription, pacing and turn-taking, and that one pass is not proof.

**What it can see.** You speak “fifteenth”. The transcript comes back “50th”, “15th” or “50”, and you see whether the agent books, asks, or reads the wrong day back. You see barge-in, and you see the gap before the first audio. LiveKit’s low-quality microphone flag is there to surface transcription errors on names, numbers and codes. A date is that kind of stress.

**What it cannot see.** A synthetic voice is not your callers. A missing accent is a hole, not a pass. The simulated caller will not invent a complaint you did not put in the goal. One audio pass is one draw, and each draw costs clock time. Do not use audio to check that a missing day refuses `book_appointment`. Text already does that. Do not run the whole suite in audio before every prompt edit.


## How do you simulate user conversations to test an agent?

Write the caller’s goal, let a model play the caller, and grade the result.

A later guide goes deeper. The pattern LiveKit, Pipecat and Vapi document is a persona, a goal, and a pass rule on the outcome. [Pipecat’s simulated scenario](https://docs.pipecat.ai/pipecat/evals/overview) is that persona plus a success line. Vapi keeps the eval separate: the eval freezes the chat and checks the next decision. The simulation lets the caller adapt and checks that the job got done.

Use a simulation when many wordings are fine, as long as the booked day is the day the caller wanted. Use a decision eval when one turn has one legal action, such as “do not book a 50th”. A passing simulation can still hide that turn. It also cannot tell you what real callers will ask once the agent is live. That is the real-call layer. [Shadow testing](https://tryabracadabra.com/blog/shadow-testing-ai-agents/) is different again: copies of real requests, replies thrown away. It needs traffic. A simulation invents the caller. Use simulation before the traffic exists.


## When should you move a test from text to voice?

Move it when the failure depends on the audio, not on the words in the transcript.

Move the fifteenth scenario when text passes on the string “fifteenth” and live transcripts still say “50th”. Speech-to-text is the suspect, not the model. Also move it when the agent talks over the caller, waits too long, or treats “uh-huh” as a turn. LiveKit’s text mode has no clock that matches a call. Keep the case in text when the transcript already says “50th” and the model books 15. A voice will not make that decision easier to see. If you cannot tell instructions from the tool result, start with [which part of the agent is failing](https://tryabracadabra.com/blog/symptom-to-harness-component/).

- **The input is sound.** You care what the recogniser wrote, not what you typed.
- **The output is sound.** You care how the day was read back, or whether the voice was cut off.
- **The bug is who spoke when.** Barge-in, a long pause, or a backchannel taken as a turn.

If none of those is true, the scenario stays in text.


## How many runs does a voice agent test need?

Enough that the uncertainty in the pass rate is smaller than the gap you care about.

The same transcript can book on one run and ask on the next. One green run is an anecdote. Treat each run as an independent yes or no. That is a binomial model. After n runs and k passes, the sample rate is k/n. Under a normal approximation, the standard error is the square root of (k/n) × (1 − k/n) / n. A rough 95% interval is that rate plus or minus 1.96 times the standard error. The approximation is weak when n is small, or when the rate is near 0 or 1. This page did not measure a production agent.

On the illustrative list the code printed 7 passes in 11 runs, a rate of 7/11, about 0.636. The standard error is √((7/11) × (4/11) / 11) = √(28/1,331), about 0.145. Times 1.96, the half-width is about 0.284. The rough interval runs from about 0.35 to about 0.92. It still contains a weak agent and a strong one. Do not ship on it.

Before you have a rate, use p = 1/2, where the standard error is largest. For a half-width of 0.1, n = 1.96² × 0.25 / 0.01 = 3.8416 × 0.25 / 0.01 = 96.04. Round up: 97, which is what `runs_for(0.5, 0.1)` prints. 97 is the cautious count for that width, not a measured sample size. A rate near 0.9 needs fewer runs, because 0.9 × 0.1 is smaller than 0.5 × 0.5. Spend the count on the decision eval, not on runs that share a cache or a fixed seed.


## How do you budget latency on a voice agent?

Add the delays the caller hears, and fail the run when the sum passes your budget.

LangChain’s guide calls the caller-facing gap end-of-turn latency: from the end of the caller’s turn to the start of the agent’s speech. The pieces are voice-activity detection, speech-to-text, the model, tools and text-to-speech. This page did not measure a pipeline. The milliseconds below are illustrative, so the addition is visible. They are not a benchmark.

| Piece | Illustrative ms |
| --- | --- |
| End-of-turn detection | 180 |
| Speech-to-text, final result | 220 |
| Model, until the first token | 340 |
| Text-to-speech, until the first audio | 190 |
| Sum, no tool on this turn | 930 |
| One tool call on the way to speech | 260 |
| Sum, with that tool | 1,190 |

If there is no tool, an illustrative budget of 1,200 ms leaves 1,200 − 930 = 270 ms of slack. Once the tool sits on the way to the first sound, it leaves 1,200 − 1,190 = 10 ms. Speak a short hold before the tool, or fail the run when first audio misses a budget you measured yourself. [Pipecat’s scripted scenarios](https://docs.pipecat.ai/pipecat/evals/scripted-scenarios) can bound an event with `within_ms`. Do not copy 1,200 ms into production from this page.


## How do you grade a voice agent?

Use a fixed check for the tool and the slot, and a model only for meaning.

LangChain’s guide makes the same split. Code checks a tool name, its arguments, its order or a latency threshold, and it does not call another model. A model judge is for a narrow rubric a second person would apply the same way. “Was this good?” is noisy. Vapi’s eval guide says: exact match when the tool matters, a pattern when the shape is stable, a judge only when several replies would all pass. If a tool check can prove it, do not ask a judge.

| Check | Use it when | Do not use it when |
| --- | --- | --- |
| Exact tool and arguments | The name, the day and the call count are the requirement | Several replies would all be a real pass |
| A pattern on the text | A confirmation must contain a stable date form | You need meaning, not a phrase |
| A model judge | The question is narrow and the rubric is written down | A tool check already proves it, or you are asking about the voice |
| The booking record | You need the day that was actually written | You only have the sentence “you’re booked” |

On this scenario the fixed check is the whole pass rule: `book_appointment` is absent. A judge can call booking the 15th “helpful” and pass the bug. Use a judge for one narrow question code cannot see, such as whether the agent asked for the day again without proposing the 15th. LangChain notes that a transcript-only judge can score wording and cannot score whether the voice sounded clear. A judge that “fixes” 50th into 15th will pass the bug.


## When should you not use a test layer?

Skip a layer when it cannot see the failure, or when a cheaper layer already can.

- **A decision eval for a new recogniser.** It never hears audio. Use it for “given this text, do not book”.
- **Text for a mishearing.** The string you typed is the string the agent got.
- **Audio on every prompt edit.** It is real time. A synthetic voice that passes is not every accent.
- **Real calls as a release gate.** They cannot block a path nobody has called. They are the next scenario.
- **One run.** The next draw can differ. That is what the width is for.
- **A judge on a tool name.** Compare the string.
- **A spoken “you’re booked”.** LangChain separates the call from the appointment record. Check the day that was written.

A better model still reads the transcript it is given. If that text says 50th, the hearing failed earlier, and no prompt edit hears the caller.


## How to tell it worked

The case that booked the wrong day now asks, and fewer live calls correct the date.

Before the change, the decision eval books 15 from a transcript that says 50th. After it, the same text gets `ask_to_confirm`, and `book_appointment` does not run, across the run count you set. On the audio scenario, the spoken line is “fifteenth”, the transcript is a 15 or the agent asks, and first audio meets a budget you measured. This page did not run that audio, and the 1,200 ms above is only the illustration.

On live calls, people stop saying “no, the fifteenth” and stop asking for the same booking again. Compare that task and cohort with the previous period, one change at a time. [How to A/B test an agent](https://tryabracadabra.com/blog/ab-testing-ai-agents/) is how you read a live finish rate. [How to detect user intent](https://tryabracadabra.com/blog/user-intent-detection-ai-agents/) names the step the caller was on. [Conversation analytics](https://tryabracadabra.com/blog/conversation-analytics-for-ai-agents/) reads the conversation, rather than the trace.

If those transcripts already live as conversations, the [workspace](https://tryabracadabra.com/product/) can find failed tasks, escalation intent, user corrections and repeated requests in the text. The [annotated replay](https://tryabracadabra.com/features/) pins the correction to the turn, and you copy that turn into the next regression case. Abracadabra does not ingest audio, speech-to-text or telephony data, and it does not run evals or simulations.


## What should you do first?

Start with the decision the model gets wrong, then add audio only for that case.

1. Write the bad transcript down. “50th” must not book.
2. Make that a decision eval with a code grader, and run it until the width is narrower than the difference you need to detect.
3. Add a text simulation for the goal, so a different wording still books the right day, or asks.
4. Move the scenario to audio only if production text shows a hearing error, or the bug is timing.
5. Read real transcripts for the next correction, and add that case. Do not wait for the suite to invent it.


## Common questions about voice agent testing

These are the questions people ask before they pick a layer.


### How do you simulate callers to test a voice agent?

Give a second model the caller’s goal and what it is allowed to disclose, and let it talk to your agent in text. Grade where the call ends, such as the booked day, rather than the wording. Audio comes later, for hearing or timing faults; see How do you run a text simulation? above.


### What is the difference between a decision eval and a simulation?

A decision eval freezes the transcript and checks the next action. A simulation lets a model play the caller across many turns and checks the ending. Pick the eval when only one next move is correct, and the simulation when several routes reach the same result.


### When should a voice agent test use audio?

Use audio when the words in the transcript are not the thing that failed. Misheard dates, names, numbers and addresses, barge-in, and the pause before the agent speaks all need the speech path. A wrong tool on a transcript you already have does not.


### How many times should I run a voice agent scenario?

One run is not a rate. Under a normal approximation, a half-width of 0.1 at a pass rate near 1/2 needs 97 independent runs. The reason is that 1.96 squared times 0.25 divided by 0.01 is 96.04. That is arithmetic, not a measured sample size.


### Can a transcript test catch a misheard date?

It can catch the model booking a day the transcript does not support, such as turning “50th” into the 15th. It cannot catch the hearing error itself. If the caller said “fifteenth” and the transcript says “50th”, only an audio run, or a recording of the real call, shows that step.


## Related guides

These guides cover the eval, the live test, and the conversation you read afterwards.

- [What is an eval? AI evals explained for product managers](https://tryabracadabra.com/blog/what-is-an-eval/)
- [Shadow testing AI agents: try a change on real traffic](https://tryabracadabra.com/blog/shadow-testing-ai-agents/)
- [How to A/B test an AI agent safely on live traffic](https://tryabracadabra.com/blog/ab-testing-ai-agents/)
- [How to debug an AI agent: which part is failing?](https://tryabracadabra.com/blog/symptom-to-harness-component/)
- [Conversation analytics for AI agents: tools and what to track](https://tryabracadabra.com/blog/conversation-analytics-for-ai-agents/)
- [How to detect user intent in AI agent conversations](https://tryabracadabra.com/blog/user-intent-detection-ai-agents/)
