Codex config.toml: the complete reference

Codex configuration lives in one TOML file, which is a genuine advantage: everything is in one place. What changed in 2026 is profiles, and if you copied a profile block from an older guide it will now refuse to load.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

Configuration lives in ~/.codex/config.toml, or $CODEX_HOME/config.toml if you set it. The settings that matter are model, model_reasoning_effort, sandbox_mode, and approval_policy. Profiles are now separate files: codex -p build layers $CODEX_HOME/build.config.toml on top of the base config, and the old [profiles.name] tables stopped working in Codex 0.134.0. MCP servers are declared in the same file.

What you need to know
  • One file: ~/.codex/config.toml. Point $CODEX_HOME elsewhere to isolate an account.
  • model_reasoning_effort is the biggest single lever on both cost and quality.
  • Profiles are separate files now: -p build loads $CODEX_HOME/build.config.toml.
  • [profiles.name] tables no longer work with --profile, and having both is a hard error.
  • MCP servers live in the same file under [mcp_servers.name], with per-tool approval.
  • -c key=value overrides anything for one run. The value is parsed as TOML.
  • --strict-config errors on keys this version does not recognise. Run it after any upgrade.

Where configuration lives

PathHolds
~/.codex/config.tomlThe base configuration
~/.codex/<name>.config.tomlOne named profile, loaded with -p <name>
~/.codex/auth.jsonCredentials, written by codex login
~/.codex/sessions/JSONL transcripts of every run
AGENTS.md in the repoProject instructions, which are content rather than configuration
CODEX_HOME=~/.codex-work codex login
CODEX_HOME=~/.codex-work codex

A full configuration

~/.codex/config.toml
# ── model ──────────────────────────────────────────────
model                  = "gpt-5.6-sol"   # sol | terra | luna | 5.5 | 5.4
model_reasoning_effort = "low"           # sol ships at low and is strong there
# service_tier         = "priority"      # Fast mode. Faster, burns credits quicker.

# ── permissions ────────────────────────────────────────
sandbox_mode    = "workspace-write"      # read-only | workspace-write | danger-full-access
approval_policy = "on-request"           # untrusted | on-request | never

# Network is OFF in workspace-write unless you say otherwise.
[sandbox_workspace_write]
network_access = false
writable_roots = []

# ── context ────────────────────────────────────────────
model_auto_compact_token_limit = 200000  # compact before the window fills

# ── MCP servers ────────────────────────────────────────
[mcp_servers.postgres]
command = "npx"
args    = ["-y", "@modelcontextprotocol/server-postgres"]
env     = { DATABASE_URL = "postgres://localhost/dev" }
enabled = true

The settings that matter

SettingValuesEffect
modelA model idWhich model runs. Biggest cost lever after effort.
model_reasoning_effortminimal to ultraHow much it thinks before acting
sandbox_modeThree modesHard capability boundary, enforced by the OS
approval_policyuntrusted, on-request, neverWhen it stops to ask you
approvals_revieweruser, auto_reviewWho reviews approval requests
service_tierpriority for Fast modeFaster responses, and it burns credits quicker
network_accessboolOff by default in workspace-write
model_auto_compact_token_limitToken countWhen the session summarises itself
review_modelA model idModel used by /review and codex review
web_searchboolEnables the native search tool, same as --search

Reasoning effort is the one to tune

Effort controls how much the model deliberates before it acts, and it moves cost, latency, and quality together. The available levels differ by model.

Supported reasoning efforts per model, from the CLI model catalogue, August 2026.

ModelDefaultSupports
gpt-5.6-sollowlow, medium, high, xhigh, max, ultra
gpt-5.6-terramediumlow, medium, high, xhigh, max, ultra
gpt-5.6-lunamediumlow, medium, high, xhigh, max
gpt-5.5, gpt-5.4mediumlow, medium, high, xhigh
gpt-5.3-codex-sparkhighlow, medium, high, xhigh

What to reach for.

EffortUse for
lowRoutine changes in familiar code. Sol ships here and is strong here.
mediumOrdinary feature work
highArchitecture, stubborn bugs, unfamiliar systems
xhigh / maxA task that has already resisted a high-effort attempt
ultraMaximum reasoning with automatic task delegation

Profiles: what changed, and how to migrate

Profiles are the feature worth using, because sandbox and approval settings work as a pair and naming the pair removes the mistake. The mechanism changed in Codex 0.134.0, and old configs now fail loudly rather than silently.

