config-sample.md +78 −18
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/security#sandbox-and-approvals)
11- [Managed configuration](https://developers.openai.com/codex/security#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
47# model_context_window = 128000 # tokens; default: auto for model49# model_context_window = 128000 # tokens; default: auto for model
48# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults50# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults
49# tool_output_token_limit = 10000 # tokens stored per tool output; default: 10000 for gpt-5.2-codex51# tool_output_token_limit = 10000 # tokens stored per tool output; default: 10000 for gpt-5.2-codex
52# model_catalog_json = "/absolute/path/to/models.json" # optional startup-only model catalog override
53# 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"54# log_dir = "/absolute/path/to/codex-logs" # directory for Codex logs; default: "$CODEX_HOME/log"
55# sqlite_home = "/absolute/path/to/codex-state" # optional SQLite-backed runtime state directory
51 56
52################################################################################57################################################################################
53# Reasoning & Verbosity (Responses API capable models)58# Reasoning & Verbosity (Responses API capable models)
105# - untrusted: only known-safe read-only commands auto-run; others prompt110# - untrusted: only known-safe read-only commands auto-run; others prompt
106# - on-request: model decides when to ask (default)111# - on-request: model decides when to ask (default)
107# - never: never prompt (risky)112# - never: never prompt (risky)
113# - { reject = { ... } }: auto-reject selected prompt categories
108approval_policy = "on-request"114approval_policy = "on-request"
115# Example granular auto-reject policy:
116# approval_policy = { reject = { sandbox_approval = true, rules = false, mcp_elicitations = false } }
117
118# Allow login-shell semantics for shell-based tools when they request `login = true`.
119# Default: true. Set false to force non-login shells and reject explicit login-shell requests.
120allow_login_shell = true
109 121
110# Filesystem/network sandbox policy for tool calls:122# Filesystem/network sandbox policy for tool calls:
111# - read-only (default)123# - read-only (default)
136# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.148# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.
137# mcp_oauth_callback_port = 4321149# mcp_oauth_callback_port = 4321
138 150
151# Optional redirect URI override for MCP OAuth login (for example, remote devbox ingress).
152# Custom callback paths are supported. `mcp_oauth_callback_port` still controls the listener port.
153# mcp_oauth_callback_url = "https://devbox.example.internal/callback"
154
139################################################################################155################################################################################
140# Project Documentation Controls156# Project Documentation Controls
141################################################################################157################################################################################
192# Active profile name. When unset, no profile is applied.208# Active profile name. When unset, no profile is applied.
193# profile = "default"209# profile = "default"
194 210
211################################################################################
212# Agents (multi-agent roles and limits)
213################################################################################
214
215# [agents]
216# Maximum concurrently open agent threads. Default: 6
217# max_threads = 6
218# Maximum nested spawn depth. Root session starts at depth 0. Default: 1
219# max_depth = 1
220# Default timeout per worker for spawn_agents_on_csv jobs. When unset, the tool defaults to 1800 seconds.
221# job_max_runtime_seconds = 1800
222
223# [agents.reviewer]
224# description = "Find security, correctness, and test risks in code."
225# config_file = "./agents/reviewer.toml" # relative to the config.toml that defines it
226
195################################################################################227################################################################################
196# Skills (per-skill overrides)228# Skills (per-skill overrides)
197################################################################################229################################################################################
198 230
199# Disable or re-enable a specific skill without deleting it.231# Disable or re-enable a specific skill without deleting it.
200[[skills.config]]232[[skills.config]]
201233# path = "/path/to/skill"# path = "/path/to/skill/SKILL.md"
202# enabled = false234# enabled = false
203 235
204################################################################################236################################################################################
274# Control alternate screen usage (auto skips it in Zellij to preserve scrollback).306# Control alternate screen usage (auto skips it in Zellij to preserve scrollback).
275# alternate_screen = "auto"307# alternate_screen = "auto"
276 308
277309# Ordered list of footer status-line item IDs. Default: null (disabled).# Ordered list of footer status-line item IDs. When unset, Codex uses:
310# ["model-with-reasoning", "context-remaining", "current-dir"].
311# Set to [] to hide the footer.
278# status_line = ["model", "context-remaining", "git-branch"]312# status_line = ["model", "context-remaining", "git-branch"]
279 313
314# Syntax-highlighting theme (kebab-case). Use /theme in the TUI to preview and save.
315# You can also add custom .tmTheme files under $CODEX_HOME/themes.
316# theme = "catppuccin-mocha"
317
280# Control whether users can submit feedback from `/feedback`. Default: true318# Control whether users can submit feedback from `/feedback`. Default: true
281[feedback]319[feedback]
282enabled = true320enabled = true
299 337
300[features]338[features]
301# Leave this table empty to accept defaults. Set explicit booleans to opt in/out.339# Leave this table empty to accept defaults. Set explicit booleans to opt in/out.
302340shell_tool = true# shell_tool = true
303# apps = false341# apps = false
304# apps_mcp_gateway = false342# apps_mcp_gateway = false
305# Deprecated legacy toggles; prefer the top-level `web_search` setting.
306# web_search = false
307# web_search_cached = false343# web_search_cached = false
308# web_search_request = false344# web_search_request = false
309345unified_exec = false# unified_exec = false
310346shell_snapshot = false# shell_snapshot = false
311347apply_patch_freeform = false# apply_patch_freeform = false
348# multi_agent = false
312# search_tool = false349# search_tool = false
313# personality = true350# personality = true
314351request_rule = true# request_rule = true
315352collaboration_modes = true# collaboration_modes = true
316353use_linux_sandbox_bwrap = false# use_linux_sandbox_bwrap = false
317354experimental_windows_sandbox = false# remote_models = false
318355elevated_windows_sandbox = false# runtime_metrics = false
319356remote_models = false# powershell_utf8 = true
320357runtime_metrics = false# child_agents_md = false
321powershell_utf8 = true
322child_agents_md = false
323 358
324################################################################################359################################################################################
325# Define MCP servers under this table. Leave empty to disable.360# Define MCP servers under this table. Leave empty to disable.
409# model_verbosity = "medium"444# model_verbosity = "medium"
410# personality = "friendly" # or "pragmatic" or "none"445# personality = "friendly" # or "pragmatic" or "none"
411# chatgpt_base_url = "https://chatgpt.com/backend-api/"446# chatgpt_base_url = "https://chatgpt.com/backend-api/"
447# model_catalog_json = "./models.json"
412# experimental_compact_prompt_file = "./compact_prompt.txt"448# experimental_compact_prompt_file = "./compact_prompt.txt"
413# include_apply_patch_tool = false449# include_apply_patch_tool = false
414# experimental_use_unified_exec_tool = false450# experimental_use_unified_exec_tool = false
422 458
423# Optional per-app controls.459# Optional per-app controls.
424[apps]460[apps]
461# [_default] applies to all apps unless overridden per app.
462# [apps._default]
463# enabled = true
464# destructive_enabled = true
465# open_world_enabled = true
466#
425# [apps.google_drive]467# [apps.google_drive]
426# enabled = false468# enabled = false
427469# disabled_reason = "user" # or "unknown"# destructive_enabled = false # block destructive-hint tools for this app
470# default_tools_enabled = true
471# default_tools_approval_mode = "prompt" # auto | prompt | approve
472#
473# [apps.google_drive.tools."files/delete"]
474# enabled = false
475# approval_mode = "approve"
428 476
429################################################################################477################################################################################
430# Projects (trust levels)478# Projects (trust levels)
475# client-certificate = "/etc/codex/certs/client.pem"523# client-certificate = "/etc/codex/certs/client.pem"
476# client-private-key = "/etc/codex/certs/client-key.pem"524# client-private-key = "/etc/codex/certs/client-key.pem"
477```525```
526
527################################################################################
528
529# Windows
530
531################################################################################
532
533[windows]
534
535# Native Windows sandbox mode (Windows only): unelevated | elevated
536
537sandbox = "unelevated"