Where the file lives
- User config:
~/.codex/config.toml. On Windows with the desktop app, the Codex home is%USERPROFILE%\.codex. - Project config:
.codex/config.tomlinside a repository, loaded only if you trust the project. - In the IDE extension: gear icon, then Codex Settings, then Open config.toml.
The CLI and IDE extension share the same configuration layers.
Which setting wins
Highest precedence first:
- CLI flags and
--config/-coverrides - Project
.codex/config.tomlfiles, closest folder wins (trusted projects only) - A profile chosen with
--profile name(~/.codex/name.config.toml) - Your user
~/.codex/config.toml - Cloud-managed defaults for your workspace, if any
- System config,
/etc/codex/config.tomlon Unix - Built-in defaults
On managed machines, your organization can also enforce limits with requirements.toml that you can’t override.
A starter file
# ~/.codex/config.toml
model = "gpt-6.1-sol" # the example OpenAI's docs used on 2026-10-16
approval_policy = "on-request" # ask before going beyond the sandbox
sandbox_mode = "workspace-write" # edit inside the project, not elsewhere
web_search = "cached" # default; "live" fetches fresh pages
model_reasoning_effort = "medium"
Model names change often. If a model is rejected, check OpenAI’s current config docs or remove the model line to use the default.
Options worth knowing
| Key | Values | Notes |
|---|---|---|
approval_policy | "on-request", "never" | untrusted is retired. See OpenAI’s migration note. |
sandbox_mode | "read-only", "workspace-write", "danger-full-access" | Full access removes the project boundary. |
web_search | "cached", "indexed", "live", "disabled" | Treat web results as untrusted. |
personality | "none" | Removes the built-in personality instructions |
log_dir | a path | Also turns on the plaintext codex-tui.log |
project_doc_max_bytes | number | AGENTS.md size cap, 32 KiB by default |
[features] | flags | For example memories = true, which is experimental |
Windows sandbox
[windows]
sandbox = "elevated" # legacy fallback
[features]
prefer_mxc = true
OpenAI suggests preferring MXC where your device and policy support it. Use unelevated only if elevated setup isn’t available and your organization allows it.
Want this done for you? Use the config generator.