Check your Codex config.toml and rules
Paste your config.toml, a rules file or both, and see what Codex may do without asking: rules that run commands outside the sandbox, a sandbox with holes, keys written into the file and settings that stop Codex from starting. Then copy the files back with the fixes you pick. Nothing leaves this page.
1Paste your Codex files
Everything runs in this page and nothing you paste is sent anywhere. There is no share link on purpose: config files can hold keys, and the checker only ever shows where a key is, never the key.
2What they let through
- 4 risks
- 6 checks
RiskA writable folder far wider than the project
writable_roots: "~/"Codex may write anywhere under this folder without asking, including shell startup files such as ~/.zshrc and other projects' code, which later run outside the sandbox. Add the one folder it needs instead.
RiskA key written into the file
mcp_servers.github.env.GITHUB_PERSONAL_ACCESS_TOKENAny program you run can read this file, and so can every command Codex runs: its sandbox limits writes, not reads. Keep it in the environment instead: env_vars for a server's variables, bearer_token_env_var or env_http_headers for an HTTP server, env_key for a model provider.
RiskAllowed outside the sandbox
line 2: git (allow)An allow rule runs the command outside the sandbox without asking, and this one covers every subcommand, including the ones that run scripts, publish or delete. Leave it to the sandbox, or make it prompt.
RiskAllowed outside the sandbox
line 6: python3 (no decision)An allow rule runs the command outside the sandbox without asking, and this one starts any program or script it is given, so it runs anything at all with your full access. The rule has no decision, and a missing decision means allow. Leave it to the sandbox, or make it prompt.
CheckA setting on its way out
approval_policy = "on-failure""on-failure" is deprecated. Use "on-request": commands run in the sandbox and Codex asks before leaving it.
CheckThe sandbox lets everything online
network_access = trueEvery command in the sandbox can reach the internet. A page, issue or file that steers Codex can then send your code or keys out with curl, and nothing asks. With network off, Codex asks before a command goes online.
CheckLive web search
web_search = "live"Live search reads pages as they are today, and any of them can carry instructions aimed at agents. With commands online too, such a page can get your files sent out. The default is cached.
CheckYour keys reach every command
[shell_environment_policy] (default)Codex keeps variables named like KEY, SECRET or TOKEN in every command it runs unless ignore_default_excludes is false, so any script, test or install step it starts can read your API keys. Set it to false and add back the one variable a command needs with set.
CheckAllowed outside the sandbox
line 4: npm test (allow)An allow rule runs the command outside the sandbox without asking, and this one runs code from the project, which Codex can change in the sandbox first: it writes the command into a test, script or commit hook, then this rule runs it outside. Leave it to the sandbox, or make it prompt.
CheckThe flag can come later
line 8: git push --force (forbidden)A rule matches the start of a command, word by word, so a flag written later slips past: "git push origin main --force" doesn't start with "git push --force". Forbid the shorter command too, or keep it in the sandbox.
The files, fixed
config.toml
default.rules
Save it over the file you pasted. Codex reads every .rules file in the rules folder, so a fixed copy beside the old one changes nothing.
What the checker looks for
It reads the files the way Codex does, following Codex’s rules documentation and its configuration reference, and every start-up error was checked against codex-cli 0.171 on 20 November 2026. It sees the files you paste: Codex also reads managed settings, a trusted project’s .codex folder and the flags you start it with, so check each file you use. It knows the common ways rules are written, not every one: a clean result is not proof, so run codex execpolicy check on the commands that matter to you.
| Option | For example | Why it matters |
|---|---|---|
| Rules that let commands out | For exampleprefix_rule(pattern = ["git"]), ["python3"] with no decision, ["curl", …] | Why it mattersAn allow rule runs the command outside the sandbox without asking, and a rule with no decision is an allow rule. |
| Rules that don't do what they say | For exampleAn allow for git push under a prompt for git, or a forbidden rule for git push --force | Why it mattersThe strictest matching rule wins, and a flag written later in the command slips past a rule that names it. |
| A sandbox with holes | For examplesandbox_mode = "danger-full-access", network_access = true, writable_roots = ["~"] | Why it mattersNo sandbox at all, a sandbox that lets every command online, or one that can write to your whole home folder. |
| Keys in the open | For exampleA token in mcp_servers.*.env, http_headers or a model provider; KEY and TOKEN variables in every command | Why it mattersKeys anyone with the file can read, and keys every script Codex starts can read. The checker names them and never shows them. |
| Settings that stop Codex | For exampleapproval_policy = "untrusted", profile = "fast", bearer_token on an HTTP server | Why it mattersSettings codex-cli 0.171 refuses at start-up, and the [profiles] tables it no longer reads. |
| Who answers | For exampleapprovals_reviewer = "auto_review", approval_mode = "approve", features.hooks = false | Why it mattersQuestions answered by something other than you, and an approval hook that never runs. |
Keep the questions, lose the waiting
Careful files ask more often. With the VariantGate hook, each shell command Codex runs waits in your inbox, and you answer from email, Slack, Teams, Discord or your phone. Free for one person and 100 requests a month, with no card.
Questions
What does a prefix_rule without a decision do?
Allow. Codex reads a prefix_rule without a decision as decision = "allow", and an allow rule runs the command outside the sandbox without asking. So prefix_rule(pattern = ["python3"]) lets Codex run any Python outside the sandbox.
Which settings stop Codex from starting?
Codex refuses to start with approval_policy = "untrusted" ("no longer supported; remove this setting"), with a top-level profile = "…" key (profiles are now their own files, chosen with --profile), with bearer_token on an HTTP MCP server, and with any value it doesn't know for approval_policy, sandbox_mode, web_search, shell_environment_policy.inherit or an MCP tool approval mode. The checker flags each of these.
Does Codex keep my API keys out of the commands it runs?
Not by default. Unless shell_environment_policy.ignore_default_excludes is false, variables named like KEY, SECRET or TOKEN are passed to every command Codex runs, so a test, script or install step can read them. Set it to false and add back the one variable a command needs with set.
What happens if one rule in the file is wrong?
One broken rule (an unknown decision, an empty pattern, or a match example the rule doesn't match) makes codex execpolicy check refuse the whole file, so none of its rules can be counted on until it is fixed. Run codex execpolicy check --pretty --rules your.rules -- git push to see which rules a command meets.
Is anything I paste sent anywhere?
No. Everything runs in your browser and nothing you paste leaves the page. There is no share link, because config files can hold keys; the checker shows where a key is written, never the key.