Personas and mock users

Play the same scenario with different simulated users: write a persona file, attach it to a spec or to a run, and compare pass rates per persona.

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_TOKEN holds 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-model flag), 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:

FieldAllowed values
nameRequired, 1 to 120 characters.
descriptionUp to 2000 characters.
scopeteam or personal.
languageEnglish or German.
toneAggressive, Professional, Polite or Direct.
knowledge_levelBeginner, Intermediate or Expert.
emotional_stateFrustrated, Neutral, Confused or Impatient.
behavior_modifiers, traitsLists of up to 64 strings, each up to 200 characters.
tts_voice, spoken_languageStrings for a voice run.
speechOptional: 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, --suite or --sweep. To compare two persona matrices, use robotelos 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 passed counts only graded runs: PASS, FAIL and INCOMPLETE. Technical errors, unrunnable runs and UNKNOWN runs count only in R 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-written is for information. It does not change the exit code.
  • A persona with no graded run shows no graded run in 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 (team or personal) and a version.
  • A mock user is a synthetic identity: a name, a user_id, an actor_kind (account_member or customer), 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 run does 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-dir with an empty directory.
  • a persona matrix does not go with --baseline, ...: drop the baseline flags and compare the two jobs with robotelos test diff.
  • persona_ref "..." must be a relative path that starts with personas/: fix the path in the spec.
  • not a PersonaSpec in JSON or invalid persona: the file has a wrong key or a value outside the table above.

Next steps