config-sample.md +93 −30
1# Sample Configuration1# Sample Configuration
2 2
33A complete example config.toml you can copy and adaptUse 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
5Use this example configuration as a starting point. It includes most keys Codex reads from `config.toml`, along with defaults and short notes.
6 4
7For explanations and guidance, see:5For explanations and guidance, see:
8 6
9- [Config basics](https://developers.openai.com/codex/config-basic)7- [Config basics](https://developers.openai.com/codex/config-basic)
10- [Advanced Config](https://developers.openai.com/codex/config-advanced)8- [Advanced Config](https://developers.openai.com/codex/config-advanced)
11- [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/security#sandbox-and-approvals)
11- [Managed configuration](https://developers.openai.com/codex/security#managed-configuration)
12 12
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.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.
14 14
15```toml15```toml
16# Codex example configuration (config.toml)16# Codex example configuration (config.toml)
17#17#
1818# 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
1919# and concise explanations. Values here mirror the effective defaults compiled# behaviors, recommended examples, and concise explanations. Adjust as needed.
20# into the CLI. Adjust as needed.
21#20#
22# Notes21# Notes
23# - Root keys must appear before tables in TOML.22# - Root keys must appear before tables in TOML.
28# Core Model Selection27# Core Model Selection
29################################################################################28################################################################################
30 29
3130# 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".
3231model = "gpt-5.2-codex"model = "gpt-5.4"
33 32
34# Default communication style for supported models. Default: "friendly".33# Default communication style for supported models. Default: "friendly".
35# Allowed values: none | friendly | pragmatic34# Allowed values: none | friendly | pragmatic
36# personality = "friendly"35# personality = "friendly"
37 36
38# Optional model override for /review. Default: unset (uses current session model).37# Optional model override for /review. Default: unset (uses current session model).
3938# review_model = "gpt-5.2-codex"# review_model = "gpt-5.4"
40 39
41# Provider id selected from [model_providers]. Default: "openai".40# Provider id selected from [model_providers]. Default: "openai".
42model_provider = "openai"41model_provider = "openai"
48# Uncomment to force values.47# Uncomment to force values.
49# model_context_window = 128000 # tokens; default: auto for model48# model_context_window = 128000 # tokens; default: auto for model
50# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults49# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults
5150# 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)
52# 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
53 55
54################################################################################56################################################################################
55# Reasoning & Verbosity (Responses API capable models)57# Reasoning & Verbosity (Responses API capable models)
56################################################################################58################################################################################
57 59
5860# 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)
59model_reasoning_effort = "medium"61model_reasoning_effort = "medium"
60 62
61# Reasoning summary: auto | concise | detailed | none (default: auto)63# Reasoning summary: auto | concise | detailed | none (default: auto)
107# - untrusted: only known-safe read-only commands auto-run; others prompt109# - untrusted: only known-safe read-only commands auto-run; others prompt
108# - on-request: model decides when to ask (default)110# - on-request: model decides when to ask (default)
109# - never: never prompt (risky)111# - never: never prompt (risky)
112# - { reject = { ... } }: auto-reject selected prompt categories
110approval_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
111 120
112# Filesystem/network sandbox policy for tool calls:121# Filesystem/network sandbox policy for tool calls:
113# - read-only (default)122# - read-only (default)
115# - danger-full-access (no sandbox; extremely risky)124# - danger-full-access (no sandbox; extremely risky)
116sandbox_mode = "read-only"125sandbox_mode = "read-only"
117 126
127[windows]
128# Native Windows sandbox mode (Windows only): unelevated | elevated
129sandbox = "unelevated"
130
118################################################################################131################################################################################
119# Authentication & Login132# Authentication & Login
120################################################################################133################################################################################
138# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.151# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.
139# mcp_oauth_callback_port = 4321152# mcp_oauth_callback_port = 4321
140 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
141################################################################################158################################################################################
142# Project Documentation Controls159# Project Documentation Controls
143################################################################################160################################################################################
194# Active profile name. When unset, no profile is applied.211# Active profile name. When unset, no profile is applied.
195# profile = "default"212# profile = "default"
196 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
197################################################################################230################################################################################
198# Skills (per-skill overrides)231# Skills (per-skill overrides)
199################################################################################232################################################################################
200 233
201# Disable or re-enable a specific skill without deleting it.234# Disable or re-enable a specific skill without deleting it.
202[[skills.config]]235[[skills.config]]
203236# path = "/path/to/skill"# path = "/path/to/skill/SKILL.md"
204# enabled = false237# enabled = false
205 238
206################################################################################239################################################################################
276# 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).
277# alternate_screen = "auto"310# alternate_screen = "auto"
278 311
279312# 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.
280# status_line = ["model", "context-remaining", "git-branch"]315# status_line = ["model", "context-remaining", "git-branch"]
281 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
282# Control whether users can submit feedback from `/feedback`. Default: true321# Control whether users can submit feedback from `/feedback`. Default: true
283[feedback]322[feedback]
284enabled = true323enabled = true
301 340
302[features]341[features]
303# 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.
304343shell_tool = true# shell_tool = true
305# apps = false344# apps = false
306# apps_mcp_gateway = false345# apps_mcp_gateway = false
307# Deprecated legacy toggles; prefer the top-level `web_search` setting.
308# web_search = false
309# web_search_cached = false346# web_search_cached = false
310# web_search_request = false347# web_search_request = false
311348unified_exec = false# unified_exec = false
312349shell_snapshot = false# shell_snapshot = false
313350apply_patch_freeform = false# apply_patch_freeform = false
351# multi_agent = false
314# search_tool = false352# search_tool = false
315# personality = true353# personality = true
316354request_rule = true# request_rule = true
317355collaboration_modes = true# collaboration_modes = true
318356use_linux_sandbox_bwrap = false# use_linux_sandbox_bwrap = false
319357experimental_windows_sandbox = false# remote_models = false
320358elevated_windows_sandbox = false# runtime_metrics = false
321359remote_models = false# powershell_utf8 = true
322360runtime_metrics = false# child_agents_md = false
323powershell_utf8 = true
324child_agents_md = false
325 361
326################################################################################362################################################################################
327# Define MCP servers under this table. Leave empty to disable.363# Define MCP servers under this table. Leave empty to disable.
401[profiles]437[profiles]
402 438
403# [profiles.default]439# [profiles.default]
404440# model = "gpt-5.2-codex"# model = "gpt-5.4"
405# model_provider = "openai"441# model_provider = "openai"
406# approval_policy = "on-request"442# approval_policy = "on-request"
407# sandbox_mode = "read-only"443# sandbox_mode = "read-only"
411# model_verbosity = "medium"447# model_verbosity = "medium"
412# personality = "friendly" # or "pragmatic" or "none"448# personality = "friendly" # or "pragmatic" or "none"
413# chatgpt_base_url = "https://chatgpt.com/backend-api/"449# chatgpt_base_url = "https://chatgpt.com/backend-api/"
450# model_catalog_json = "./models.json"
414# experimental_compact_prompt_file = "./compact_prompt.txt"451# experimental_compact_prompt_file = "./compact_prompt.txt"
415# include_apply_patch_tool = false452# include_apply_patch_tool = false
416# experimental_use_unified_exec_tool = false453# experimental_use_unified_exec_tool = false
424 461
425# Optional per-app controls.462# Optional per-app controls.
426[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#
427# [apps.google_drive]470# [apps.google_drive]
428# enabled = false471# enabled = false
429472# 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"
430 479
431################################################################################480################################################################################
432# Projects (trust levels)481# Projects (trust levels)
477# client-certificate = "/etc/codex/certs/client.pem"526# client-certificate = "/etc/codex/certs/client.pem"
478# client-private-key = "/etc/codex/certs/client-key.pem"527# client-private-key = "/etc/codex/certs/client-key.pem"
479```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”