Before 0.134.0Now
Where a profile lives[profiles.build] in config.toml$CODEX_HOME/build.config.toml
Selecting one--profile build or profile = "build"-p build / --profile build
Having bothFineHard error
The error, verbatim, if you leave a legacy table in place.
Error loading config.toml: --profile `explore` cannot be used while
~/.codex/config.toml contains legacy `profile = "explore"` or
`[profiles.explore]` config; move those settings into
~/.codex/explore.config.toml and remove the legacy profile
selector/table.
The migration is a copy and a delete.
# each profile becomes its own file next to config.toml
$EDITOR ~/.codex/explore.config.toml
$EDITOR ~/.codex/build.config.toml
$EDITOR ~/.codex/deep.config.toml

# then remove every [profiles.*] table and any top-level profile = "..."
$EDITOR ~/.codex/config.toml
~/.codex/explore.config.toml. Only the keys that differ from the base.
model                  = "gpt-5.6-luna"
model_reasoning_effort = "low"
sandbox_mode           = "read-only"
approval_policy        = "never"
codex -p explore     # read-only, cheap model, no prompts
codex -p build       # the normal working setup
codex -p deep        # high effort for something hard

MCP servers

Model Context Protocol servers are declared in the same file, so a tool the agent can call is configuration rather than a plugin install.

[mcp_servers.playwright]
command = "npx"
args    = ["@playwright/mcp@latest"]
enabled = true

# per-tool approval, so the dangerous ones still ask
[mcp_servers.playwright.tools.browser_navigate]
approval_mode = "approve"
Or manage them from the CLI instead of editing TOML.
codex mcp list
codex mcp add ...
codex mcp get <name>
codex mcp remove <name>
codex mcp login <name>     # for servers behind OAuth

Overriding for one run

FlagDoes
-c key=valueOverride any config key. Dotted paths reach nested tables.
-p <name>Layer a named profile file
-m, -s, -aModel, sandbox, approvals
--enable / --disableA feature flag, same as -c features.<name>=true
--strict-configError on unrecognised keys instead of ignoring them
--ignore-user-configSkip config.toml entirely. Auth still resolves from CODEX_HOME.
# any key, for one run. The value is parsed as TOML.
codex -c model_reasoning_effort="high"
codex -c 'sandbox_workspace_write.network_access=true'

# a reproducible run for CI: no user config, no session files
codex exec --ignore-user-config --ephemeral -s read-only -a never "review the diff"
What one config root per account buys you: a capped session moving to the second subscription instead of stopping.
Four configuration layers resolving one setting: a per-run flag beats a profile file, which beats config.toml, which beats the built-in default SOURCE, STRONGEST FIRST MODEL_REASONING_EFFORT -c model_reasoning_effort="high" a flag. this run only high applied -p build ~/.codex/build.config.toml not set says nothing ~/.codex/config.toml your base configuration low overridden built-in default what Codex ships with medium overridden Each layer states only what it changes. $CODEX_HOME relocates all of it.

Questions people ask

~/.codex/config.toml, or $CODEX_HOME/config.toml if you set that variable. Credentials sit beside it in auth.json and transcripts in sessions/.

Each profile is its own file: codex -p build loads $CODEX_HOME/build.config.toml and layers it over the base config. Since Codex 0.134.0 the --profile flag no longer reads [profiles.name] tables from config.toml.

Because config.toml still contains a [profiles.name] table or a top-level profile = "name" selector. Move those settings into a file named after the profile, such as build.config.toml, beside config.toml, then delete the legacy table.

How much the model deliberates before acting. Levels run minimal, low, medium, high, xhigh, max, ultra, and which are available depends on the model. gpt-5.6-sol defaults to low and supports everything up to ultra.

Add an [mcp_servers.name] block with command, args, and any env it needs, or use codex mcp add. Set approval_mode on individual tools so the ones that act on the world still ask.

Project instructions go in AGENTS.md at the repository root. For runtime settings, define a profile and commit a small wrapper script so everyone on the team runs the same configuration.

codex -c key="value". Any key from config.toml works and dotted paths reach nested tables, so -c sandbox_workspace_write.network_access=true is valid. Flags take precedence over the file.

Give each one its own CODEX_HOME. Separate config, separate auth.json, separate session history, and no chance of the wrong subscription being billed.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. Codex advanced configuration
  2. OpenAI Codex documentation
  3. openai/codex on GitHub
Try it

Effort, as
a chip.

Continuum surfaces model and reasoning effort per session and remembers them per repository.

free app · your subscriptions · local-first