Scenarios, suites and personas
Review and change an environment's scenarios from the terminal, save them as suite versions for runs, and keep personas as files
An environment’s scenarios are the cases a run plays against your agent. fagi sim scenarios reads and changes them, fagi sim suites saves them as the suite versions a run picks, and fagi sim personas manages your workspace personas, which describe how a simulated person behaves. Work with scenarios covers the same steps in the dashboard.
- Signed in to the CLI (see Sign in)
- A CLI with
fagi sim, which ships in a later CLI release - An environment (see Environments). Scenario and suite commands take its ID as
--env ENV_ID, fromfagi sim env list; an unknown ID exits 4 - For
fagi sim suites, a workspace with environment versioning
With environment versioning, changes to scenarios collect in a suite draft until you save it with fagi sim suites save. Without it, changes apply to the environment right away, and the suites commands exit 4 with an error that says versioning is disabled (an older platform’s error can read like not found).
These commands ask for confirmation, because they remove things or spend builder credits: amend with a drop, generate, starting-records rework, suites discard and personas delete. personas pull asks only before it overwrites a file that differs. fagi sim flags covers --yes and idempotency keys.
Find and read scenarios
fagi sim scenarios list --env ENV_ID --search refund --group-by goal
fagi sim scenarios list --env ENV_ID --json
fagi sim scenarios show --env ENV_ID book-ride
list prints one page of scenarios, by number. If there is a suite draft, it lists the draft and says so: in a note on stderr for table and JSONL output, or in the draft key with --json.
| Flag | What it does |
|---|---|
--search TEXT | Keep scenarios that match every word in their name, key, instruction, use case or branch |
--filter FIELD=VALUE | Repeatable. The same field twice matches either value; FIELD_not=VALUE excludes. Fields include name, use_case, status, persona.accent, persona.languages, persona.age_group, background_noise, coverage.task, keywords and actors (an actor ID, or none) |
--group-by | goal, sub_goal, accent, age, attack or task. Rows gain a GROUP column and sort by it within the page. sub_goal prints a scenario once per sub-goal, so rows can repeat |
--ordering | number, name or use_case; prefix - to reverse |
--page, --limit | Page number from 1, and 1 to 100 scenarios per page (default 10) |
fagi sim scenarios list --help prints the full list of filter fields.
show SCENARIO_KEY prints one scenario by the key that list shows: its use case, situation, expected behavior (tests), persona, coverage, sub-goals and status. When tests is hidden from your key, it prints as withheld.
Check coverage
fagi sim scenarios coverage --env ENV_ID
fagi sim scenarios coverage --env ENV_ID --row-axis disposition --col-axis task --json
coverage counts the scenarios for every pair of levels on two axes, zeros included, and prints how many levels each axis has. --row-axis (default task) and --col-axis (default overlay) take task, counterparty, disposition, interface, interaction, overlay, overlay_vector or overlay_intensity. --search and --filter work as in list.
The grid counts every matching scenario, not one page, and includes the suite draft when there is one. A scenario with no level on an axis is not counted there, so totals can be lower than the suite size. If coverage shows an empty grid for an environment that has scenarios, run fagi sim scenarios list --env ENV_ID once, then run coverage again.
See and rework starting records
Each scenario starts from records seeded into the environment’s world, such as a customer row. starting-records shows those records and asks the builder (the AI that writes and checks your environment, see Environments) to start the scenario from a different one.
fagi sim scenarios starting-records show --env ENV_ID refund-flow --json
fagi sim scenarios starting-records rework --env ENV_ID refund-flow --record customer.customer_id --key cus_3 --yes
show prints the records the scenario’s facts name, up to 50 rows each could start from instead (CHOICES), and the scenario’s latest rework with its state. It reads the suite draft if there is one, otherwise the saved versions. It exits 8 after printing when the seeded rows cannot be read.
rework asks the builder to rewrite the scenario so it starts from another row:
| Flag | What it does |
|---|---|
--record LABEL | A record’s exact LABEL from starting-records show (required) |
--key KEY | Any seeded key of that record’s table, not only the listed choices (required) |
starting-records needs platform v1.60.0 or later; on an older one it exits 1 with platform_too_old and changes nothing. A rework uses builder credits, so it asks for confirmation, and it needs a personal key. It is refused (exit 1) when the scenario can’t be reworked or its seeded rows can’t be read. Its save can discard a stale suite or environment draft; the command warns before it sends, and --json shows them as stale_drafts_at_risk. The chosen row, secret fields included, is written unmasked into the builder chat. The command does not wait: run starting-records show until the rework reports proven or refused, and make no environment edit before then. When the builder waits for your confirmation, show names the fagi sim env approve or fagi sim env chat command to answer it.
rework takes no idempotency key. After exit 6, run starting-records show to see whether the rework started before you repeat it, since a repeat can be billed again.
Change scenarios
Drop or edit scenarios
amend (also edit) takes a list of changes as --input-json (inline JSON, @FILE, or - for stdin) or --from-file PATH. Each change has an op and names its scenario with scenario (a name, key, number, range such as 2-4, or comma list such as 1,3) or scenarios (a list). This changes.json uses all three ops:
{"changes": [
{"op": "drop", "scenario": "3"},
{"op": "set_field", "scenario": "book-ride", "field": "tests", "value": "Confirms the pickup time."},
{"op": "set_persona", "scenario": "1", "persona": {"accent": "indian"}}
]}
fagi sim scenarios amend --env ENV_ID --from-file changes.json --yes --json
fagi sim scenarios amend --env ENV_ID --input-json '{"changes":[{"op":"set_field","scenario":"1","field":"tests","value":"Confirms the pickup time."}]}' --no-rework
| Op | What it changes |
|---|---|
drop | Removes the scenario. Asks for confirmation |
set_field | Takes field and value. field is tests, keywords, max_turns (chat only) or background_noise (voice only) |
set_persona | Takes a persona object with any of personality, communication_style, accent (voice only), languages, occupation or location |
Drops and changes to keywords, max_turns, background_noise or the persona need the suite proved again, which spends builder credits. --no-rework refuses those and applies only tests edits. Each change gets a receipt: applied, queued or refused, with the reason in the WHY column. The command exits 0 when any change applied and 1 when every change was refused.
The changes go into the suite draft when versioning is on. amend takes no idempotency key: after exit 6, run fagi sim scenarios list --env ENV_ID to check whether the changes applied before you repeat them.
Generate more scenarios
fagi sim scenarios generate --env ENV_ID --count 5 --guidance 'riders who change the pickup address' --yes
generate asks the builder for --count (1 to 50, required) new scenarios on a finished environment, steered by --guidance (up to 2000 characters). Existing scenarios are kept. The builder writes the new ones into the suite draft in the background, and nothing is run or saved for you; without suite versions the environment is rebuilt with the larger suite. The command prints the builder job and does not wait.
It spends builder credits, so it asks for confirmation. With versioning, a repeat with the same --idempotency-key returns the original request; a different --count or --guidance with that key exits 2.
Save scenarios as a suite version
A suite version is a saved set of the environment’s scenarios. fagi sim run requires --suite, which takes a suite version ID. The default version is the one the platform marks for runs, and the only one a coding agent’s key can read: suites show or a run on another version exits 4 (version_not_found) for that key.
fagi sim suites diff --env ENV_ID --json
fagi sim suites save --env ENV_ID --expected-revision 3
fagi sim suites list --env ENV_ID
| Command | What it does |
|---|---|
fagi sim suites list --env ENV_ID | Suite versions, newest first, with drafts and discarded versions at the top and the default marked. Its ID column is the SUITE_VERSION_ID the other commands take |
fagi sim suites show --env ENV_ID SUITE_VERSION_ID | The scenarios in one saved suite version, by number. A draft or discarded version lists none |
fagi sim suites diff --env ENV_ID | The suite draft: its revision, parent, the current default, change counts and each added, removed or changed scenario. --version SUITE_VERSION_ID shows what a saved version changed instead; --against SUITE_VERSION_ID compares with that version rather than the parent; with no open draft and no --version it exits 2 |
fagi sim suites save --env ENV_ID | Save the suite draft as the next suite version, which becomes the default. Exits 4 when there is no draft. A stale draft (one the environment moved past) is refused; discard it or apply it again in chat |
fagi sim suites discard --env ENV_ID | Discard the suite draft. Saved versions, runs and the environment draft are untouched. Succeeds when there is no draft, so it is safe to repeat. Asks for confirmation; pass --yes in scripts |
fagi sim suites set-default --env ENV_ID SUITE_VERSION_ID | Make a saved suite version the default |
save reads the draft just before saving and refuses (exit 1) if it changes during the save. To also refuse changes made since you ran diff, pass --expected-revision N (the revision diff prints). If a chat edit changed both the environment and its scenarios, suites save refuses (exit 1); save both with fagi sim env save.
fagi sim suites set-default --env ENV_ID SUITE_VERSION_ID --expected-default-id CURRENT_DEFAULT_ID
--expected-default-id works as for environment versions, including none. A draft or discarded version is refused (exit 1). Repeating a move that already succeeded is a no-op, so it is safe to retry after exit 6.
Manage personas
Personas are workspace-wide and have no versions. To track changes, pull them as YAML files, keep the files in your repo, edit them and push them back.
fagi sim personas list --type workspace --search caller --json
fagi sim personas pull --output-dir personas
fagi sim personas push personas/*.yaml --dry-run
fagi sim personas push personas/*.yaml --if-exists replace --json
| Command | What it does |
|---|---|
fagi sim personas list | System and workspace personas, newest first. --type system or workspace, --simulation-type voice or text, --search (name, description or keywords), --page and --limit (1 to 100, default 10) |
fagi sim personas show PERSONA_ID | One system or workspace persona, by the ID column of list |
fagi sim personas pull [PERSONA_ID...] | Write workspace personas, or the IDs named, as one YAML file each in --output-dir (default personas). System personas are pulled only by ID. --include-secrets writes secret values instead of [REDACTED] |
fagi sim personas push FILE... | Create or replace workspace personas from JSON or YAML files, matched by name |
fagi sim personas duplicate PERSONA_ID --name NAME | Copy a system or workspace persona into the workspace under a new name of at most 255 characters. Exits 1 if a workspace persona already has that name |
fagi sim personas delete PERSONA_ID | Delete a workspace persona. It cannot be restored. Asks for confirmation; pass --yes in scripts. Exits 2 for a system persona and 4 for an unknown ID |
Persona files
A persona file holds schema_version: futureagi.persona.v1, name and description, plus any persona fields you want to set:
schema_version: futureagi.persona.v1
name: Impatient caller
description: Calls about a late refund and interrupts often
personality:
- Impatient and direct
communication_style:
- Direct and concise
simulation_type: voice
A field the file leaves out takes the platform’s default, so a replaced persona matches its file. Run fagi sim personas pull on a real persona to see every field, or fagi sim personas push --help for the list. An unknown field, a bad value or two files with the same name exit 2 before anything is sent.
Pull
pull names each file after the persona, and its first line is a comment with the persona ID. New files are written and unchanged files are left alone. A file that differs is a conflict: on a terminal you’re asked, --force (or --yes) overwrites it, and otherwise it is kept and pull exits 2 after writing the others.
Warning
Pulled files hold [REDACTED] in place of secret values, such as those in custom_properties. With --include-secrets they hold the values in plain text (written with 0600 permissions); don’t commit those files. On push, a [REDACTED] value keeps the platform persona’s value; in a list, the entry is matched by its name (such as name or key). A [REDACTED] with no platform value to keep, or a list entry that matches none or several, is a conflict.
Push
| Flag | What it does |
|---|---|
--if-exists | When a persona with the name exists and differs: error (default) pushes nothing and exits 1 naming the conflicts, skip leaves it, replace overwrites a workspace persona |
--dry-run | Print what each file would do and write nothing; exits 1 when any file would conflict |
System personas and changes to simulation_type are never replaced: with --if-exists error or replace the push exits 1, and with skip they are skipped. Every file is checked before the first write, but the push is not all or nothing: when a write fails, the rows written so far are printed and later files are not sent. After exit 6, rerun the push with --dry-run; unchanged means that persona was saved.
Dive deeper
Questions & Discussion