$simulate runs everything end to end, and
$simulation-scan-agent, $simulation-generate-suite, $simulation-run and $simulation-fixes run one stage
each.
Codex needs two things the plugin cannot set for you: one keypress of hook trust, and shell network access.
The first Plurai command then signs you in through your browser and installs the SDK for you.
Requirements
- macOS or Linux, with
python3on thePATH. Every hook runs aspython3 …. - Codex CLI. Verified on 0.160.0; a newer version is unverified until this page lists it.
- Python 3.12 or newer for your agent’s environment. The plugin installs the
pluraiSDK there. - A browser, to sign in or sign up. On a machine without one, see No browser.
Set up
1
Install the plugin
2
Print your setup
In a Codex session, run:It prints the exact settings for your install.
3
Trust the plugin's hooks
The plugin’s guards are hooks, and Codex runs a plugin hook only after you trust it. On the first start
after you install or update the plugin, Codex shows Hooks need review. Choose
Trust all and continue. The hooks run in that same session.If you chose Continue without trusting, open
/hooks in a running session and press t to trust them
all.4
Open the shell's network
The Codex sandbox blocks the shell’s network by default, loopback included. The plugin’s scripts and the
simulation runner reach the backend from the shell, so run Codex with the
workspace-write sandbox and
open its network.- Every session
- One session
Add this to
~/.codex/config.toml (or $CODEX_HOME/config.toml):5
Restart Codex
Codex reads skills, hooks and the MCP server at session start. Restart it after you change the
configuration or the environment.
6
Sign in
There is nothing to run: the first Plurai command signs you in. It opens your browser, where you sign in or
sign up, pick your organization and approve. The SDK creates its own key and saves it; the key is never
shown, typed or copied. When the SDK is missing, the command asks once and installs it first.The plugin’s backend tools pick up the new login in the same session. If Codex does not refresh them, the
command says
Restart Codex to connect Plurai, then run <command> again.No browser
On a machine without a browser, create a key in the Plurai dashboard and save it once, in a terminal of your own:PLURAI_URL and PLURAI_TOKEN together in the environment that
launches Codex. See Environment variables.
Limit network access to named hosts (experimental)
A Codex permission profile can open the network only to the hosts you name. It relies on Codex’snetwork_proxy feature, which Codex marks experimental. A profile replaces network_access, so do not
combine the two. Add an entry for the backend, the agent under test’s model host, any package index, and
127.0.0.1 if you use a local service:
Run a flow
Start Codex in your agent’s project and invoke the command with a dollar sign.$simulate runs every stage:
$simulation-scan-agent <path-to-your-agent>.
- Start with
$simulateor$simulation-scan-agent. Building-block skills such as$simulation-setupalso run when you type them on Codex, but they are steps of the scan. - Answer gates as a new message. Codex has no blocking question tool in Default mode. At a gate the model asks one question with its options and ends the turn. Reply with one of the listed options.
- Use Default mode, not Plan mode. Plan mode forbids the file edits the flows make.
- Choose a Claude model if Codex offers one. The skills are tuned on Claude; Codex support was measured on OpenAI models only.
Headless runs
codex exec cannot ask you anything. Declare that nobody is there with PLURAI_SIM_NONINTERACTIVE=1, or
workspace.run_driver: headless in plurai.config.yaml. Each gate then takes its default, or records a finding
and stops when only you can supply the answer. codex exec also skips hooks that are not trusted yet, so start
Codex once and trust them first. Tools that delete or cancel something keep Codex’s own approval, and codex exec
cancels them. See Run in CI.
Use a non-default backend
A test or self-hosted backend needs its URL exported in the environment that launches Codex, and noconfig.toml entry:
https, or http to a
loopback address. A saved login belongs to one backend; the plugin does not hand its key to another. A backend
outside *.plurai.ai and loopback needs PLURAI_URL and PLURAI_TOKEN exported together.
If your config.toml sets [shell_environment_policy] inherit = "core", the shell sees neither variable. Put
them under [shell_environment_policy.set] too, and keep the export where Codex launches: the MCP bridge reads
them from there. This writes the key into config.toml in plain text, so use it only with a development key.
Who can read the key
The plugin’s own shell steps need your key, so on Codex it reaches the model’s shell in either form:- The saved login keeps other users out (mode 0600), not commands that run as you.
- An exported
PLURAI_TOKENreaches the model’s shell by default. Setting[shell_environment_policy] ignore_default_excludes = falsemakes Codex drop variables whose names containKEY,SECRETorTOKENfrom that shell. The MCP tools still work, but the plugin’s shell steps that call the backend (uploads, polling, the runner) then stop, because they cannot find the key.
plurai logout and sign in again when a session went wrong.
What differs from Claude Code
- Commands start with
$, and the hand-off names the next command the same way. - Hooks need your trust once per install or hook change.
- The shell needs network access.
- A gate ends the turn; you answer in your next message.
- There is no dropped-turn rescue. A turn that dies on an API error is not re-driven; re-invoke the same command and it resumes.
- The report is a local file, not a link. Each hand-off names its path; open it in a browser. It refreshes in place while a Run plays.
Update
/hooks. Newer Codex versions ask you to approve the plugin’s hooks again
after every plugin update. Until you do, flows stop with “plugin files changed”.
Privacy
The plugin sends no client-side telemetry. See Data and privacy.Next steps
Scan your agent
The first stage, in detail.
Troubleshooting
Fixes for common setup problems.