config-sample.md +133 −116
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)
1010- [Sandbox and approvals](https://developers.openai.com/codex/security#sandbox-and-approvals)- [Sandbox and approvals](https://developers.openai.com/codex/agent-approvals-security#sandbox-and-approvals)
1111- [Managed configuration](https://developers.openai.com/codex/security#managed-configuration)- [Managed configuration](https://developers.openai.com/codex/enterprise/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, along with default# This file lists the main keys Codex reads from config.toml, along with default
19# behaviors, recommended examples, and concise explanations. Adjust as needed.19# behaviors, recommended examples, and concise explanations. Adjust as needed.
20#20#
21# Notes21# Notes
30# Primary model used by Codex. Recommended example for most users: "gpt-5.4".30# Primary model used by Codex. Recommended example for most users: "gpt-5.4".
31model = "gpt-5.4"31model = "gpt-5.4"
32 32
3333# Default communication style for supported models. Default: "friendly".# Communication style for supported models. Allowed values: none | friendly | pragmatic
3434# Allowed values: none | friendly | pragmatic# personality = "pragmatic"
35# personality = "friendly"
36 35
37# Optional model override for /review. Default: unset (uses current session model).36# Optional model override for /review. Default: unset (uses current session model).
38# review_model = "gpt-5.4"37# review_model = "gpt-5.4"
43# Default OSS provider for --oss sessions. When unset, Codex prompts. Default: unset.42# Default OSS provider for --oss sessions. When unset, Codex prompts. Default: unset.
44# oss_provider = "ollama"43# oss_provider = "ollama"
45 44
4645# Optional manual model metadata. When unset, Codex auto-detects from model.# Preferred service tier. `fast` is honored only when enabled in [features].
4746# Uncomment to force values.# service_tier = "flex" # fast | flex
47
48# Optional manual model metadata. When unset, Codex uses model or preset defaults.
48# model_context_window = 128000 # tokens; default: auto for model49# model_context_window = 128000 # tokens; default: auto for model
4950# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults# model_auto_compact_token_limit = 64000 # tokens; unset uses model defaults
5051# tool_output_token_limit = 10000 # tokens stored per tool output# tool_output_token_limit = 12000 # tokens stored per tool output
51# model_catalog_json = "/absolute/path/to/models.json" # optional startup-only model catalog override52# 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)53# background_terminal_max_timeout = 300000 # ms; max empty write_stdin poll window (default 5m)
53# 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"
57# Reasoning & Verbosity (Responses API capable models)58# Reasoning & Verbosity (Responses API capable models)
58################################################################################59################################################################################
59 60
6061# Reasoning effort: minimal | low | medium | high | xhigh (default: medium; `xhigh` availability is model-dependent)# Reasoning effort: minimal | low | medium | high | xhigh
6162model_reasoning_effort = "medium"# model_reasoning_effort = "medium"
63
64# Optional override used when Codex runs in plan mode: none | minimal | low | medium | high | xhigh
65# plan_mode_reasoning_effort = "high"
62 66
6367# Reasoning summary: auto | concise | detailed | none (default: auto)# Reasoning summary: auto | concise | detailed | none
64# model_reasoning_summary = "auto"68# model_reasoning_summary = "auto"
65 69
6670# Text verbosity for GPT-5 family (Responses API): low | medium | high (default: medium)# Text verbosity for GPT-5 family (Responses API): low | medium | high
67# model_verbosity = "medium"71# model_verbosity = "medium"
68 72
6973# Force enable or disable reasoning summaries for current model# Force enable or disable reasoning summaries for current model.
70# model_supports_reasoning_summaries = true74# model_supports_reasoning_summaries = true
71 75
72################################################################################76################################################################################
76# Additional user instructions are injected before AGENTS.md. Default: unset.80# Additional user instructions are injected before AGENTS.md. Default: unset.
77# developer_instructions = ""81# developer_instructions = ""
78 82
79# (Ignored) Optional legacy base instructions override (prefer AGENTS.md). Default: unset.
80# instructions = ""
81
82# Inline override for the history compaction prompt. Default: unset.83# Inline override for the history compaction prompt. Default: unset.
83# compact_prompt = ""84# compact_prompt = ""
84 85
86# Override the default commit co-author trailer. Set to "" to disable it.
87# commit_attribution = "Jane Doe <jane@example.com>"
88
85# Override built-in base instructions with a file path. Default: unset.89# Override built-in base instructions with a file path. Default: unset.
86# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"90# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"
87 91
88# Migration note: experimental_instructions_file was renamed to model_instructions_file (deprecated).
89
90# Load the compact prompt override from a file. Default: unset.92# Load the compact prompt override from a file. Default: unset.
91# experimental_compact_prompt_file = "/absolute/or/relative/path/to/compact_prompt.txt"93# experimental_compact_prompt_file = "/absolute/or/relative/path/to/compact_prompt.txt"
92 94
93# Legacy name for apply_patch_freeform. Default: false
94include_apply_patch_tool = false
95
96################################################################################95################################################################################
97# Notifications96# Notifications
98################################################################################97################################################################################
99 98
100# External notifier program (argv array). When unset: disabled.99# External notifier program (argv array). When unset: disabled.
101100# Example: notify = ["notify-send", "Codex"]# notify = ["notify-send", "Codex"]
102notify = [ ]
103 101
104################################################################################102################################################################################
105# Approval & Sandbox103# Approval & Sandbox
124# - danger-full-access (no sandbox; extremely risky)122# - danger-full-access (no sandbox; extremely risky)
125sandbox_mode = "read-only"123sandbox_mode = "read-only"
126 124
127[windows]
128# Native Windows sandbox mode (Windows only): unelevated | elevated
129sandbox = "unelevated"
130
131################################################################################125################################################################################
132# Authentication & Login126# Authentication & Login
133################################################################################127################################################################################
135# Where to persist CLI login credentials: file (default) | keyring | auto129# Where to persist CLI login credentials: file (default) | keyring | auto
136cli_auth_credentials_store = "file"130cli_auth_credentials_store = "file"
137 131
138132# Base URL for ChatGPT auth flow (not OpenAI API). Default:# Base URL for ChatGPT auth flow (not OpenAI API).
139chatgpt_base_url = "https://chatgpt.com/backend-api/"133chatgpt_base_url = "https://chatgpt.com/backend-api/"
140 134
141# Restrict ChatGPT login to a specific workspace id. Default: unset.135# Restrict ChatGPT login to a specific workspace id. Default: unset.
142136# forced_chatgpt_workspace_id = ""# forced_chatgpt_workspace_id = "00000000-0000-0000-0000-000000000000"
143 137
144# Force login mechanism when Codex would normally auto-select. Default: unset.138# Force login mechanism when Codex would normally auto-select. Default: unset.
145# Allowed values: chatgpt | api139# Allowed values: chatgpt | api
204# If you use --yolo or another full access sandbox setting, web search defaults to live.196# If you use --yolo or another full access sandbox setting, web search defaults to live.
205web_search = "cached"197web_search = "cached"
206 198
207################################################################################
208# Profiles (named presets)
209################################################################################
210
211# Active profile name. When unset, no profile is applied.199# Active profile name. When unset, no profile is applied.
212# profile = "default"200# profile = "default"
213 201
202# Suppress the warning shown when under-development feature flags are enabled.
203# suppress_unstable_features_warning = true
204
214################################################################################205################################################################################
215# Agents (multi-agent roles and limits)206# Agents (multi-agent roles and limits)
216################################################################################207################################################################################
217 208
218209# [agents][agents]
219# Maximum concurrently open agent threads. Default: 6210# Maximum concurrently open agent threads. Default: 6
220# max_threads = 6211# max_threads = 6
221# Maximum nested spawn depth. Root session starts at depth 0. Default: 1212# Maximum nested spawn depth. Root session starts at depth 0. Default: 1
224# job_max_runtime_seconds = 1800215# job_max_runtime_seconds = 1800
225 216
226# [agents.reviewer]217# [agents.reviewer]
227218# description = "Find security, correctness, and test risks in code."# description = "Find correctness, security, and test risks in code."
228# config_file = "./agents/reviewer.toml" # relative to the config.toml that defines it219# config_file = "./agents/reviewer.toml" # relative to the config.toml that defines it
220# nickname_candidates = ["Athena", "Ada"]
229 221
230################################################################################222################################################################################
231# Skills (per-skill overrides)223# Skills (per-skill overrides)
236# path = "/path/to/skill/SKILL.md"228# path = "/path/to/skill/SKILL.md"
237# enabled = false229# enabled = false
238 230
239################################################################################
240# Experimental toggles (legacy; prefer [features])
241################################################################################
242
243experimental_use_unified_exec_tool = false
244
245# Include apply_patch via freeform editing path (affects default tool set). Default: false
246experimental_use_freeform_apply_patch = false
247
248################################################################################231################################################################################
249# Sandbox settings (tables)232# Sandbox settings (tables)
250################################################################################233################################################################################
267[shell_environment_policy]250[shell_environment_policy]
268# inherit: all (default) | core | none251# inherit: all (default) | core | none
269inherit = "all"252inherit = "all"
270253# Skip default excludes for names containing KEY/SECRET/TOKEN (case-insensitive). Default: true# Skip default excludes for names containing KEY/SECRET/TOKEN (case-insensitive). Default: false
271254ignore_default_excludes = trueignore_default_excludes = false
272# Case-insensitive glob patterns to remove (e.g., "AWS_*", "AZURE_*"). Default: []255# Case-insensitive glob patterns to remove (e.g., "AWS_*", "AZURE_*"). Default: []
273exclude = []256exclude = []
274# Explicit key/value overrides (always win). Default: {}257# Explicit key/value overrides (always win). Default: {}
278# Experimental: run via user shell profile. Default: false261# Experimental: run via user shell profile. Default: false
279experimental_use_profile = false262experimental_use_profile = false
280 263
264################################################################################
265# Managed network proxy settings
266################################################################################
267
268[permissions.network]
269# enabled = true
270# proxy_url = "http://127.0.0.1:43128"
271# admin_url = "http://127.0.0.1:43129"
272# enable_socks5 = false
273# socks_url = "http://127.0.0.1:43130"
274# enable_socks5_udp = false
275# allow_upstream_proxy = false
276# dangerously_allow_non_loopback_proxy = false
277# dangerously_allow_non_loopback_admin = false
278# dangerously_allow_all_unix_sockets = false
279# mode = "limited" # limited | full
280# allowed_domains = ["api.openai.com"]
281# denied_domains = ["example.com"]
282# allow_unix_sockets = ["/var/run/docker.sock"]
283# allow_local_binding = false
284
281################################################################################285################################################################################
282# History (table)286# History (table)
283################################################################################287################################################################################
286# save-all (default) | none290# save-all (default) | none
287persistence = "save-all"291persistence = "save-all"
288# Maximum bytes for history file; oldest entries are trimmed when exceeded. Example: 5242880292# Maximum bytes for history file; oldest entries are trimmed when exceeded. Example: 5242880
289293# max_bytes = 0# max_bytes = 5242880
290 294
291################################################################################295################################################################################
292# UI, Notifications, and Misc (tables)296# UI, Notifications, and Misc (tables)
318# You can also add custom .tmTheme files under $CODEX_HOME/themes.322# You can also add custom .tmTheme files under $CODEX_HOME/themes.
319# theme = "catppuccin-mocha"323# theme = "catppuccin-mocha"
320 324
325# Internal tooltip state keyed by model slug. Usually managed by Codex.
326# [tui.model_availability_nux]
327# "gpt-5.4" = 1
328
329# Enable or disable analytics for this machine. When unset, Codex uses its default behavior.
330[analytics]
331enabled = true
332
321# Control whether users can submit feedback from `/feedback`. Default: true333# Control whether users can submit feedback from `/feedback`. Default: true
322[feedback]334[feedback]
323enabled = true335enabled = true
331# "hide_gpt-5.1-codex-max_migration_prompt" = true343# "hide_gpt-5.1-codex-max_migration_prompt" = true
332# model_migrations = { "gpt-4.1" = "gpt-5.1" }344# model_migrations = { "gpt-4.1" = "gpt-5.1" }
333 345
334# Suppress the warning shown when under-development feature flags are enabled.
335# suppress_unstable_features_warning = true
336
337################################################################################346################################################################################
338# Centralized Feature Flags (preferred)347# Centralized Feature Flags (preferred)
339################################################################################348################################################################################
343# shell_tool = true352# shell_tool = true
344# apps = false353# apps = false
345# apps_mcp_gateway = false354# apps_mcp_gateway = false
346# web_search_cached = false
347# web_search_request = false
348# unified_exec = false355# unified_exec = false
349# shell_snapshot = false356# shell_snapshot = false
350# apply_patch_freeform = false
351# multi_agent = false
352# search_tool = false
353# personality = true357# personality = true
354# request_rule = true
355# collaboration_modes = true
356# use_linux_sandbox_bwrap = false358# use_linux_sandbox_bwrap = false
357359# remote_models = false# runtime_metrics = true
358# runtime_metrics = false
359# powershell_utf8 = true360# powershell_utf8 = true
360# child_agents_md = false361# child_agents_md = false
362# sqlite = true
363# fast_mode = true
364# enable_request_compression = true
365# image_generation = false
366# skill_mcp_dependency_install = true
367# skill_env_var_dependency_prompt = false
368# default_mode_request_user_input = false
369# artifact = false
370# prevent_idle_sleep = false
371# responses_websockets = false
372# responses_websockets_v2 = false
373# image_detail_original = false
361 374
362################################################################################375################################################################################
363# Define MCP servers under this table. Leave empty to disable.376# Define MCP servers under this table. Leave empty to disable.
379# tool_timeout_sec = 60.0 # optional; default 60.0 seconds392# tool_timeout_sec = 60.0 # optional; default 60.0 seconds
380# enabled_tools = ["search", "summarize"] # optional allow-list393# enabled_tools = ["search", "summarize"] # optional allow-list
381# disabled_tools = ["slow-tool"] # optional deny-list (applied after allow-list)394# disabled_tools = ["slow-tool"] # optional deny-list (applied after allow-list)
395# scopes = ["read:docs"] # optional OAuth scopes
396# oauth_resource = "https://docs.example.com/" # optional OAuth resource
382 397
383# --- Example: Streamable HTTP transport ---398# --- Example: Streamable HTTP transport ---
384# [mcp_servers.github]399# [mcp_servers.github]
391# startup_timeout_sec = 10.0 # optional406# startup_timeout_sec = 10.0 # optional
392# tool_timeout_sec = 60.0 # optional407# tool_timeout_sec = 60.0 # optional
393# enabled_tools = ["list_issues"] # optional allow-list408# enabled_tools = ["list_issues"] # optional allow-list
409# disabled_tools = ["delete_issue"] # optional deny-list
410# scopes = ["repo"] # optional OAuth scopes
394 411
395################################################################################412################################################################################
396# Model Providers413# Model Providers
397################################################################################414################################################################################
398 415
399# Built-ins include:416# Built-ins include:
400417# - openai (Responses API; requires login or OPENAI_API_KEY via auth flow)# - openai
401418# - oss (Chat Completions API; defaults to http://localhost:11434/v1)# - ollama
419# - lmstudio
402 420
403[model_providers]421[model_providers]
404 422
406# [model_providers.openaidr]424# [model_providers.openaidr]
407# name = "OpenAI Data Residency"425# name = "OpenAI Data Residency"
408# base_url = "https://us.api.openai.com/v1" # example with 'us' domain prefix426# base_url = "https://us.api.openai.com/v1" # example with 'us' domain prefix
409427# wire_api = "responses" # "responses" | "chat" (default varies)# wire_api = "responses" # only supported value
410# # requires_openai_auth = true # built-in OpenAI defaults to true428# # requires_openai_auth = true # built-in OpenAI defaults to true
411# # request_max_retries = 4 # default 4; max 100429# # request_max_retries = 4 # default 4; max 100
412# # stream_max_retries = 5 # default 5; max 100430# # stream_max_retries = 5 # default 5; max 100
413# # stream_idle_timeout_ms = 300000 # default 300_000 (5m)431# # stream_idle_timeout_ms = 300000 # default 300_000 (5m)
432# # supports_websockets = true # optional
414# # experimental_bearer_token = "sk-example" # optional dev-only direct bearer token433# # experimental_bearer_token = "sk-example" # optional dev-only direct bearer token
415# # http_headers = { "X-Example" = "value" }434# # http_headers = { "X-Example" = "value" }
416# # env_http_headers = { "OpenAI-Organization" = "OPENAI_ORGANIZATION", "OpenAI-Project" = "OPENAI_PROJECT" }435# # env_http_headers = { "OpenAI-Organization" = "OPENAI_ORGANIZATION", "OpenAI-Project" = "OPENAI_PROJECT" }
417 436
418437# --- Example: Azure (Chat/Responses depending on endpoint) ---# --- Example: Azure/OpenAI-compatible provider ---
419# [model_providers.azure]438# [model_providers.azure]
420# name = "Azure"439# name = "Azure"
421# base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"440# base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"
422441# wire_api = "responses" # or "chat" per endpoint# wire_api = "responses"
423# query_params = { api-version = "2025-04-01-preview" }442# query_params = { api-version = "2025-04-01-preview" }
424# env_key = "AZURE_OPENAI_API_KEY"443# env_key = "AZURE_OPENAI_API_KEY"
425444# # env_key_instructions = "Set AZURE_OPENAI_API_KEY in your environment"# env_key_instructions = "Set AZURE_OPENAI_API_KEY in your environment"
445# # supports_websockets = false
426 446
427# --- Example: Local OSS (e.g., Ollama-compatible) ---447# --- Example: Local OSS (e.g., Ollama-compatible) ---
428# [model_providers.ollama]448# [model_providers.ollama]
429# name = "Ollama"449# name = "Ollama"
430# base_url = "http://localhost:11434/v1"450# base_url = "http://localhost:11434/v1"
431451# wire_api = "chat"# wire_api = "responses"
432
433################################################################################
434# Profiles (named presets)
435################################################################################
436
437[profiles]
438
439# [profiles.default]
440# model = "gpt-5.4"
441# model_provider = "openai"
442# approval_policy = "on-request"
443# sandbox_mode = "read-only"
444# oss_provider = "ollama"
445# model_reasoning_effort = "medium"
446# model_reasoning_summary = "auto"
447# model_verbosity = "medium"
448# personality = "friendly" # or "pragmatic" or "none"
449# chatgpt_base_url = "https://chatgpt.com/backend-api/"
450# model_catalog_json = "./models.json"
451# experimental_compact_prompt_file = "./compact_prompt.txt"
452# include_apply_patch_tool = false
453# experimental_use_unified_exec_tool = false
454# experimental_use_freeform_apply_patch = false
455# tools.web_search = false # deprecated legacy alias; prefer top-level `web_search`
456# features = { unified_exec = false }
457 452
458################################################################################453################################################################################
459# Apps / Connectors454# Apps / Connectors
477# enabled = false472# enabled = false
478# approval_mode = "approve"473# approval_mode = "approve"
479 474
475################################################################################
476# Profiles (named presets)
477################################################################################
478
479[profiles]
480
481# [profiles.default]
482# model = "gpt-5.4"
483# model_provider = "openai"
484# approval_policy = "on-request"
485# sandbox_mode = "read-only"
486# service_tier = "flex"
487# oss_provider = "ollama"
488# model_reasoning_effort = "medium"
489# plan_mode_reasoning_effort = "high"
490# model_reasoning_summary = "auto"
491# model_verbosity = "medium"
492# personality = "pragmatic" # or "friendly" or "none"
493# chatgpt_base_url = "https://chatgpt.com/backend-api/"
494# model_catalog_json = "./models.json"
495# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"
496# experimental_compact_prompt_file = "./compact_prompt.txt"
497# tools_view_image = true
498# features = { unified_exec = false }
499
480################################################################################500################################################################################
481# Projects (trust levels)501# Projects (trust levels)
482################################################################################502################################################################################
483 503
484# Mark specific worktrees as trusted or untrusted.
485[projects]504[projects]
505# Mark specific worktrees as trusted or untrusted.
486# [projects."/absolute/path/to/project"]506# [projects."/absolute/path/to/project"]
487# trust_level = "trusted" # or "untrusted"507# trust_level = "trusted" # or "untrusted"
488 508
509################################################################################
510# Tools
511################################################################################
512
513[tools]
514# view_image = true
515
489################################################################################516################################################################################
490# OpenTelemetry (OTEL) - disabled by default517# OpenTelemetry (OTEL) - disabled by default
491################################################################################518################################################################################
499exporter = "none"526exporter = "none"
500# Trace exporter: none (default) | otlp-http | otlp-grpc527# Trace exporter: none (default) | otlp-http | otlp-grpc
501trace_exporter = "none"528trace_exporter = "none"
529# Metrics exporter: none | statsig | otlp-http | otlp-grpc
530metrics_exporter = "statsig"
502 531
503# Example OTLP/HTTP exporter configuration532# Example OTLP/HTTP exporter configuration
504# [otel.exporter."otlp-http"]533# [otel.exporter."otlp-http"]
508# [otel.exporter."otlp-http".headers]537# [otel.exporter."otlp-http".headers]
509# "x-otlp-api-key" = "${OTLP_TOKEN}"538# "x-otlp-api-key" = "${OTLP_TOKEN}"
510 539
511# Example OTLP/gRPC exporter configuration
512# [otel.exporter."otlp-grpc"]
513# endpoint = "https://otel.example.com:4317",
514# headers = { "x-otlp-meta" = "abc123" }
515
516# Example OTLP exporter with mutual TLS
517# [otel.exporter."otlp-http"]
518# endpoint = "https://otel.example.com/v1/logs"
519# protocol = "binary"
520
521# [otel.exporter."otlp-http".headers]
522# "x-otlp-api-key" = "${OTLP_TOKEN}"
523
524# [otel.exporter."otlp-http".tls]540# [otel.exporter."otlp-http".tls]
525# ca-certificate = "certs/otel-ca.pem"541# ca-certificate = "certs/otel-ca.pem"
526# client-certificate = "/etc/codex/certs/client.pem"542# client-certificate = "/etc/codex/certs/client.pem"
527# client-private-key = "/etc/codex/certs/client-key.pem"543# client-private-key = "/etc/codex/certs/client-key.pem"
528```
529 544
530545################################################################################# Example OTLP/gRPC trace exporter configuration
546# [otel.trace_exporter."otlp-grpc"]
547# endpoint = "https://otel.example.com:4317"
548# headers = { "x-otlp-meta" = "abc123" }
531 549
550################################################################################
532# Windows551# Windows
533
534################################################################################552################################################################################
535 553
536[windows]554[windows]
537555 # Native Windows sandbox mode (Windows only): unelevated | elevated
538556# Native Windows sandbox mode (Windows only). The example below uses thesandbox = "unelevated"
539557 ```
540# recommended elevated mode.
541
542sandbox = “elevated”