Codex Support
The toolkit installs the same agents, skills and rules into OpenAI Codex. The Markdown files in this repository stay the single source. Codex receives generated copies. The installer adds two hooks, readonly-role-guard and spawn-price-gate, and no other hook.
- YouPreview
EXIT 0DRY_RUN=1writes nothing - YouInstall
One script copies every asset
24 SKILLS, 15 AGENTS - InstallerDoctor
It prints
EXIT 0ok:ormissing: - CodexNext turn
Codex reads the new assets
Install in four steps
Run the commands from the repository root. The target is ~/.codex, or $CODEX_HOME when you set it. When you set a custom $CODEX_HOME, the renderers write that home into the agent and skill paths, and the agents render to a stage directory. The committed render under codex/agents keeps ~/.codex.
- 1
Check the three prerequisites
OpenAI Codexrsyncpython3 3.11 or laterinstall-codex.shis a bash script. It needs Python 3.11 fortomllib.No Windows installerThere is no
install-codex.ps1. You cannot run the Codex install on native Windows today. - 2
Preview the install
The script renders into a temporary directory, prints the plan and exits. It writes nothing under
~/.codexand nothing in this repository.DRY_RUN=1 deploy/scripts/install-codex.sh[dry-run] install 24 skills into ~/.codex/skills [dry-run] install 15 agents into ~/.codex/agents [dry-run] mirror ft-sdd assets into ~/.codex/ft-ai-toolkit/ft-sdd [dry-run] sync rules into ~/.codex/ft-ai-toolkit/rules [dry-run] install codex hooks into ~/.codex/ft-ai-toolkit/hooks [dry-run] install version-gate.py into ~/.codex/ft-ai-toolkit/hooks [dry-run] update owned agent and hook blocks in ~/.codex/config.toml (with backup)Real outputCaptured with a scratch $CODEX_HOME. The threerenderedlines above these are omitted, and the paths are shortened. - 3
Install
The script installs skills, rules, agents and two hooks (the guard and the spawn gate), updates the three config blocks, then runs the doctor.
deploy/scripts/install-codex.shok: TOML validation ok: hook readonly-role-guard note: readonly-role-guard has no trust recorded; until you trust it in Codex's hooks review, the guard denies nothing ok: hook spawn-price-gate FT Codex assets installed. They are available in the next Codex turn.Real outputThe last lines of a run with a scratch $CODEX_HOME. The doctor runs at the end of the install.Your edits in installed folders do not surviveThe installer runs
rsync -a --deleteon each installed skill directory and on the rules directory. It does not touch other skills in~/.codex/skills/. - 4
Check the install at any time
The doctor changes nothing. It prints
ok:ormissing:for each item, andnote:for a state that needs your attention. See what it checks.deploy/scripts/install-codex.sh --doctorok: TOML validation ok: hook readonly-role-guard note: readonly-role-guard has no trust recorded; until you trust it in Codex's hooks review, the guard denies nothing ok: hook spawn-price-gateReal outputThe last four lines of a clean doctor run. The run prints 43 ok:lines: 24 skills, 15 agents, the version gate, the TOML check and the two hooks. Anote:never changes the exit code.
The six doctor checks
- Every listed skill has
SKILL.mdunder~/.codex/skills/. - Every listed agent has a TOML file and an
[agents.<name>]entry inconfig.toml. - The doc writer's
version-gate.pyis installed. config.tomland every agent file parse as valid TOML.- The guard hook is installed: the guard file exists, the hook block holds exactly one guard group, its interpreter runs and imports
tomllib, and its matcher is the one that this repository's guard template composes. A matcher from an older template, or one that Codex would read as an unanchored regex, ismissing:. Trust is reported as anote:, never asok:. - The spawn gate is installed: the script and the gate block exist, the block holds exactly one gate group, and its matcher is the list that the gate template composes for the namespace baked into the guard command. Trust is not checked.
Notes about spawn settings
These notes are not checks. The doctor prints a note: line, never ok: or missing:, and a note never changes the exit code. The doctor stays silent when the condition of a note is absent.
| Note | Trigger | Remedy |
|---|---|---|
| N1 | Your user config sets expose_spawn_agent_model_overrides = false under [features.multi_agent_v2]. The note starts with "with multi-agent v2" and says that spawn_agent loses model and reasoning_effort. | Remove the key or set it to true, if you want the dispatcher's pick to apply. |
| N2 | Your user config sets [agents] default_subagent_model to a string. The note shows the value. | Remove the key, if you want the dispatcher's pick to apply. |
| N3 | Your user config sets [agents] default_subagent_reasoning_effort to a string. The note shows the value. | Remove the key, if you want the dispatcher's pick to apply. |
| N4 | A project file .codex/config.toml is not a readable TOML file under 16 KiB. It can be too large, not a regular file, not valid TOML, or too slow to parse. The doctor also prints N4 for a file it did not reach before its limit of 5 seconds. The doctor does not check its spawn settings. | Fix or shrink the file, then run the doctor again. If the file is small and valid, only run the doctor again. |
| N5 | A project file sets [features.multi_agent_v2] expose_spawn_agent_model_overrides, [agents] default_subagent_model or [agents] default_subagent_reasoning_effort. The note names the file and the keys, not their values. | Open the file and read the values. Codex applies them only while it trusts the project. |
Three more lines report that a check could not finish. Each line names a reason and never the text of your files.
- The user config could not be checked:
note: spawn settings in <file> could not be checked (<reason>); fix or replace that file, then run --doctor again.The doctor prints no other note from the user config. - The user notes are printed, but the project files could not be checked:
note: project files were not checked (<reason>); run --doctor from an existing project directory.This happens, for example, when the current directory was deleted. - The check could not run at all:
note: spawn settings could not be checked, with no reason.
The <reason> is timed out, not a regular file, or the name of a Python exception class such as FileNotFoundError.
What the spawn notes read, and what they do not
- The doctor reads your user config and the project files from the current directory. At the end of an install, that directory is the one where you ran the installer. Run
--doctorfrom the project. - The doctor does not evaluate the project trust of Codex. It prints project files apart, in N5. A project file never changes N1, N2 or N3.
- The notes follow the behaviour of Codex rust-v0.167.0. A wrong result is a note, never a failure.
- The doctor does not read managed config (
managed_config.toml, MDM, system), cloud config, session flags or--profilefiles.managed_config.tomloutranks what the doctor shows. - A model can select multi-agent v2 without the feature flag. N1 therefore says "with multi-agent v2" and appears whatever
enabledsays. - N2 and N3 report that a value is set. They do not report that Codex accepts it.
- Codex does not read
[profiles.<p>.features.multi_agent_v2]. It rejects--profilewhen[profiles.x]exists. No note covers that table. - The limit of 16 KiB in N4 applies to project files only. The user config has no size limit.
- A project file over the limit, or one the doctor cannot parse or reach before its limit of 5 seconds, gets N4.
missing:The doctor prints a missing: line
- The doctor exits with an error, for example after
missing: skill ft-fix. - Run
deploy/scripts/install-codex.shagain. It restores the listed item.
missing:The doctor prints missing: hook readonly-role-guard (...)
- The text in brackets names the reason: no guard file, no hook block, a hook block that does not parse (
not indexable), not exactly one guard group, or no interpreter. Apython3that is not executable, cannot run, or cannot importtomllibis also a reason. Three reasons concern the matcher:matcher does not compile;matcher is not an anchored name list, so Codex reads it as an unanchored regex; andstale install: the installed matcher names <n> tools, this template's names <m>, which is an install from an older guard template that guards fewer tools than the current one. - For a missing guard, hook block or group, a matcher reason or a stale install, run the installer again. A stale install is exposed until you do: the old matcher never offers the newer tool names to the guard. For an interpreter reason, install Python 3.11 or later, then run the installer again.
missing:The doctor prints missing: hook spawn-price-gate (...)
- The bare line
missing: hook spawn-price-gate (re-run the installer)means that the gate block, the script name inconfig.tomlor the script file is absent. With a reason in brackets: not exactly one gate group, a gate block that does not parse,matcher is not a plain name list, so Codex reads it as an unanchored regex, orstale install: the installed matcher names <n> tools, this template's names <m>. - Run the installer again. A stale gate matcher means that the gate never runs for the tool names it misses.
missing:The doctor prints missing: TOML validation (...)
config.tomlis absent, or a TOML file does not parse or cannot be read. The line names each file and the class of its error, for example'config.toml': TOMLDecodeError, and never the text of the file. The doctor exits with an error and goes on with the other checks.- If the file is absent, run the installer. If it does not parse, repair its syntax, then run the installer.
What the install changes in config.toml and in this repository
The installer copies the TOML files to ~/.codex/agents/. In config.toml it rewrites only the three blocks between these marker lines. The hook block follows the last hook group that you own, and the spawn gate block comes last. The installer never moves your groups.
- The hook block holds one
PreToolUsegroup. Its command is<python> -I <guard> --agents <dir> --sha256 <hash>, plus--tool-namespace <ns>when[features.multi_agent_v2] tool_namespaceis set. The default namespacecollaboration, which Codex applies whenmulti_agent_v2is on and the key is absent, is in the matcher always and needs no flag. If the installer cannot read that value, it writes a matcher without the namespace, and the doctor prints a note. - The spawn gate block holds one
PreToolUsegroup forspawn-price-gate.py, with the same-Icommand shape, the same--agentsdirectory and its own--sha256. - Each agent gets an
[agents.<name>]entry with adescriptionand aconfig_file. - The
descriptioncomes fromcodex/agents-registry.json. - The rest of
config.tomlstays untouched. - The installer validates the result as TOML before it writes.
- Before a change, it saves a backup named
config.toml.ft-ai-toolkit-backup-<timestamp>. A run that changes nothing saves no backup. - A real run also writes
codex/agents/andcodex/agents-registry.jsonin this repository.
Where each asset lands
The installer installs a fixed list. Press a scenario to walk one asset from this repository into ~/.codex.
In this repository
- agents/<name>.mdThe canonical agent files. There are 16.The renderer skips
tr-doc-writer, a retired redirect for callers on Claude Code. The other 15 reach Codex. - skills/<name>/The canonical skill folders. There are 30.
- rules/The canonical rule files. There are 22.
Renderers
- render-codex-agents.pyTurns each agent file into TOML.
- render-codex-skills.pyCopies each skill and keeps five frontmatter keys.
- render-codex-rules.pyCopies
rules/and adds a note to each path-scoped rule.
Stored in this repository
- codex/agents/The generated TOML files.
- codex/agents-registry.jsonOne description for each agent.
Installer
- install-codex.shRuns the renderers, copies the fixed lists and runs the doctor.
In ~/.codex
- agents/<name>.tomlOne TOML file for each of the 15 agents.
- config.tomlA marked block with one entry for each agent.
- skills/<name>/The 24 listed skills.
- ft-ai-toolkit/rules/The rendered rules.
A click on an element opens its short purpose.
An agent
- The renderer reads
agents/verifier.md. - It writes
codex/agents/verifier.tomlwith four keys, one comment line and a[features]table. - The installer takes the file from the repository.
- It copies the file to
~/.codex/agents/. - It writes the
[agents.verifier]entry into the marked block.
A skill
- The renderer copies
skills/ft-fix/into a temporary directory. - The copy waits for the installer.
- The skill is on the list, so
rsyncsyncs it to~/.codex/skills/ft-fix/.
A rule
- The renderer copies
rules/and adds the note to each path-scoped rule. - The rendered folder waits for the installer.
rsyncsyncs the folder to~/.codex/ft-ai-toolkit/rules/.
What is not installed
tr-doc-writerstops here. It is a retired redirect, so the renderer skips it.- The renderer copies all 30 skills.
- The installer reads its fixed list of 24.
- Six skills are not on the list, so they never reach Codex:
acs-fresh-reset,ft-docs,ft-jira,ft-ux-audit,ft-watchandsdd-authoring. The skill ft-ux-audit needs the Claude Code tools AskUserQuestion, Agent and Artifact. The skill sdd-authoring runs in the main loop only and drives the ft-sdd agent.
How the parts connect
render-codex-agents.pyreads each agent file.render-codex-skills.pycopies each skill.render-codex-rules.pycopies the rules.- The agent renderer stores the TOML files in
codex/agents/. - The agent renderer writes the description of each agent to
codex/agents-registry.json. - The installer copies the stored TOML files.
- The installer reads each description from the registry.
- The installer takes the rendered skills from a temporary directory.
- The installer takes the rendered rules from a temporary directory.
- The installer copies each listed agent.
- The installer rewrites the marked block in
config.toml. - The installer syncs each listed skill.
- The installer syncs the rules.
An agent file becomes one TOML file
A TOML file has one of two shapes. A pinned role has four keys: the model, its effort, the sandbox and the instructions. A priced role has two keys: the sandbox and the instructions. Codex does not apply the sandbox key to a spawned role. The readonly-role-guard hook reads the key. A read-only role carries two more parts: one comment line and a [features] table.
head -n 4 codex/agents/verifier.toml
# Generated from agents/verifier.md; do not edit by hand.
model = "gpt-5.6-sol"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions. It holds the agent body, with a <codex-runtime> preamble and Codex tool names. A reviewer file adds a comment line # ft-readonly-allowed-tools: and a [features] table after line 5, so head -n 4 shows the same four lines.head -n 2 codex/agents/ft-java-coding-agent.toml
# Generated from agents/ft-java-coding-agent.md; do not edit by hand.
sandbox_mode = "workspace-write"
model and no model_reasoning_effort line. Line 3 is its second key, developer_instructions.The model follows the tier
- gpt-5.6-lunaFrom
haiku, on effortmedium. No role is pinned to it. A spawner may pick it for a priced role. - gpt-5.6-terraFrom
sonnet, on efforthigh. An unknown value maps the same way. It pins 3 roles:ft-architecture-audit,ft-doc-writer-agentandft-ops. - gpt-5.6-solFrom
opus, on efforthigh. It pins 7 roles:bugfix-agent,ft-developer,ft-fix-host,ft-sdd,ft-test-adversary,refactor-agentandverifier.
The other 5 agents are priced roles and have no pin. The tier map offers a spawner the efforts low, medium and high. It offers nothing above high.
A spawner picks the model of a priced role
- The priced roles are
ft-angular-coding-agent,ft-coding-agent,ft-java-coding-agent,ft-python-coding-agentandft-ui-ux-design. - One function in
price-gate,is_priced_producer, names them. The renderer calls that function and keeps no second list. - The
spawn_agentcall takes the fieldsmodelandreasoning_effort. A pin in a role file beats both fields, so the fields act only on priced roles. - Only the two dispatchers,
ft-developerandbugfix-agent, receive the pricing bullet. It tells them to name both fields, to stay inside the tier map and to write aPick:line in the brief. - Every spawner sees the registry suffix of a priced role. The suffix says that the role has no model pin and that the spawner sets both fields.
- The upstream
spawn_agenttool text says to omitmodel. The pricing bullet tells a dispatcher that it outranks that text for priced roles. Other spawners see only the registry suffix. No Codex run exists to show which instruction a model follows. - Jev, the decision model, does not run on Codex. The dispatcher writes the pick as
self. - A
Mode: slicerun offt-developerstays pinned, because a role file is per name and cannot depend on a mode.ft-ui-ux-designinMode: reviewalso loses its pin for the same reason.
Text that the renderer replaces in the agent body
| Agent file | TOML |
|---|---|
| ~/.claude/rules/ | ~/.codex/ft-ai-toolkit/rules/ |
| $HOME/.claude/rules/ | $CODEX_HOME/ft-ai-toolkit/rules/ |
| ~/.claude/skills/ | ~/.codex/skills/ |
| $HOME/.claude/skills/ | $CODEX_HOME/skills/ |
| ~/.claude/learning/ | ~/.codex/ft-ai-toolkit/learning/ |
| ~/.claude/ft-sdd/ | ~/.codex/ft-ai-toolkit/ft-sdd/ |
| ~/.claude/skills | ~/.codex/skills |
| Task | spawn_agent |
| SendMessage | followup_task |
| AskUserQuestion | request_user_input |
| the Agent tool | the spawn_agent collaboration tool |
| /code-review | the Codex review workflow |
The install mirrors deploy/templates/sdd/ to ~/.codex/ft-ai-toolkit/ft-sdd/. The regression checks that every ~/.codex or $CODEX_HOME file that an installed agent cites is installed. Under a custom $CODEX_HOME, the renderers write that home in place of ~/.codex in these paths.
What the preamble says, and what the TOML omits
- A dispatched agent cannot question the user. It returns
NEEDS_USERorBLOCKEDto its parent. - Only the root agent may use
request_user_inputor ask in its final response. - An agent never edits its generated TOML. It returns a
SELF-TUNING PROPOSALagainst the canonicalagents/<name>.md. - Current Codex tool names and permissions override conflicting wording in the body.
- The TOML carries the keys of its shape. A read-only role adds only the comment line and the
[features]table. Askills:,hooks:ordisallowedTools:key in the frontmatter does not reach it.
The spawn gate bounds the pick of a priced role once you trust it in Codex's hooks review. The gate is a PreToolUse hook. It denies a priced spawn that omits model or reasoning_effort, names a model outside the tier map, or names an effort above high. Until you trust the hook, nothing on Codex checks or bounds the pick, and the tier map and the pricing bullet are advice. Two groups of changes matter here. g1 removed the model pin of five roles. g2 is the spawn gate. g3 is in the doctor: it prints a note: for each configuration key in the table below (see the notes about spawn settings).
The spawn gate
- The gate checks a
spawn_agentcall. It acts only when theagent_typeis an FT role whose installed TOML carries the FT marker and nomodelormodel_reasoning_effortkey. That is a priced role. - The allowed models are the values of the tier map:
gpt-5.6-luna,gpt-5.6-terraandgpt-5.6-sol. The allowed efforts arelow,mediumandhigh. - A denied call returns a reason line to the model. The reason says what to fix and never repeats a value from the call. The model can retry in the same turn.
install-codex.shinstalls the hook. It writes the hook as its own block at the end ofconfig.tomland copiesspawn-price-gate.pynext to the guard script. The handler timeout is 5 seconds.- The matcher is the list
spawn_agent|collaborationspawn_agent. The installer adds the name for a customtool_namespaceof multi-agent v2. A hyphenated namespace is not read, so the matcher stays the default list, and the guard's own doctor note already reports that case. The installer writes the matcher once, from thetool_namespaceof your user config only, but Codex reads that key from the merged configuration. If a trusted repository sets a differenttool_namespace, or you change it after the install without re-running the installer, the tool is renamed, the matcher misses and the hook never runs.--doctorstill printsok: hook spawn-price-gatein that case. A repository setting[features] hooks = falseturns the hook engine off in the same way. Matching thespawn_agentsuffix with a regex matcher would remove the namespace dependency. g2 does not do this. - Codex runs the hook only after you trust it. After an install prints
spawn-price-gate changed: re-trust it in Codex's hooks review, review and trust the hook again. A re-install that changes nothing prints no such line. --doctorprintsok: hook spawn-price-gatewhen the block, the script and the matcher are in place. It compares the installed matcher with the list that the gate template composes for the namespace baked into the guard command, and printsmissing:when they differ. This line does not show trust.- The hook fails open. A crash, a timeout, a parse failure, an unknown role or any other exception allows the spawn. The only deny is a proven FT priced role with a defective pick. Codex also treats every hook error as allow.
- One failure blocks instead. If the installed script
spawn-price-gate.pyis missing, for example after a restore of the configuration, the interpreter exits with code 2. Codex treats this as a block of every matchedspawn_agentcall, pinned roles included. Trust covers the hook declaration and not the script bytes, so the gate stays trusted.--doctorprintsmissing: hook spawn-price-gate (re-run the installer). Re-runinstall-codex.shto restore the script. The guard script has the same exposure. - The gate never checks a user-authored role. A role without the FT marker is not gated.
- The setting
expose_spawn_agent_model_overrides = falsehides both fields from the tool schema only. The model can still send them, and the gate checks them. A dispatcher must name both fields even when the schema does not list them.
What still decides the spend of a priced role
Savings from a lower pick are unmeasured: no Codex run and no luna run on low exists in this toolkit. The table has two parts. The first part lists the paths that the gate bounds when you trust it. The second part lists the paths that stay open.
| Path | What happens |
|---|---|
| A pick above the tier map | Bounded when trusted. The Codex catalog lists larger models and efforts above high, and spawn_agent accepts them. The gate denies the call. If the hook is not trusted, the value applies. |
| A model without an effort, or an effort without a model | Bounded when trusted. The gate denies a half pick. Without the gate, a model alone runs on its default effort, which is low for gpt-5.6-sol, or on default_subagent_reasoning_effort when set. An effort alone runs on default_subagent_model when set, otherwise on the model of the spawner. |
| Both fields omitted | Bounded when trusted. The gate denies the call, so default_subagent_model, default_subagent_reasoning_effort and the model of the spawner never apply to a gated role. The registry suffix tells every spawner to name both fields, so a compliant spawner meets no deny. A spawner that ignores the suffix pays one extra model turn for each deny. Without the gate, the role runs on the model and effort of the spawner. The dispatcher runs on gpt-5.6-sol on high. ft-doc-writer-agent runs on gpt-5.6-terra on high and starts ft-ui-ux-design on the same values. |
| A configured default | Bounded when the gate runs, because a gated role never reaches the default. If the gate does not run, for example under a repository-set tool_namespace (see the rows below), the default applies. Without the gate, the keys default_subagent_model and default_subagent_reasoning_effort in the [agents] table apply when a call omits a field. Your user config or the committed .codex/config.toml of a trusted repository can set them. The doctor prints a note for each key (N2, N3, N5). |
No fields in spawn_agent | Bounded when trusted. With multi-agent v2, expose_spawn_agent_model_overrides = false under [features.multi_agent_v2] removes both fields from the schema. The default is true. The model can still send both fields. The gate treats the call like any omission and denies it until both fields are named. The doctor prints a note for this setting (N1, N5). |
| A pick inside the tier map but too cheap | Open. A spawner can choose a cheap tier for a hard task, for example after text in a ticket says the task is trivial. The gate allows every pick inside the tier map, and no oracle checks the quality of the pick. |
| The gate is untrusted, disabled or failing | Open. Codex runs no hook that you have not trusted, and the gate fails open. A crash, a timeout of 5 seconds, a parse failure, an unknown role or any other exception allows the spawn. For that spawn, picks are unbounded in both directions. |
| A role redefined by a trusted repository | Open. The .codex/config.toml of a trusted repository can redefine [agents.<role>] config_file of a priced role. The role layer applies after the pick and overrides it. The gate reads only the agents directory of CODEX_HOME. |
| Another hook that rewrites the pick | Open. Another trusted PreToolUse hook can rewrite model with updated_input after the gate ran. The gate does not see the rewrite. |
A tool_namespace that the matcher does not know | Open. The installer writes the matcher from the user-layer tool_namespace only, and Codex reads the merged configuration. A trusted repository that sets a non-default tool_namespace, or a namespace that you set after the install, renames the tool. The matcher misses and the hook never runs, while --doctor still prints ok: hook spawn-price-gate. A repository with [features] hooks = false turns the hook engine off, in the same trust class. |
A hyphenated tool_namespace | Open, the same class as the row above. The matcher falls back to the default list, so the gate does not run for a hyphenated namespace of multi-agent v2. The guard's doctor note reports this case. |
| The gate script is missing | Blocks, not open. Every matched spawn_agent call is blocked until you re-run the installer. See the list above. |
| A built-in or unknown role | Open. The gate checks only FT priced roles. A pick through a built-in role without a pin, such as default, worker or explorer, is not gated. |
The sandbox_mode key is a marker, not a sandbox
The toolkit declares least privilege once, in the tools: allowlist of the agent frontmatter. The renderer reads that list and keeps no second roster of read-only agents. The result is a sandbox_mode key in each TOML file. Codex does not apply that key to a spawned role: the role runs with its parent's sandbox. The installed readonly-role-guard hook reads the key as a marker. The table below lists what stops a read-only role and what does not.
1. Read the frontmatter
The renderer reads only thetools:key of the agent file.2. Is the key there?
Without the key, the agent inherits all tools.- NO
workspace-write - YESContinue at step 3.
- NO
3. Does it grant a write tool?
The write tools areWrite,EditandNotebookEdit.- YES
workspace-write - NO
read-only
- YES
4. Does a protected agent keep the marker
read-only?READ_ONLY_FLOORin the renderer lists the three reviewers. Every other agent passes.- YESThe TOML is written.
- NOThe render stops with an error.
The key that the 15 agents get
- 3
read-only: an allowlist with no write toolThe reviewers. They check work. Their shell writes nothing by instruction only.ft-architecture-auditft-test-adversaryverifier - 1
workspace-write: an allowlist with a write toolIts allowlist grantsWriteandEdit.ft-doc-writer-agent - 11
workspace-write: notools:keySeven of them carry adisallowedTools:list. The renderer does not read it.bugfix-agentft-angular-coding-agentft-coding-agentft-developerft-fix-hostft-java-coding-agentft-opsft-python-coding-agentft-sddft-ui-ux-designrefactor-agent
grep sandbox_mode codex/agents/verifier.toml
sandbox_mode = "read-only"
A reviewer with a write tool would be a privilege escalation. The error says to fix the allowlist and not to widen the projection. So the TOML file of a reviewer never says workspace-write. The key is still only a marker for the guard.
On Codex a spawned role runs with its parent's sandbox. Two things limit a read-only role, and the table below says what each one stops. The role [features] table removes the tools of apps, plugins, memories and permission requests. It holds without trust. The installed readonly-role-guard hook denies apply_patch, shell-routed apply_patch, and spawning or messaging other agents through the multi-agent tools. This works in the v1 namespace, in the default v2 namespace collaboration, and in a namespace set with [features.multi_agent_v2] tool_namespace. The hook also denies every mcp__ tool that the tools: list of the role does not name, and the tools in the list of denied names. The hook has effect only after you trust it in the hooks review of Codex.
The shell of a read-only role writes nothing by instruction only, as Bash does on Claude Code. The OS sandbox of the parent stops some shell writes and not others. A denied call returns the reason "put findings in your final report". A role that needs a mutating command returns BLOCKED with the exact call.
On Codex, verifier can be the executor only in a worktree inside the writable roots of the parent, created by the parent. The child cannot write the top-level .git or the gitdir of the worktree, so it cannot run git worktree add. It reverts the fix with git apply -R or a file copy, and never with git checkout, git restore, git stash or git add. See the quality pipelines reference.
- The denials of the guard are inactive until you trust the hook. They are inactive again after an install that changes the guard, its matcher or its timeout. The installer then prints a re-trust line once. The anchored matcher of the current guard is such a change, so trust drops once on an upgrade. The role
[features]hold regardless of trust. A change of the matcher, the command or the timeout counts, for example a differentpython3,CODEX_HOME, agents directory or namespace. A user hook group that you add above our block also shifts the index of the guard, and the doctor then shows the no-trust note. The installer never moves your groups. The doctor prints a note about trust, never printsokfor it, and exits with 0. Open Codex's hooks review to trust the hook. The menu path in Codex is unverified. - A config installed from the earlier branch layout, with the hook inside the agents block, moves the hook once. That can shift the index of a later user group, so re-trust it.
- Codex lets a call run when the hook crashes or times out (fail-open). The timeout is 5 seconds. The guard denies a command longer than 65,536 characters without reading it, so that the length of a command does not run the guard into the timeout. The guard also denies a hook input that it cannot parse (not UTF-8 JSON, or nested too deep) for every caller, because such an input names no role it could clear. The spawn gate allows that input.
- The guard denies a shell script that names
apply_patchorapplypatchand later contains<<followed by a non-empty line, in any form: a heredoc opener, but also a<<<here-string or a run of<, because Codex's parser recovers from errors, so the guard reads the raw text and does not predict the parse. It also denies a shell script that runsapply_patch, also behind leading assignments (A=1,A+=1,a[0]=1; not one whose subscript holds an operator or a nested bracket, see below), redirections, comments, line continuations,env,command,exec,eval,nohup,nice,time,casearms, a path such as./apply_patch, and nestedbash -cwrappers up to 4 deep. The command name matches in any letter case: a case-insensitive file system runsAPPLY_PATCHas the same binary. It also denies a script that it cannot parse, with the reasonBash script (cannot parse). These cases still run:- Shell writes other than
apply_patch: redirection,sed -iandcp. Inside a writable root nothing stops them. Elsewhere only the OS sandbox of the parent stops them, as the table says. A reviewer shell can change the TOML files or the guard only where the table says that the sandbox does not hold. - With no heredoc after the name:
apply_patchbehindsudo,xargs,timeout,setsidor another wrapper that the guard does not list. - With no heredoc after the name: a string built at run time, for example
eval "...", and a$(apply_patch ...)inside a double-quoted string. - With no heredoc after the name:
bash -c -- '...'andbash -o posix -c '...'. The guard does not unwrap a shell when an option after the wrapper is not an option cluster ending inc. - With no heredoc after the name: a name assembled at run time, for example
a${X}pply_patch. - With no heredoc after the name:
apply_patchbehind an assignment whose subscript holds an operator, a nested bracket, a newline or a quoted or escaped bracket, for examplea[1;2]=1 apply_patch x,a[b[0]]=1 apply_patch xora[']']=1 apply_patch x(bash 5). The guard reads a subscript only up to the first operator or bracket, so that a prefix never crosses a statement boundary. - With no heredoc after the name: an empty expansion in front of the name or glued to it, for example
$x apply_patch x,${x}apply_patch xorapply_patch$x y; a carriage return, form feed or vertical tab glued to a leading assignment or redirection, for exampleA=1\f apply_patch x; an escaped blank as a redirection target or glued to a substitution, for example> \ apply_patch x,>&\ apply_patch xorA=$(true)\ y apply_patch z; and an expansion in front of a>|redirection, for example$x >|f apply_patch y. The current scan and the scan of the guard's first release both allow these, so the base scan kept inside the guard cannot deny them either. - A shell nested deeper than 4 wrappers.
- A multi-line script that names
apply_patchorapplypatchand later contains<<followed by a non-empty line, also across lines and inside quotes, comments or heredoc bodies. Examples: a two-linerg "apply_patch <<", a python heredoc that prints the name, a script that names the tool before its own heredocs. - After such a name, a
<<<here-string,<<in$((1 << 3))or<<=, read as a heredoc. A single-linerg apply_patch <<<xstill runs: no line follows it. - A line of an unquoted heredoc body that reads as
apply_patch. - With the reason "cannot parse":
$((1 << 3))elsewhere; a comment that contains a backtick, for examplels # see `git log`; a#glued to a closing)of a subshell orcasearm, for example(echo a)#; a comment line that ends in)\followed by another comment line, for example# a)\and# bon the next line; a double-quoted$(...)that contains both a double quote and an apostrophe; and any command longer than 65,536 characters (64 KiB), whatever it contains, because the guard does not read it. - The name right after the
|of a redirection operator:>|,<|,>>|,&>|,<<<|,<>|,>&|,<&|,2>|or&>>|. Also the name as a path, or behind an assignment or keyword, after that|. Examples:echo x >| apply_patch(which writes a file named apply_patch),echo a>>|apply_patch x(a syntax error),echo x >| ./apply_patch,echo x >|A=1 apply_patch yandecho x >|eval apply_patch. None of them runs the binary. The guard keeps the scan of its first release inside itself, so that no repair can lose a denial that release made, and that scan reads this|as a pipe. With no command in front,>|A=1 apply_patch xdoes run the binary, so that denial is correct. - The name after a blank escaped twice,
\ \ apply_patch x, or after a form feed and a comment sign joined to it by a line continuation. To bash each is one command word, and no such command exists. The same kept scan reads them as the name.
<role> is read-only (FT): spawn_agent denied; put findings in your final report.or<role> is read-only (FT): apply_patch denied; put findings in your final report.The third reason is the tool line:<role> is read-only (FT): shell apply_patch denied; put findings in your final report.,<role> is read-only (FT): Bash script (cannot parse) denied; put findings in your final report.or<role> is read-only (FT): tool <tool_name> denied, do not retry; put findings in your final report.The "cannot parse" above is the second reason. The third line is the one for MCP and effect tools. Codex wraps each line asTool call blocked by PreToolUse hook. Recovery from a false deny: run the command that names the tool and the command with the heredoc or here-string as two separate calls; drop the backtick from the comment; put a blank between)and#; split a command over the length limit into shorter calls. - Shell writes other than
close_agentandinterrupt_agentstay allowed.- The guard denies a tool whose name starts with
codex_app,codex_tuiorcloud_threads. A spawned child inherits such client-defined tools only with multi-agent v2 and the featuremulti_agent_v2_dynamic_tools, which is under development and off by default. A client-defined tool with another prefix is not denied. - Four paths have no hook or no denial:
write_stdininto a shell (no hook by design), hostedweb_search(server side), the code-modeexectool (off by default) and tools that a later Codex release adds. The deny list is a census of release rust-v0.167.0. - The format of an MCP tool name,
mcp__<server>__<tool>with every other character replaced by_, comes from the test of Codex and has not been observed. If it is wrong, or a hash suffix, a hyphen at the edge of a name or another server name changes it, the guard reads a listed tool as unlisted and denies it. That failure is visible and safe only while the name keeps the lowercasemcp__prefix. The anchored, case-sensitive matcher never offers a name without that prefix to the guard. - The guard runs on every shell and MCP call of every Codex agent, about 30-60 ms median on the measured host, plus the login-shell profile. A slow profile counts against the 5 second timeout.
- The permission profile of the parent limits the shell of the child only as the table lists.
- A guard interpreter inside a workspace virtual environment is writable under
workspace-write. Install from a system Python. - The guard supports POSIX only. There is no Windows Codex installer.
- Codex strips the spawned role name (
agent_type) before it builds the hook payload (codex-rshook_runtime.rslines 1095-1101 andthread_spawn.rslines 138-141 at rust-v0.167.0). The guard matches the role name exactly and relies on that. Re-check those two places on every Codex upgrade. - No live Codex run is verified. The behavior is verified in the Codex source, releases rust-v0.166.0 and rust-v0.167.0.
What stops a read-only reviewer on Codex
Read the table for a role such as verifier under workspace-write. The first column is the action. The second column names what stops it. The third column says when it does not hold.
| Path | Stopped by | Does not hold when |
|---|---|---|
The apply_patch tool, shell-routed apply_patch in the forms the guard reads, and delegation to other agents | The guard, once you trust it | The hook crashes or times out. The form is in the list of cases that still run. A shell is fed through write_stdin, which has no hook. |
An MCP tool outside the role's tools: list, the MCP resource tools and the effect tools of the denied list | The guard, once you trust it | The hook crashes or times out. Hosted web_search has no hook. |
The tools of apps and plugins, the memory tools and the request_permissions tool | The role [features] table: apps, plugins, memories and request_permissions_tool, all false. No trust is needed. | Never: it always holds. It does not remove require_escalated, which a shell call can still carry. |
A shell write inside a writable root: the workspace, /tmp, $TMPDIR, the folders in writable_roots and a nested sub/.git | Nothing. The instruction stops it, as for Bash on Claude Code. | Always open. |
A shell write elsewhere, including a default ~/.codex with the role TOML files and the guard | The OS sandbox of the parent, on read-only or workspace-write | The parent runs on danger-full-access. You approve a command with require_escalated. A command matches an exec-policy allow rule in any loaded config folder, including a rule that a "don't ask again" approval added. A CODEX_HOME lies inside a writable root. |
A shell write to the top-level .git, .codex, .agents or .aws of a writable root, and to the gitdir of a linked worktree | The OS sandbox of the parent, as in the row above | The same cases as in the row above. |
Scope The sandbox rows come from the macOS Seatbelt code of Codex. The Linux sandbox was not read. A parent on read-only stops every shell write, but that parent cannot do its own work, so the toolkit does not recommend it.
The tool names that the guard denies
- Every name that starts with
mcp__,codex_app,codex_tuiorcloud_threads, unless the name is in thetools:list of the role. Onlymcp__names can be listed. - These exact names, always:
list_mcp_resources,list_mcp_resource_templates,read_mcp_resource,multi_env_copy_file,image_genimagegen,webrun,create_goal,update_goal,noteswrite_fileandnotesappend_to_file. - The matcher of the hook is an anchored regular expression that fires on these names, on the delegation names, on
apply_patchand onBash, and on no other name. The installer builds the same string and stops if the string is malformed. - The allowed
mcp__names sit in one comment line of the role file,# ft-readonly-allowed-tools:. The renderer writes it from thetools:frontmatter, with every character outside letters, digits and_replaced by_. A role file without that line has no allowedmcp__tool.
If the guard denies your call
- For an
mcp__tool, add the exact tool to thetools:list of the agent inagents/<name>.md, run the installer again, or do without the tool. - You cannot grant any other denied tool to a read-only role.
- A reviewer that needs a mutating command returns
BLOCKEDwith the exact call.
Why the toolkit ships no shell floor
The toolkit ships no shell floor. A role file can only switch the shell tool off, and a reviewer with no shell cannot read files or run its checks. A wrapper that runs every command of a reviewer in a read-only profile exists on paper. It has not been run on Codex, so the toolkit does not install it. If you need a hard floor, run the reviewer as its own codex exec --sandbox read-only session. That session is not a spawned role: it has no spawn_agent dispatch and no context of the parent.
Differences from the Claude Code install
Open a row to read both sides. Four rows are weaker in Codex, and only two hooks run there.
| Topic | Claude Code | Codex |
|---|---|---|
Hooks and gates
| Claude Code: installed | Codex: two hooks, no ring |
RulesClaude Code loads a rule when a file matches | Claude Code: installed | Codex: by hand |
MCP servers
| Claude Code: installed | |
Windows installer
| Claude Code: installed | |
Agent definitionsClaude Code reads Markdown with frontmatter. Codex reads generated TOML. | Claude Code: installed | Codex: installed |
Least privilegeClaude Code uses the | Claude Code: installed | Codex: installed, hook denials active after you trust it |
the install gives you this you do it by handEmpty: not there
No gate hook runs, so Codex has no price gate or context guard. The agent text still describes those rules, and nothing enforces them. The one installed hook, readonly-role-guard, only limits read-only roles.
In Codex, you name what must run
Rules never load by themselves, and six skills never start by themselves. Name them in your prompt.
autoreviewft-devft-fixft-image-rollout-verificationft-refactortr069-walk-benchmarkclickhouse-iocwmp-xmlft-angular-standardsfriendly-branded-docsft-decideft-docker-standardsft-guide-pageft-java-standardsft-python-standardsgrafana-dashboard-snapshotiot-fleet-engineerobsidian-knowledge-vaultoma-lwm2m-expertperformance-engineerreceiving-code-reviewspringboot-tddspringboot-verificationtr69hostif-issue-triageacs-fresh-resetft-docsft-jiraft-ux-auditft-watchsdd-authoringOrange outline: explicit-only. Dashed outline: this repository holds the skill, and Codex does not receive it.
You want a rule to apply → name the rule in your prompt
Codex does not auto-load rules. Claude Code loads a rule on a paths: match, and Codex has no such trigger. For each rule with a paths: header, the renderer removes the frontmatter and adds this note at the top: "Codex: Rules are not auto-loaded. Your prompt named this rule, so it applies to the work at hand regardless of file type." A rule without paths: stays unchanged. Today all 22 rule files have the header.
You want an explicit-only skill → name the skill in your prompt
These six skills must never start on their own. For each one, the renderer writes agents/openai.yaml with this policy:
You want a Word document from ft-sdd → use Claude Code
ft-sdd writes a Word document through friendly-branded-docs, which the Codex install ships. word-pages.py finds friendly-branded-docs in the skills folder next to the folder that holds ft-sdd ($CODEX_HOME/skills or ~/.claude/skills), and falls back to ~/.claude/skills. The build and the file check run anywhere; the page-image check needs real Word (Windows or macOS), so a Codex-only Linux host gets a draft, exit code 3.
You want to change an agent → edit agents/<name>.md
The TOML is generated, so do not edit it by hand. Change the Markdown file, then run deploy/scripts/install-codex.sh again.
What the skill renderer changes in each skill
- It keeps only these frontmatter keys:
allowed-tools,description,license,metadataandname. - It replaces the description of
ft-docker-standards,ft-fixandft-refactorwith a Codex-specific text. - It rewrites
~/.claude/...paths in the skill body to the Codex paths. The agent table lists them.
Where to go next
Use the Codex install next to the Claude Code one, or test the installer itself.
readonly-role-guard.