Codex Subagent
Overview
Description from the maker (original English)
Delegate coding tasks to the OpenAI Codex CLI, installed separately, with explicit model and effort.
What you can do with it
We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.
- Connection: Runs on your computer
- Transport: stdio
- Category: Developer tools
Install
Pick the AI app you use, then copy the settings.
Passed 2/2 checks · Runs on your computer
First: which AI do you use?
Pick your app and the steps appear below.
Works with Claude, with some setup first
You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
Install Node.js
One time only; it works for every server that needs Node.js
Sign up and create a Codex Subagent key
Open the maker’s site, sign up and create an API key for the next step. It may cost money.
Open the Claude desktop app’s settings file
SettingsDeveloperEdit Config
Paste these settings and save the file
{ "mcpServers": { "codex-subagent": { "command": "npx", "args": [ "-y", "codex-subagent-mcp" ], "env": { "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value", "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value", "CODEX_SUBAGENT_USAGE_LOG": "your-value", "CODEX_SUBAGENT_DEFAULT_MODEL": "your-value", "CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value", "CODEX_SUBAGENT_ALLOWED_MODELS": "your-value", "CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value", "CODEX_SUBAGENT_MAX_SANDBOX": "your-value", "CODEX_SUBAGENT_MAX_EFFORT": "your-value", "CODEX_SUBAGENT_MCP_SERVERS": "your-value", "CODEX_SUBAGENT_PLUGINS": "your-value", "CODEX_SUBAGENT_APPS": "your-value", "CODEX_BIN": "your-value" } } } }Paste the key only into the app’s field, never into a chat or to anyone
Quit Claude and open it again
Try it
Use Codex Subagent and tell me what you can do for me, then show me one thing✓ If Claude says it is using Codex Subagent or shows a Codex Subagent tool in the answer, you are connected
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
ChatGPT cannot connect Codex Subagent yet
Codex Subagent runs on your computer, but ChatGPT can only connect servers that run on the web
What you can do instead
A · Use an app that can connect Codex Subagent
- You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
- You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time)
- You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time)
- You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time)
B · Others in Developer tools that work with ChatGPT
Picked from the most used in the same category, only ones that connect by address with no key
- Sentry✓ ChatGPT
- Front-End Checklist✓ ChatGPT
- Compiler Explorer✓ ChatGPT
Works with Claude Code, with some setup first
You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time)
Install Node.js
One time only; it works for every server that needs Node.js
Sign up and create a Codex Subagent key
Open the maker’s site, sign up and create an API key for the next step. It may cost money.
Open Terminal
Mac: press Command+Space and type Terminal · Windows: open PowerShell
Paste this command and press Enter
claude mcp add codex-subagent --env CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR=your-value --env CODEX_SUBAGENT_MAX_BACKGROUND_JOBS=your-value --env CODEX_SUBAGENT_USAGE_LOG=your-value --env CODEX_SUBAGENT_DEFAULT_MODEL=your-value --env CODEX_SUBAGENT_DEFAULT_EFFORT=your-value --env CODEX_SUBAGENT_ALLOWED_MODELS=your-value --env CODEX_SUBAGENT_DEFAULT_SANDBOX=your-value --env CODEX_SUBAGENT_MAX_SANDBOX=your-value --env CODEX_SUBAGENT_MAX_EFFORT=your-value --env CODEX_SUBAGENT_MCP_SERVERS=your-value --env CODEX_SUBAGENT_PLUGINS=your-value --env CODEX_SUBAGENT_APPS=your-value --env CODEX_BIN=your-value -- npx -y codex-subagent-mcpReplace “your-value” with your key before pressing Enter
Paste the key only into the app’s field, never into a chat or to anyone
Type /mcp in Claude Code
You should see Codex Subagent listed as connected
Try it
Use Codex Subagent and tell me what you can do for me, then show me one thing✓ If Claude Code says it is using Codex Subagent or shows a Codex Subagent tool in the answer, you are connected
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with Cursor, with some setup first
You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time)
Install Node.js
One time only; it works for every server that needs Node.js
Sign up and create a Codex Subagent key
Open the maker’s site, sign up and create an API key for the next step. It may cost money.
Fill in your key
In the Codex Subagent settings, CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR, CODEX_SUBAGENT_MAX_BACKGROUND_JOBS, CODEX_SUBAGENT_USAGE_LOG, CODEX_SUBAGENT_DEFAULT_MODEL, CODEX_SUBAGENT_DEFAULT_EFFORT, CODEX_SUBAGENT_ALLOWED_MODELS, CODEX_SUBAGENT_DEFAULT_SANDBOX, CODEX_SUBAGENT_MAX_SANDBOX, CODEX_SUBAGENT_MAX_EFFORT, CODEX_SUBAGENT_MCP_SERVERS, CODEX_SUBAGENT_PLUGINS, CODEX_SUBAGENT_APPS, CODEX_BIN is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Open the AI chat in Cursor in Agent mode
Try it
Use Codex Subagent and tell me what you can do for me, then show me one thing✓ If Cursor says it is using Codex Subagent or shows a Codex Subagent tool in the answer, you are connected
Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with VS Code, with some setup first
You need a Codex Subagent key (sign up on the maker’s site, may cost money) · Install Node.js on your computer first (one time)
Install Node.js
One time only; it works for every server that needs Node.js
Sign up and create a Codex Subagent key
Open the maker’s site, sign up and create an API key for the next step. It may cost money.
Fill in your key
In the Codex Subagent settings, CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR, CODEX_SUBAGENT_MAX_BACKGROUND_JOBS, CODEX_SUBAGENT_USAGE_LOG, CODEX_SUBAGENT_DEFAULT_MODEL, CODEX_SUBAGENT_DEFAULT_EFFORT, CODEX_SUBAGENT_ALLOWED_MODELS, CODEX_SUBAGENT_DEFAULT_SANDBOX, CODEX_SUBAGENT_MAX_SANDBOX, CODEX_SUBAGENT_MAX_EFFORT, CODEX_SUBAGENT_MCP_SERVERS, CODEX_SUBAGENT_PLUGINS, CODEX_SUBAGENT_APPS, CODEX_BIN is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Open the AI chat in VS Code in Agent mode
Try it
Use Codex Subagent and tell me what you can do for me, then show me one thing✓ If VS Code says it is using Codex Subagent or shows a Codex Subagent tool in the answer, you are connected
Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version
For developers: Terminal commands and JSON settings
Installed on your computer
Claude Code
claude mcp add codex-subagent --env CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR=your-value --env CODEX_SUBAGENT_MAX_BACKGROUND_JOBS=your-value --env CODEX_SUBAGENT_USAGE_LOG=your-value --env CODEX_SUBAGENT_DEFAULT_MODEL=your-value --env CODEX_SUBAGENT_DEFAULT_EFFORT=your-value --env CODEX_SUBAGENT_ALLOWED_MODELS=your-value --env CODEX_SUBAGENT_DEFAULT_SANDBOX=your-value --env CODEX_SUBAGENT_MAX_SANDBOX=your-value --env CODEX_SUBAGENT_MAX_EFFORT=your-value --env CODEX_SUBAGENT_MCP_SERVERS=your-value --env CODEX_SUBAGENT_PLUGINS=your-value --env CODEX_SUBAGENT_APPS=your-value --env CODEX_BIN=your-value -- npx -y codex-subagent-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"codex-subagent": {
"command": "npx",
"args": [
"-y",
"codex-subagent-mcp"
],
"env": {
"CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value",
"CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value",
"CODEX_SUBAGENT_USAGE_LOG": "your-value",
"CODEX_SUBAGENT_DEFAULT_MODEL": "your-value",
"CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value",
"CODEX_SUBAGENT_ALLOWED_MODELS": "your-value",
"CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_EFFORT": "your-value",
"CODEX_SUBAGENT_MCP_SERVERS": "your-value",
"CODEX_SUBAGENT_PLUGINS": "your-value",
"CODEX_SUBAGENT_APPS": "your-value",
"CODEX_BIN": "your-value"
}
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"codex-subagent": {
"command": "npx",
"args": [
"-y",
"codex-subagent-mcp"
],
"env": {
"CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value",
"CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value",
"CODEX_SUBAGENT_USAGE_LOG": "your-value",
"CODEX_SUBAGENT_DEFAULT_MODEL": "your-value",
"CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value",
"CODEX_SUBAGENT_ALLOWED_MODELS": "your-value",
"CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_EFFORT": "your-value",
"CODEX_SUBAGENT_MCP_SERVERS": "your-value",
"CODEX_SUBAGENT_PLUGINS": "your-value",
"CODEX_SUBAGENT_APPS": "your-value",
"CODEX_BIN": "your-value"
}
}
}
}VS Code (mcp.json)
{
"servers": {
"codex-subagent": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"codex-subagent-mcp"
],
"env": {
"CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "your-value",
"CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "your-value",
"CODEX_SUBAGENT_USAGE_LOG": "your-value",
"CODEX_SUBAGENT_DEFAULT_MODEL": "your-value",
"CODEX_SUBAGENT_DEFAULT_EFFORT": "your-value",
"CODEX_SUBAGENT_ALLOWED_MODELS": "your-value",
"CODEX_SUBAGENT_DEFAULT_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_SANDBOX": "your-value",
"CODEX_SUBAGENT_MAX_EFFORT": "your-value",
"CODEX_SUBAGENT_MCP_SERVERS": "your-value",
"CODEX_SUBAGENT_PLUGINS": "your-value",
"CODEX_SUBAGENT_APPS": "your-value",
"CODEX_BIN": "your-value"
}
}
}
}Values you fill in
CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOURenvDelegation and follow-up processes per rolling hour: decimal integer 1 to 9007199254740991; unset means unrestricted. In memory per server; probes never count.CODEX_SUBAGENT_MAX_BACKGROUND_JOBSenvCap on running background jobs: decimal integer 1 to 8 (default 8). Blocking calls do not use this cap.CODEX_SUBAGENT_USAGE_LOGenvOpt-in local usage log: on or off (default off). Records counts and settings, never prompts, code or paths; labels are caller text.CODEX_SUBAGENT_DEFAULT_MODELenvModel used when a call names none. Unset: the only entry of a single-entry CODEX_SUBAGENT_ALLOWED_MODELS, otherwise a call without a model is refused with a suggestion.CODEX_SUBAGENT_DEFAULT_EFFORTenvReasoning effort used when a call specifies none: none, minimal, low, medium, high, xhigh, max or ultra. Unset: the model's own default. Cannot exceed CODEX_SUBAGENT_MAX_EFFORT.CODEX_SUBAGENT_ALLOWED_MODELSenvComma-separated allow-list of model slugs; anything else is refused. Unset: unrestricted. A single entry acts as the default model; an empty entry is a configuration error.CODEX_SUBAGENT_DEFAULT_SANDBOXenvSandbox used when a call specifies none: read-only, workspace-write or danger-full-access. Defaults to read-only and cannot exceed the ceiling.CODEX_SUBAGENT_MAX_SANDBOXenvCeiling on what a delegation may do: read-only, workspace-write or danger-full-access. Defaults to workspace-write; danger-full-access must be set explicitly.CODEX_SUBAGENT_MAX_EFFORTenvCeiling on reasoning effort: none, minimal, low, medium, high, xhigh, max or ultra. Unset: unrestricted. Higher efforts are lowered to a supported level, or refused if none fits.CODEX_SUBAGENT_MCP_SERVERSenvMCP servers from Codex's config a delegation keeps: none (default), all, or comma-separated names.CODEX_SUBAGENT_PLUGINSenvInstalled Codex plugins a delegation keeps: none (default), all, or comma-separated name@marketplace ids.CODEX_SUBAGENT_APPSenvWhether a delegation keeps Codex's apps (connectors to external services): off (default) or on.CODEX_BINenvCodex executable name or path. Unset: codex, searched on PATH. On Windows it must run directly, such as codex.exe; a .cmd or .bat shim is refused.
These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
At a glance
- Downloads per weeki
- 95/wk
- Connection
- Runs on your computer
- Transport
- stdio
- Latest versioni
- 0.6.0
- Categoryi
- Developer tools
- Published to registryi
- Oct 21, 2026
- Code last changedi
- Nov 3, 2026
- Maker
- parisbs
- Packages
npm: codex-subagent-mcp- Website
- github.com
- Registry status
- Active
Which apps can use it
Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.
Run on your computer in
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
Related guides
What it can do
Runs on your computer; the tool list appears in your AI app after you install it.
Basic checksi
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 11, 2026
- ✓ Pass
Maker matches the repo
The registry name was verified with the GitHub account parisbs, which owns the repo
- ✓ Pass
Still maintained
Code last changed 8 days ago
- … Not checked yet
Has a licence
We have not read this repo from GitHub yet
- – Not applicable
Endpoint responds
This one runs on your computer; there is no internet endpoint
- – Not applicable
Sign-in with OAuth
Runs on your computer and uses local settings instead
- … Not checked yet
No hidden instructions in tool descriptions
Runs on your computer; we can only read tool lists from internet endpoints
Discussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
User reviews
No reviews yet
Compared with others in Developer toolsi
- More stars than 0% of the other 5756 servers in this category
- Published to the registry more recently than 57% of the other 5756 servers in this category
- Basic checks equal to or better than 100% of the other 5756 servers in this category
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
Common questions
Is Codex Subagent safe?
It passed 2 of 2 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
What keys or codes does it need?
The registry does not list a required key, though some servers ask you to sign in on first use.
Does it run on my computer or in the cloud?
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
Is it still maintained?
The GitHub repo last changed 8 days ago, and the latest version (0.6.0) reached the registry 21 days ago.
Which apps can use it?
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Node.js on your computer.
What can I use instead?
In the same category: REA, Netdata, Front-End Checklist
Alternatives
Servers in the same category from other makers, sorted by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
README from the maker
Open the README
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
codex-subagent-mcp
An MCP server that lets Claude Code delegate coding tasks to OpenAI's Codex CLI running on the same machine, with the model and reasoning depth chosen per task. Claude stays the orchestrator. Codex becomes a subagent it can call.
An independent project. Not affiliated with, endorsed by, or supported by OpenAI or Anthropic.
Quick start
Requires Node.js 22+ and the [Codex CLI](https://developers.openai.com/codex/cli) installed, on PATH, and signed in.
claude mcp add codex-subagent -- npx -y codex-subagent-mcp
Ask Claude to run codex_doctor if anything is missing. See [docs/INSTALL.md](docs/INSTALL.md) for platform setup, Claude Desktop and other installation options, and Safety before enabling writes.
What you get
- You pick the model and the reasoning effort per task, from the catalog your Codex CLI reports live.
- Read-only by default, with a sandbox ceiling no tool call can exceed.
- Every finished delegation checks the model, effort, sandbox and directory it asked for against what Codex recorded for the run, and says when they differ or could not be confirmed.
- Optional
output_schemareturns JSON that matches your schema, for results Claude can act on directly. - Cancelling, timing out or shutting down stops Codex and the commands it started that the server can still find; a command that detached from that process tree can outlive it.
A real read-only delegation asking for the package name, captured 2026-09-30:
codex-subagent-mcp
Commands run (1 total):
- [exit 0] /bin/zsh -lc "sed -n '1,80p' package.json"
model=gpt-5.6-luna | effort=low | sandbox=read-only | working_dir=/Users/you/project | applied=confirmed | duration=8s | tokens=in 35701 (cached 28160, uncached 7541) / out 88 (reasoning 9) | thread_id=01a0f419-9fd2-79e2-8248-91436f04e297
Why this exists
A single model doing everything has three recurring problems, and delegation solves each one:
Your context window is finite. Having Claude read forty files to answer one question spends context you need for the actual work. Delegating the investigation returns the answer instead of the forty files.
One model has one set of blind spots. A second opinion is worth most when it comes from a different model family — different training, different failure modes. Asking the same model twice mostly gets you the same answer twice.
Not every task deserves the same reasoning budget. Renaming a variable and diagnosing a race condition are not the same job. Here they are separate dials: the *model* sets raw capability, the *reasoning effort* sets how long it deliberates. Cheap work goes to a fast model; a hard problem gets the capable one thinking for as long as it needs.
The server runs on your machine and drives the Codex CLI you already have installed; it holds no credentials of its own. Prompts reach OpenAI through Codex, exactly as when you run codex yourself.
See How it compares for a versioned comparison with other Codex MCP servers.
Using it
Write a bounded delegation
A delegation gets expensive when repeated commands keep adding output to the context carried into later requests. Name the exact question, likely files, stopping condition and evidence the answer must contain; choose higher effort for ambiguity rather than by habit. [Writing a delegation](docs/DELEGATING.md) gives the measured cost model, ranked rules and weak-versus-strong examples using the real tool parameters. Background goes in context and a persona or extra rules in system_instructions, both layered on the built-in quality contract; see the tool reference.
Get a second opinion from a different model family
The value here is not a second run — it is a different set of blind spots.
Ask Codex to review
src/server.tsfor correctness problems, focusing on error paths. Use a high
reasoning effort and tell it to report each finding with the line and why it matters.
A delegated review like this found the terminate() defect in this repository's own runner: two code paths could each arm a timer while only one was ever cleared.
Investigate without spending your context
Forty files go into the delegation; one answer comes back. Codex runs its own searches and reads whatever it needs; your conversation receives the conclusion.
Have Codex trace how a reasoning effort travels from the MCP tool call down to the arguments
handed to the Codex CLI, and report just the call chain.
Run long work in the background while you keep going
Kick off a Codex run in the background that writes unit tests for
src/jobs.ts, then keep helping
me with the API layer.
You get a job_id immediately. Ask for the status whenever you want, and read the result when it is done. Up to eight can run at once; CODEX_SUBAGENT_MAX_BACKGROUND_JOBS can lower that cap. A background request cancelled before its job is created starts nothing.
Buy deep reasoning for one hard problem
Raising the reasoning effort for the whole conversation is expensive. Raising it for one delegation is not.
This intermittent test failure has beaten me twice. Ask Codex to work out the root cause at
maximum reasoning effort, give it
test/runner.test.tsand the CI log, and tell it not to change
anything — I want the diagnosis first.
Keep the thread going
Ask Codex to expand on its second finding.
Follow-ups reuse Codex's context, so they cost a fraction of the original. The server restates the same model, effort and directory on every follow-up because Codex itself does not keep them on resume.
Let it write, when you mean it
Have Codex apply its first two suggestions. Let it edit files, but keep it inside a git worktree
so my working tree stays clean.
use_worktree sends the run's edits to ~/.codex/worktrees/; results list the file changes Codex reported and where each landed, up to a thousand distinct entries, then report the omitted count, and a line names the worktree and the commit it was made from. Codex is told beforehand that uncommitted changes, untracked files and ignored files such as installed dependencies are not in it. The server does not clean worktrees up: they may hold unapplied work. The experimental feature is enabled only for that invocation; your Codex configuration is unchanged. A follow-up continues in the same worktree; when Codex's session file could not confirm where that was, the follow-up asks for working_dir rather than resume in your working tree. See Safety for the write boundary.
Whatever the sandbox, a delegation that writes reports the file changes Codex recorded. It is Codex's account, not a diff of the disk:
Files changed (2):
- [edit] src/codex/runner.ts
- [add] test/runner.test.ts
Safety
This server runs another program on your machine, so it is worth two minutes before you enable writes.
What protects you
Delegations are read-only by default. Writing requires an explicit sandbox: "workspace-write" or a user-set default. use_worktree sends edits to a managed git worktree instead of your checkout; the sandbox and add_dirs bound where it can write at all. Unsandboxed runs are unavailable unless you explicitly opt into that ceiling.
The confinement is the operating system's own sandbox: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows. The table was measured on macOS; SECURITY.md records the measurement details. Linux and Windows have not been measured here, and OpenAI's Windows documentation notes that sandboxed commands can fail to read some directories, so reads may be stricter there:
read-only | workspace-write | danger-full-access | |
|---|---|---|---|
| Write inside the working directory | no | yes | yes |
| Write outside it (your home) | no | no | yes |
| Network access | no | no | yes |
| Read outside the working directory | yes | yes | yes |
The server chooses the sandbox mode on every run; Codex's own sandbox_workspace_write settings, such as network access or extra writable roots, are not overridden and still apply under workspace-write. The table reflects Codex's defaults.
The sandbox confines the commands Codex runs in its shell. It does not confine MCP or plugin tools: those run as their own processes with your account's full permissions, network included, and under read-only a tool that declares itself read-only runs without approval (measured on codex-cli 0.159.2; ADR 16). So a delegation inherits no MCP server, plugin or app from your Codex setup unless you allow it in the server configuration, and every delegation result includes a line saying what the run was allowed.
There is no shell in the server's invocation path: the CLI is spawned with an argv array and the prompt is written to its stdin, never interpolated into a command string. Shell metacharacters in a prompt are inert.
What does not protect you
Reads are not confined. Codex can read anything your user account can, in every mode — your SSH keys, your cloud credentials. That was measured on macOS, and it is the safe assumption on every platform. Sandboxed network access is blocked so it cannot send them anywhere, but its report comes back to you, and that is a channel.
A prompt is untrusted input, and Codex acts on it. Content you did not write — an issue body, a web page, a log, a file from someone else's repository — can carry instructions. With workspace-write it can direct Codex to modify your repository; even read-only it can direct Codex to read something sensitive and put it in the answer. The sandbox bounds *where* Codex can write. It does not judge *what* it should write, or why it was asked. This is prompt injection, and it is the risk that matters here.
The result is not sanitised. What comes back is text from a model that just read your files. Treat it as data, not as instructions; review what a delegation did rather than assuming it did what you asked.
Reducing the risk
- Leave the built-in default alone. Read-only handles investigation, review and diagnosis, which is most delegation.
- If you never want writes, cap it:
CODEX_SUBAGENT_MAX_SANDBOX=read-only. No conversation can argue past a ceiling. Register it outside the repository (Claude Code's defaultlocalscope,--scope user, or Claude Desktop's config), not in a project.mcp.jsonthat a write-enabled delegation could edit. See Configuration. - When you enable writes, add
use_worktreeso changes land somewhere you can inspect before they touch your branch. - Allow MCP servers, plugins or apps in delegations only when a task needs them, and by name. An allowed one runs outside the sandbox, and with
auto_approveits tools need no approval at all. - Do not assemble delegation prompts from untrusted content when you intend to act on the answer.
- If this threat matters seriously to you, run Codex under an account or container with no access to your secrets. That solves it at the root instead of bounding it.
SECURITY.md has the full threat model, what a deny_read policy could add, and how to report a vulnerability.
Configuration
Everything is optional, and set through environment variables on the MCP server:
| Variable | Values | Default | Effect |
|---|
| `CODEX_SUBAGENT_DEFAULT_MO