Personas and mock users
A persona says who the simulated user is: how they speak, how much they know, how they feel. You give a persona to a scenario run so that you can see whether the agent copes with a hesitant caller as well as with a terse expert. This guide shows the persona file, the three ways to use it, and how to read the per-persona rows of the summary.
Before you start
You can run a scenario. See Run your first scenario and Write a scenario.
ROBOTELOS_E2E_TOKENholds a token, set without printing it. In PowerShell:$env:ROBOTELOS_E2E_TOKEN = (Get-Content -Raw "$HOME\.robotelos\dev\token").Trim()In bash:
export ROBOTELOS_E2E_TOKEN="$(tr -d '\r\n' < "$HOME/.robotelos/dev/token")"To play a persona with a model (the
--user-modelflag), you also need an Ollama server and a stack started with the goal agent. See Run against a real agent.
The persona file
A persona file is one JSON object. These two ship with the repository in runtime/internal/e2e/testdata/model-user/personas/:
{
"name": "Hesitant caller",
"description": "Unsure of the words, starts again and corrects herself.",
"language": "English",
"tone": "Polite",
"knowledge_level": "Beginner",
"emotional_state": "Confused",
"traits": ["hesitant", "apologetic"],
"spoken_language": "en",
"speech": {
"fillers": ["um,", "uh,", "you know,"],
"self_corrections": ["no, sorry,", "I mean,"]
}
}
direct-expert.json in the same folder has tone Direct, knowledge level Expert, emotional state Impatient, the trait terse and the behavior modifier answers in as few words as possible.
The fields, as the persona schema defines them:
| Field | Allowed values |
|---|---|
name | Required, 1 to 120 characters. |
description | Up to 2000 characters. |
scope | team or personal. |
language | English or German. |
tone | Aggressive, Professional, Polite or Direct. |
knowledge_level | Beginner, Intermediate or Expert. |
emotional_state | Frustrated, Neutral, Confused or Impatient. |
behavior_modifiers, traits | Lists of up to 64 strings, each up to 200 characters. |
tts_voice, spoken_language | Strings for a voice run. |
speech | Optional: style, fillers, self_corrections, pause_ms (0 to 10000) and rate (0 to 1). |
A file with a key the schema does not have, a value outside these limits, or more than 1 MiB is refused. A persona file is not a spec, so the runner skips every *.json in a personas/ folder below the spec folder.
test lint notes when a spec without a user block has a persona with fields that have no effect there. Without a user block only the persona name and speech have an effect on the text channel. The other fields describe a user that a model plays.
Use a persona
There are three ways. They differ in who chooses the persona.
A spec names its own persona
Put persona_ref in the spec. The value is a path into the personas/ folder beside the spec file:
"persona_ref": "personas/hesitant.json"
The path must start with personas/, be relative, use / and contain no ... Anything else is an error, and robotelos test lint reports it. Check your specs:
./robotelos test lint runtime/internal/e2e/testdata/model-user
The last line is N specs, M issues. Exit code 0 means no issue, 1 means issues were found, 2 means a spec could not be read.
One persona for a whole run
--persona FILE plays every spec of the run with that file instead of its own persona, also a spec that has a persona_ref:
.\robotelos.exe test run runtime/internal/e2e/testdata/model-user `
--url http://127.0.0.1:8787 --agent concierge `
--inspect-url http://127.0.0.1:8787 --effects-url http://127.0.0.1:8793 `
--profile live --job-dir $job `
--user-model qwen3:8b --user-model-url http://127.0.0.1:11434 `
--persona runtime/internal/e2e/testdata/model-user/personas/hesitant.json
./robotelos test run runtime/internal/e2e/testdata/model-user \
--url http://127.0.0.1:8787 --agent concierge \
--inspect-url http://127.0.0.1:8787 --effects-url http://127.0.0.1:8793 \
--profile live --job-dir "$job" \
--user-model qwen3:8b --user-model-url http://127.0.0.1:11434 \
--persona runtime/internal/e2e/testdata/model-user/personas/hesitant.json
Set $job first to a directory that does not hold a job yet. See Repeat, resume and compare.
Compare personas in one run
Give --persona a comma-separated list. Every spec then runs --k times with each entry. The entry as-written means each spec’s own persona. Quote the list so that PowerShell passes one argument. Add this to the command above in place of the single file:
--k 3 --user-temperature 0.7 `
--persona "as-written,runtime/internal/e2e/testdata/model-user/personas/hesitant.json,runtime/internal/e2e/testdata/model-user/personas/direct-expert.json"
--k 3 --user-temperature 0.7 \
--persona "as-written,runtime/internal/e2e/testdata/model-user/personas/hesitant.json,runtime/internal/e2e/testdata/model-user/personas/direct-expert.json"
A list has limits:
- It needs
--job-dir, so it runs on the text channel only. - It does not go with
--baseline,--baseline-latest,--store,--suiteor--sweep. To compare two persona matrices, userobotelos test diff. - A file path that contains a comma cannot be named in a list.
robotelos-e2e, the older command, takes no list and no--persona.
Read the per-persona rows
After the per-spec lines, a matrix run prints one row per persona, then the totals. The row has this shape:
persona <name> P of G graded runs passed (R runs), pass rate X% [LOW% to HIGH%] difference from as-written +D points
P of G graded runs passedcounts only graded runs:PASS,FAILandINCOMPLETE. Technical errors, unrunnable runs andUNKNOWNruns count only inR runs.- The interval is a 95 % confidence interval. With few runs it is wide, so a difference of a few points means nothing.
- The difference from
as-writtenis for information. It does not change the exit code. - A persona with no graded run shows
no graded runin place of the rate.
The final line counts spec and persona pairs in place of specs.
Make a model user vary
--user-temperature is from 0 to 2 and defaults to 0. It applies to the model-played user only. At 0 the requests are the same as without the flag. Above 0, every repeat gets its own seed, derived from --user-seed. Repeat 1 has the same seed for every persona and after a resume. The seed drives the speech effects and is sent to Ollama as options.seed. The same seed does not promise identical answers.
--user-seed sets the seed of the model user. If you leave it out, the runner makes one and records it in the job.
Personas and mock users in your account
The control plane stores personas and mock users in an account, so a team can share them. You manage them with the CLI. The account ID is the first argument:
./robotelos persona list ACCOUNT_ID
./robotelos persona create ACCOUNT_ID --spec-file persona.json
./robotelos persona show ACCOUNT_ID PERSONA_ID
./robotelos mock-user list ACCOUNT_ID
./robotelos mock-user create ACCOUNT_ID --spec-file mock-user.json
Both commands also take update, duplicate and delete:
persona update ACCOUNT_ID PERSONA_ID --spec-file persona.json [--expected-version N|--force]
persona duplicate ACCOUNT_ID PERSONA_ID
persona delete ACCOUNT_ID PERSONA_ID --yes [--expected-version N|--force]
mock-user has the same three with MOCK_USER_ID and mock-user.json. delete without --yes is refused. list takes --query and --scope team|personal, and persona list also --tone, --knowledge-level, --emotional-state and --behavior-modifier. Every command takes -o text|json.
- A stored persona has the same fields as a persona file, plus a scope (
teamorpersonal) and a version. - A mock user is a synthetic identity: a
name, auser_id, anactor_kind(account_memberorcustomer), a scope and an optional linked sign-in user ID. It says who a test acts as. It is not a persona and it does not say how anyone speaks. robotelos test rundoes not read stored personas or mock users. To use a stored persona in a run, save its fields to a file and pass the file with--persona.
If something goes wrong
--persona with a list needs --job-dir: add--job-dirwith an empty directory.a persona matrix does not go with --baseline, ...: drop the baseline flags and compare the two jobs withrobotelos test diff.persona_ref "..." must be a relative path that starts with personas/: fix the path in the spec.not a PersonaSpec in JSONorinvalid persona: the file has a wrong key or a value outside the table above.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.