How it works
A run drives three text-mode LLM roles:1
Persona simulator
Role-plays the caller described by a scenario (busy, angry, off-topic, …) turn by turn.
2
The real agent
The exact agent you’d publish — same prompt, tools, and knowledge base, assembled from its config. Only the side effects are sandboxed (below).
3
Judges
Read the finished transcript and return a pass/fail verdict plus reasoning per criterion.
end_call, the simulator decides it’s done, or a per-scenario max_turns cap is hit.
Runs are text-only — no LiveKit room, STT, or TTS. This tests the agent’s decisions (what it says, which tools it calls), not its voice, so it’s fast and cheap. It runs against a draft agent, so you can iterate before publishing.
Sandboxed by test mode
Fidelity comes from reusing the exact production assembly, with one server-set test flag that neutralizes side effects so a test never touches the real world:- Sandboxed: side-effecting tools (
book_appointment,create_lead,lookup_order) return simulated results; the session-update webhook and any SIP/telephony are disabled. - Left intact: read-only
search_knowledge_baseandend_call, so retrieval and call-ending behavior are exercised for real.
Suites, scenarios, and runs
- A suite is a reusable, workspace-level set of persona scenarios — author it once, run it against any agent.
- A scenario is one caller: a
label, the personainstructions,agent_expectations(what a passing run looks like), thejudgesto grade it, andruns/max_turnscaps. - A run executes every scenario in a suite against one chosen agent and records a result per scenario.
Judges
Every scenario is graded by the judges you select. Additionally, if a scenario setsagent_expectations, a rubric judge grades the transcript against that text.
A scenario passes when every selected judge passes; a run passes when every scenario passes.
The simulator and judge models are chosen per suite (
config.simulator_model / config.judge_model) and can use any provider the agent supports — LiveKit Inference, or your own Gemini/Sarvam/Groq keys. Pick a strong judge model for reliable verdicts.
Auto-generate a suite
You don’t have to hand-write scenarios.POST /agent-test-suites/generate reads the agent’s own assembled prompt, real tool names, bound knowledge base, and the judge criteria you pick, then writes scenarios that stress each criterion plus common difficult-caller cases (busy, angry, off-topic, declines). The result is a normal, editable suite.
API
Every endpoint lives under the workspace API and accepts a workspaceX-API-KEY (or a bearer login session).
Run a suite
A suite is agent-agnostic, so you choose the agent at run time:pending. Poll it until a terminal status — passed, failed, or error:
results fills in incrementally as scenarios finish, so you can show progress while polling. Each verdict carries a reasoning string explaining why a judge passed or failed — the “why it failed” for a scenario.
Runs are metered on real token usage across all three roles (agent, simulator, judges) and debited from your credit balance (
reason: agent_test). A run checks credits up front and again per scenario, so an out-of-credits scenario is recorded as a failure rather than aborting the run.Publish with confidence
A passing run is recorded as the agent’s last test status — the most recent passing run whose fingerprint still matches the agent’s current config. Surface it as a signal before you publish, or wire it into your own release check.Agents
Create the draft agent you’ll test.
Knowledge Base
Retrieval the test exercises for real.
Billing
How test runs are metered.
Sessions
Live calls, once you’ve published.

