The config.toml reference
Codex's config file has more settings than the docs make easy to find, and half the support threads on GitHub come down to one wrong key. One page per setting: what it does, the default, when to change it, and the gotchas — checked against the official docs.
Approvals & sandbox
approval_policySets when Codex pauses to ask before running a command. String values: untrusted (only known-safe read-only commands …
default_permissionsNames the permission profile applied to sandboxed tool calls in every session. Built-ins are :read-only, :workspace, …
permissions.<name>.filesystemFilesystem access rules for a custom permission profile. Under permissions.<name>.filesystem you map absolute paths o…
projects.<path>.trust_levelPer-directory trust flag in ~/.codex/config.toml. Set trusted and Codex loads that project's .codex/ layers: project-…
sandbox_modesandbox_mode sets how much of your machine Codex can touch when it runs commands: read-only, workspace-write, or dang…
sandbox_workspace_write.network_accessBoolean under [sandbox_workspace_write] that gives sandboxed commands outbound network access. Default is false, so e…
sandbox_workspace_write.writable_rootsAn array of extra directories Codex can write to when sandbox_mode is workspace-write. Out of the box, workspace-writ…
windows.sandboxPicks which native Windows sandbox Codex uses when you run it outside WSL. Set elevated for real isolation built from…
History, storage & privacy
analytics.enabledCollects anonymous usage and health data and ships it to OpenAI. It's a boolean under an `[analytics]` table, and `an…
history.max_bytesCaps the on-disk history file at a byte limit. Codex writes every session transcript to history.jsonl inside $CODEX_H…
history.persistencehistory.persistence decides whether Codex writes your session transcripts to history.jsonl. Two values: save-all keep…
MCP & tools
mcp_servers.<id>.commandThe executable Codex spawns to launch a stdio MCP server — a plain string like "npx" or "node", with flags split out …
mcp_servers.<id>.envEnvironment variables handed to a stdio MCP server, written as a TOML map under [mcp_servers.<id>.env]. Unset by defa…
mcp_servers.<id>.startup_timeout_secHow long Codex waits for an MCP server to start before giving up. Default is 10 seconds. If a server launches through…
mcp_servers.<id>.urlThe endpoint URL for a remote MCP server speaking streamable HTTP. Set it instead of command — an entry gets one or t…
web_searchTop-level key that sets the web search mode. `cached` (the default) answers from an OpenAI-maintained index with no l…
Models & reasoning
modelSets which model Codex runs, as a plain string id like gpt-5.5 or gpt-5.6. The official reference doesn't publish a d…
model_auto_compact_token_limitSets the token count where Codex automatically compacts session history to free up context. Unset by default; each mo…
model_providerPicks which entry in the [model_providers] table Codex sends requests to. The value is a string id: openai (the defau…
model_reasoning_effortSets how hard the model thinks before it acts. Values: minimal, low, medium, high, xhigh. Ships unset, so the model's…
model_reasoning_summarySets how much reasoning-summary text Codex shows while it works: auto, concise, detailed, or none. auto defers to the…
model_verbositySets how much the model writes back on GPT-5 family models: low, medium, or high. It only shapes the answer text, and…
Profiles, providers & environment
features.network_proxyAn experimental switch that routes a sandboxed session's outbound traffic through a local proxy so you can allow or d…
model_providers.<id>.base_urlThe API endpoint Codex sends requests to for a custom [model_providers.<id>] entry. No default; you set it when point…
model_providers.<id>.env_keyenv_key names the environment variable Codex reads to get the API key for a custom model provider. It holds the varia…
oss_provideross_provider picks which local model backend Codex talks to when you run `codex --oss` without naming a provider, eit…
profiles (structure)Profiles moved out of config.toml. Since 0.134.0 each profile is its own file at $CODEX_HOME/profile-name.config.toml…
Recipes
Connect an MCP serverrecipeAdd a server under [mcp_servers.<id>] in ~/.codex/config.toml. Local (stdio) servers get command plus args; remote se…
Every Codex off-switchrecipeCodex has an opt-out for almost every background behavior, but the keys are scattered across a dozen config.toml sect…
Per-project profilesrecipeTwo ways to run different Codex configs per project. Profiles are named files at `$CODEX_HOME/<name>.config.toml` you…
Safe full-auto setuprecipeThe keys people set together to stop approval prompts without handing Codex the keys to everything. Set sandbox_mode …