config-sample.md +93 −28
1# Sample Configuration1# Sample Configuration
2 2
33Use this example configuration as a starting point. It includes most keys Codex reads from `config.toml`, along with defaults and short notes.Use this example configuration as a starting point. It includes most keys Codex reads from `config.toml`, along with default behaviors, recommended values where helpful, and short notes.
4 4
5For explanations and guidance, see:5For explanations and guidance, see:
6 6
7- [Config basics](https://developers.openai.com/codex/config-basic)7- [Config basics](https://developers.openai.com/codex/config-basic)
8- [Advanced Config](https://developers.openai.com/codex/config-advanced)8- [Advanced Config](https://developers.openai.com/codex/config-advanced)
9- [Config Reference](https://developers.openai.com/codex/config-reference)9- [Config Reference](https://developers.openai.com/codex/config-reference)
10- [Sandbox and approvals](https://developers.openai.com/codex/agent-approvals-security#sandbox-and-approvals)
11- [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration)
10 12
11Use the snippet below as a reference. Copy only the keys and sections you need into `~/.codex/config.toml` (or into a project-scoped `.codex/config.toml`), then adjust values for your setup.13Use the snippet below as a reference. Copy only the keys and sections you need into `~/.codex/config.toml` (or into a project-scoped `.codex/config.toml`), then adjust values for your setup.
12 14
13```toml15```toml
14# Codex example configuration (config.toml)16# Codex example configuration (config.toml)
15#17#
1618# This file lists all keys Codex reads from config.toml, their default values,# This file lists all keys Codex reads from config.toml, along with default
1719# and concise explanations. Values here mirror the effective defaults compiled# behaviors, recommended examples, and concise explanations. Adjust as needed.
18# into the CLI. Adjust as needed.
19#20#
20# Notes21# Notes
21# - Root keys must appear before tables in TOML.22# - Root keys must appear before tables in TOML.
26# Core Model Selection27# Core Model Selection
27################################################################################28################################################################################
28 29
2930# Primary model used by Codex. Default: "gpt-5.2-codex" on all platforms.# Primary model used by Codex. Recommended example for most users: "gpt-5.4".
3031model = "gpt-5.2-codex"model = "gpt-5.4"
31 32
32# Default communication style for supported models. Default: "friendly".33# Default communication style for supported models. Default: "friendly".
33# Allowed values: none | friendly | pragmatic34# Allowed values: none | friendly | pragmatic
34# personality = "friendly"35# personality = "friendly"
35 36
36# Optional model override for /review. Default: unset (uses current session model).37# Optional model override for /review. Default: unset (uses current session model).
3738# review_model = "gpt-5.2-codex"# review_model = "gpt-5.4"
38 39
39# Provider id selected from [model_providers]. Default: "openai".40# Provider id selected from [model_providers]. Default: "openai".
40model_provider = "openai"41model_provider = "openai"
46# Uncomment to force values.47# Uncomment to force values.
47# model_context_window = 128000 # tokens; default: auto for model48# model_context_window = 128000 # tokens; default: auto for model
48# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults49# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults
4950# tool_output_token_limit = 10000 # tokens stored per tool output; default: 10000 for gpt-5.2-codex# tool_output_token_limit = 10000 # tokens stored per tool output
51# model_catalog_json = "/absolute/path/to/models.json" # optional startup-only model catalog override
52# background_terminal_max_timeout = 300000 # ms; max empty write_stdin poll window (default 5m)
50# log_dir = "/absolute/path/to/codex-logs" # directory for Codex logs; default: "$CODEX_HOME/log"53# log_dir = "/absolute/path/to/codex-logs" # directory for Codex logs; default: "$CODEX_HOME/log"
54# sqlite_home = "/absolute/path/to/codex-state" # optional SQLite-backed runtime state directory
51 55
52################################################################################56################################################################################
53# Reasoning & Verbosity (Responses API capable models)57# Reasoning & Verbosity (Responses API capable models)
54################################################################################58################################################################################
55 59
5660# Reasoning effort: minimal | low | medium | high | xhigh (default: medium; xhigh on gpt-5.2-codex and gpt-5.2)# Reasoning effort: minimal | low | medium | high | xhigh (default: medium; `xhigh` availability is model-dependent)
57model_reasoning_effort = "medium"61model_reasoning_effort = "medium"
58 62
59# Reasoning summary: auto | concise | detailed | none (default: auto)63# Reasoning summary: auto | concise | detailed | none (default: auto)
105# - untrusted: only known-safe read-only commands auto-run; others prompt109# - untrusted: only known-safe read-only commands auto-run; others prompt
106# - on-request: model decides when to ask (default)110# - on-request: model decides when to ask (default)
107# - never: never prompt (risky)111# - never: never prompt (risky)
112# - { reject = { ... } }: auto-reject selected prompt categories
108approval_policy = "on-request"113approval_policy = "on-request"
114# Example granular auto-reject policy:
115# approval_policy = { reject = { sandbox_approval = true, rules = false, mcp_elicitations = false } }
116
117# Allow login-shell semantics for shell-based tools when they request `login = true`.
118# Default: true. Set false to force non-login shells and reject explicit login-shell requests.
119allow_login_shell = true
109 120
110# Filesystem/network sandbox policy for tool calls:121# Filesystem/network sandbox policy for tool calls:
111# - read-only (default)122# - read-only (default)
113# - danger-full-access (no sandbox; extremely risky)124# - danger-full-access (no sandbox; extremely risky)
114sandbox_mode = "read-only"125sandbox_mode = "read-only"
115 126
127[windows]
128# Native Windows sandbox mode (Windows only): unelevated | elevated
129sandbox = "unelevated"
130
116################################################################################131################################################################################
117# Authentication & Login132# Authentication & Login
118################################################################################133################################################################################
136# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.151# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.
137# mcp_oauth_callback_port = 4321152# mcp_oauth_callback_port = 4321
138 153
154# Optional redirect URI override for MCP OAuth login (for example, remote devbox ingress).
155# Custom callback paths are supported. `mcp_oauth_callback_port` still controls the listener port.
156# mcp_oauth_callback_url = "https://devbox.example.internal/callback"
157
139################################################################################158################################################################################
140# Project Documentation Controls159# Project Documentation Controls
141################################################################################160################################################################################
192# Active profile name. When unset, no profile is applied.211# Active profile name. When unset, no profile is applied.
193# profile = "default"212# profile = "default"
194 213
214################################################################################
215# Agents (multi-agent roles and limits)
216################################################################################
217
218# [agents]
219# Maximum concurrently open agent threads. Default: 6
220# max_threads = 6
221# Maximum nested spawn depth. Root session starts at depth 0. Default: 1
222# max_depth = 1
223# Default timeout per worker for spawn_agents_on_csv jobs. When unset, the tool defaults to 1800 seconds.
224# job_max_runtime_seconds = 1800
225
226# [agents.reviewer]
227# description = "Find security, correctness, and test risks in code."
228# config_file = "./agents/reviewer.toml" # relative to the config.toml that defines it
229
195################################################################################230################################################################################
196# Skills (per-skill overrides)231# Skills (per-skill overrides)
197################################################################################232################################################################################
198 233
199# Disable or re-enable a specific skill without deleting it.234# Disable or re-enable a specific skill without deleting it.
200[[skills.config]]235[[skills.config]]
201236# path = "/path/to/skill"# path = "/path/to/skill/SKILL.md"
202# enabled = false237# enabled = false
203 238
204################################################################################239################################################################################
274# Control alternate screen usage (auto skips it in Zellij to preserve scrollback).309# Control alternate screen usage (auto skips it in Zellij to preserve scrollback).
275# alternate_screen = "auto"310# alternate_screen = "auto"
276 311
277312# Ordered list of footer status-line item IDs. Default: null (disabled).# Ordered list of footer status-line item IDs. When unset, Codex uses:
313# ["model-with-reasoning", "context-remaining", "current-dir"].
314# Set to [] to hide the footer.
278# status_line = ["model", "context-remaining", "git-branch"]315# status_line = ["model", "context-remaining", "git-branch"]
279 316
317# Syntax-highlighting theme (kebab-case). Use /theme in the TUI to preview and save.
318# You can also add custom .tmTheme files under $CODEX_HOME/themes.
319# theme = "catppuccin-mocha"
320
280# Control whether users can submit feedback from `/feedback`. Default: true321# Control whether users can submit feedback from `/feedback`. Default: true
281[feedback]322[feedback]
282enabled = true323enabled = true
299 340
300[features]341[features]
301# Leave this table empty to accept defaults. Set explicit booleans to opt in/out.342# Leave this table empty to accept defaults. Set explicit booleans to opt in/out.
302343shell_tool = true# shell_tool = true
303# apps = false344# apps = false
304# apps_mcp_gateway = false345# apps_mcp_gateway = false
305# Deprecated legacy toggles; prefer the top-level `web_search` setting.
306# web_search = false
307# web_search_cached = false346# web_search_cached = false
308# web_search_request = false347# web_search_request = false
309348unified_exec = false# unified_exec = false
310349shell_snapshot = false# shell_snapshot = false
311350apply_patch_freeform = false# apply_patch_freeform = false
351# multi_agent = false
312# search_tool = false352# search_tool = false
313# personality = true353# personality = true
314354request_rule = true# request_rule = true
315355collaboration_modes = true# collaboration_modes = true
316356use_linux_sandbox_bwrap = false# use_linux_sandbox_bwrap = false
317357experimental_windows_sandbox = false# remote_models = false
318358elevated_windows_sandbox = false# runtime_metrics = false
319359remote_models = false# powershell_utf8 = true
320360runtime_metrics = false# child_agents_md = false
321powershell_utf8 = true
322child_agents_md = false
323 361
324################################################################################362################################################################################
325# Define MCP servers under this table. Leave empty to disable.363# Define MCP servers under this table. Leave empty to disable.
399[profiles]437[profiles]
400 438
401# [profiles.default]439# [profiles.default]
402440# model = "gpt-5.2-codex"# model = "gpt-5.4"
403# model_provider = "openai"441# model_provider = "openai"
404# approval_policy = "on-request"442# approval_policy = "on-request"
405# sandbox_mode = "read-only"443# sandbox_mode = "read-only"
409# model_verbosity = "medium"447# model_verbosity = "medium"
410# personality = "friendly" # or "pragmatic" or "none"448# personality = "friendly" # or "pragmatic" or "none"
411# chatgpt_base_url = "https://chatgpt.com/backend-api/"449# chatgpt_base_url = "https://chatgpt.com/backend-api/"
450# model_catalog_json = "./models.json"
412# experimental_compact_prompt_file = "./compact_prompt.txt"451# experimental_compact_prompt_file = "./compact_prompt.txt"
413# include_apply_patch_tool = false452# include_apply_patch_tool = false
414# experimental_use_unified_exec_tool = false453# experimental_use_unified_exec_tool = false
422 461
423# Optional per-app controls.462# Optional per-app controls.
424[apps]463[apps]
464# [_default] applies to all apps unless overridden per app.
465# [apps._default]
466# enabled = true
467# destructive_enabled = true
468# open_world_enabled = true
469#
425# [apps.google_drive]470# [apps.google_drive]
426# enabled = false471# enabled = false
427472# disabled_reason = "user" # or "unknown"# destructive_enabled = false # block destructive-hint tools for this app
473# default_tools_enabled = true
474# default_tools_approval_mode = "prompt" # auto | prompt | approve
475#
476# [apps.google_drive.tools."files/delete"]
477# enabled = false
478# approval_mode = "approve"
428 479
429################################################################################480################################################################################
430# Projects (trust levels)481# Projects (trust levels)
475# client-certificate = "/etc/codex/certs/client.pem"526# client-certificate = "/etc/codex/certs/client.pem"
476# client-private-key = "/etc/codex/certs/client-key.pem"527# client-private-key = "/etc/codex/certs/client-key.pem"
477```528```
529
530################################################################################
531
532# Windows
533
534################################################################################
535
536[windows]
537
538# Native Windows sandbox mode (Windows only). The example below uses the
539
540# recommended elevated mode.
541
542sandbox = “elevated”