Persona-simulation harness
POST /api/v1/agents/:id/persona-simulation is the flagship pre-deploy test
harness for an AI agent. It runs a full conversation — caller turns, agent
turns, tool calls — then has an LLM judge grade the finished transcript
against your scenario’s objective and rubric, and returns a rollout-gate
report you can use to block a bad prompt or model change before it reaches
customers.
Endpoint paths below are relative; send them against
https://api.orbit.devotel.io.
How it differs from the other harnesses
Orbit ships six pre-deploy testers. Pick the persona-simulation harness when the question is “how does the agent behave in a real conversation” rather than “did the reply contain the right string”:
The first five replay caller turns an operator wrote by hand — the “persona”
is a label on a fixed script, and assertions are deterministic at most
(contains/excludes, tool-called). Persona simulation grades the whole
conversation with an LLM judge, which is what makes the verdict meaningful
for a prompt, model, or config change.
Every mode of this harness runs against the agent’s sandboxed runtime —
no billing, no memory writes, no outbound calls or messages ever leave the
platform.
Live-persona mode
Omitscripted_utterances on a scenario and an LLM-simulated caller persona
drives the conversation. The persona reacts turn-by-turn to what the agent
actually says — it improvises within the mood, background, and situation you
gave it — until the caller reports the issue resolved or the turn cap is
reached. Then the LLM judge scores the finished transcript.
This is the exploratory mode: use it to find out how the agent copes with an
angry customer, a confused one, or an unexpected tangent, without writing
the conversation yourself.
Scripted regression mode
Addscripted_utterances — one caller utterance per turn — and the run
becomes deterministic. The exact same caller script is replayed verbatim on
every run regardless of what the agent says; only the agent’s replies (and
the judge’s verdict) can move. That makes it the regression gate for prompt,
model, and config changes: the same conversation replays against the
candidate, and the LLM judge grades it, so a score diff tracks the change
you made instead of a different conversation.
- Pin
judge_modelin regression suites. The judge is an LLM too — pinning the model means a verdict diff between two runs reflects your agent change, not judge drift. The value must come from the supported Claude model list; a 422 otherwise. - Reuse the same scenario
ids. Verdicts are reported per scenario id, so stable ids give you a clean pass/fail diff between a baseline and a candidate run.
min_pass_rate, max_error_rate) instead of building the array per call,
the scripted-regression endpoint (POST .../agents/:id/simulation-eval)
carries that shape — see
Simulation & Regression Eval Suite. The
persona simulation route accepts a mixed batch: scenarios with
scripted_utterances replay deterministically, the rest run as live
personas, and the response’s replay_modes block reports the mix.
Pass/fail thresholds and blocking a rollout
Each run returns a batch summary plus a per-scenario verdict:summary.passRate— share of scenarios that passed (errored scenarios count against it).summary.avgScore— mean judge score (0–100) across scored scenarios.summary.totalCostCents— what the batch cost to run.- Per scenario:
status(pass/fail/error),score,passed, the judge’sreasoning, turn count, and the tools the agent invoked.
threshold (0–100, default 70) sets the judge’s pass line for every
scenario in the batch. A scenario passes when its judge score meets the
threshold.
To block a rollout on this harness:
- Save a version of the agent (Agent versions) — the candidate you intend to promote.
- Run the harness against it with
candidate_version_id. Omit that field and the live config is simulated, which is useful for a baseline but not for a gate. - In CI, treat a scenario with
status: "fail"(orpassed: falsein the raw report) as a blocking signal on the candidate version; read the judge’sreasoningfor why. Fail closed onerror— an errored scenario is unscored, not a pass. - Only if the gate clears, promote the version. When the gate fails, the candidate never meets traffic; fix the prompt or model and re-run the same scenario ids.
Failure modes to expect
- 503
LLM_UNAVAILABLE— the LLM judge is not configured on this deployment; the harness cannot run until an owner configures it. - 404
NOT_FOUND— the agent id does not exist in your workspace. The check runs before any simulation spend. - 422
VALIDATION_ERROR— a field constraint was violated: scenario fields likeid,title,persona.name,situation, andobjectiveare required;rubricholds at most 10 criteria;scripted_utterancesholds one non-empty utterance per turn, up to the 12-turn cap. - 502
AI_ERROR— the batch failed mid-run upstream; retry, and split large batches if it repeats. - Scenario-level
status: "error"— that one conversation or its judge call failed; other scenarios in the batch still report normally. The scenario’serrorfield says what happened.
Where it fits in the pipeline
Persona simulation is the offline behavioural gate in the middle of the rollout ladder:- Run persona simulations (and replay scripted regression scenarios) against the candidate version.
- Promote the version and stage it on the canary ladder.
- Keep production sampling on with continuous production evals.