Use this page as a searchable reference for Codex configuration files. For conceptual guidance and examples, start with Config basics and Advanced Config.
config.toml
User-level configuration lives in ~/.codex/config.toml. You can also add project-scoped overrides in .codex/config.toml files. Codex loads project-scoped config files only when you trust the project.
For sandbox and approval keys (approval_policy, sandbox_mode, and sandbox_workspace_write.*), pair this reference with Sandbox and approvals, Protected paths in writable roots, and Network access.
| Key | Type / Values | Details |
|---|---|---|
agents.<name>.config_file | string (path) | Path to a TOML config layer for that role; relative paths resolve from the config file that declares the role. |
agents.<name>.description | string | Role guidance shown to Codex when choosing and spawning that agent type. |
agents.<name>.nickname_candidates | array<string> | Optional pool of display nicknames for spawned agents in that role. |
agents.job_max_runtime_seconds | number | Default per-worker timeout for spawn_agents_on_csv jobs. When unset, the tool falls back to 1800 seconds per worker. |
agents.max_depth | number | Maximum nesting depth allowed for spawned agent threads (root sessions start at depth 0; default: 1). |
agents.max_threads | number | Maximum number of agent threads that can be open concurrently. Defaults to 6 when unset. |
allow_login_shell | boolean | Allow shell-based tools to use login-shell semantics. Defaults to true; when false, login = true requests are rejected and omitted login defaults to non-login shells. |
analytics.enabled | boolean | Enable or disable analytics for this machine/profile. When unset, the client default applies. |
approval_policy | untrusted | on-request | never | { granular = { sandbox_approval = bool, rules = bool, mcp_elicitations = bool, request_permissions = bool, skill_approval = bool } } | Controls when Codex pauses for approval before executing commands. You can also use approval_policy = { granular = { ... } } to allow or auto-reject specific prompt categories while keeping other prompts interactive. on-failure is deprecated; use on-request for interactive runs or never for non-interactive runs. |
approval_policy.granular.mcp_elicitations | boolean | When true, MCP elicitation prompts are allowed to surface instead of being auto-rejected. |
approval_policy.granular.request_permissions | boolean | When true, prompts from the request_permissions tool are allowed to surface. |
approval_policy.granular.rules | boolean | When true, approvals triggered by execpolicy prompt rules are allowed to surface. |
approval_policy.granular.sandbox_approval | boolean | When true, sandbox escalation approval prompts are allowed to surface. |
approval_policy.granular.skill_approval | boolean | When true, skill-script approval prompts are allowed to surface. |
apps._default.destructive_enabled | boolean | Default allow/deny for app tools with destructive_hint = true. |
apps._default.enabled | boolean | Default app enabled state for all apps unless overridden per app. |
apps._default.open_world_enabled | boolean | Default allow/deny for app tools with open_world_hint = true. |
apps.<id>.default_tools_approval_mode | auto | prompt | approve | Default approval behavior for tools in this app unless a per-tool override exists. |
apps.<id>.default_tools_enabled | boolean | Default enabled state for tools in this app unless a per-tool override exists. |
apps.<id>.destructive_enabled | boolean | Allow or block tools in this app that advertise destructive_hint = true. |
apps.<id>.enabled | boolean | Enable or disable a specific app/connector by id (default: true). |
apps.<id>.open_world_enabled | boolean | Allow or block tools in this app that advertise open_world_hint = true. |
apps.<id>.tools.<tool>.approval_mode | auto | prompt | approve | Per-tool approval behavior override for a single app tool. |
apps.<id>.tools.<tool>.enabled | boolean | Per-tool enabled override for an app tool (for example repos/list). |
background_terminal_max_timeout | number | Maximum poll window in milliseconds for empty write_stdin polls (background terminal polling). Default: 300000 (5 minutes). Replaces the older background_terminal_timeout key. |
chatgpt_base_url | string | Override the base URL used during the ChatGPT login flow. |
check_for_update_on_startup | boolean | Check for Codex updates on startup (set to false only when updates are centrally managed). |
cli_auth_credentials_store | file | keyring | auto | Control where the CLI stores cached credentials (file-based auth.json vs OS keychain). |
commit_attribution | string | Override the commit co-author trailer text. Set an empty string to disable automatic attribution. |
compact_prompt | string | Inline override for the history compaction prompt. |
default_permissions | string | Name of the default permissions profile to apply to sandboxed tool calls. |
developer_instructions | string | Additional developer instructions injected into the session (optional). |
disable_paste_burst | boolean | Disable burst-paste detection in the TUI. |
experimental_compact_prompt_file | string (path) | Load the compaction prompt override from a file (experimental). |
experimental_use_unified_exec_tool | boolean | Legacy name for enabling unified exec; prefer [features].unified_exec or codex --enable unified_exec. |
features.apps | boolean | Enable ChatGPT Apps/connectors support (experimental). |
features.enable_request_compression | boolean | Compress streaming request bodies with zstd when supported (stable; on by default). |
features.fast_mode | boolean | Enable Fast mode selection and the service_tier = "fast" path (stable; on by default). |
features.multi_agent | boolean | Enable multi-agent collaboration tools ( spawn_agent, send_input, resume_agent, wait_agent, and close_agent) (stable; on by default). |
features.personality | boolean | Enable personality selection controls (stable; on by default). |
features.prevent_idle_sleep | boolean | Prevent the machine from sleeping while a turn is actively running (experimental; off by default). |
features.shell_snapshot | boolean | Snapshot shell environment to speed up repeated commands (stable; on by default). |
features.shell_tool | boolean | Enable the default shell tool for running commands (stable; on by default). |
features.skill_mcp_dependency_install | boolean | Allow prompting and installing missing MCP dependencies for skills (stable; on by default). |
features.smart_approvals | boolean | Route eligible approval requests through the guardian reviewer subagent (experimental; off by default). |
features.undo | boolean | Enable undo support (stable; off by default). |
features.unified_exec | boolean | Use the unified PTY-backed exec tool (stable; enabled by default except on Windows). |
features.web_search | boolean | Deprecated legacy toggle; prefer the top-level web_search setting. |
features.web_search_cached | boolean | Deprecated legacy toggle. When web_search is unset, true maps to web_search = "cached". |
features.web_search_request | boolean | Deprecated legacy toggle. When web_search is unset, true maps to web_search = "live". |
feedback.enabled | boolean | Enable feedback submission via /feedback across Codex surfaces (default: true). |
file_opener | vscode | vscode-insiders | windsurf | cursor | none | URI scheme used to open citations from Codex output (default: vscode). |
forced_chatgpt_workspace_id | string (uuid) | Limit ChatGPT logins to a specific workspace identifier. |
forced_login_method | chatgpt | api | Restrict Codex to a specific authentication method. |
hide_agent_reasoning | boolean | Suppress reasoning events in both the TUI and codex exec output. |
history.max_bytes | number | If set, caps the history file size in bytes by dropping oldest entries. |
history.persistence | save-all | none | Control whether Codex saves session transcripts to history.jsonl. |
instructions | string | Reserved for future use; prefer model_instructions_file or AGENTS.md. |
log_dir | string (path) | Directory where Codex writes log files (for example codex-tui.log); defaults to $CODEX_HOME/log. |
mcp_oauth_callback_port | integer | Optional fixed port for the local HTTP callback server used during MCP OAuth login. When unset, Codex binds to an ephemeral port chosen by the OS. |
mcp_oauth_callback_url | string | Optional redirect URI override for MCP OAuth login (for example, a devbox ingress URL). mcp_oauth_callback_port still controls the callback listener port. |
mcp_oauth_credentials_store | auto | file | keyring | Preferred store for MCP OAuth credentials. |
mcp_servers.<id>.args | array<string> | Arguments passed to the MCP stdio server command. |
mcp_servers.<id>.bearer_token_env_var | string | Environment variable sourcing the bearer token for an MCP HTTP server. |
mcp_servers.<id>.command | string | Launcher command for an MCP stdio server. |
mcp_servers.<id>.cwd | string | Working directory for the MCP stdio server process. |
mcp_servers.<id>.disabled_tools | array<string> | Deny list applied after enabled_tools for the MCP server. |
mcp_servers.<id>.enabled | boolean | Disable an MCP server without removing its configuration. |
mcp_servers.<id>.enabled_tools | array<string> | Allow list of tool names exposed by the MCP server. |
mcp_servers.<id>.env | map<string,string> | Environment variables forwarded to the MCP stdio server. |
mcp_servers.<id>.env_http_headers | map<string,string> | HTTP headers populated from environment variables for an MCP HTTP server. |
mcp_servers.<id>.env_vars | array<string> | Additional environment variables to whitelist for an MCP stdio server. |
mcp_servers.<id>.http_headers | map<string,string> | Static HTTP headers included with each MCP HTTP request. |
mcp_servers.<id>.oauth_resource | string | Optional RFC 8707 OAuth resource parameter to include during MCP login. |
mcp_servers.<id>.required | boolean | When true, fail startup/resume if this enabled MCP server cannot initialize. |
mcp_servers.<id>.scopes | array<string> | OAuth scopes to request when authenticating to that MCP server. |
mcp_servers.<id>.startup_timeout_ms | number | Alias for startup_timeout_sec in milliseconds. |
mcp_servers.<id>.startup_timeout_sec | number | Override the default 10s startup timeout for an MCP server. |
mcp_servers.<id>.tool_timeout_sec | number | Override the default 60s per-tool timeout for an MCP server. |
mcp_servers.<id>.url | string | Endpoint for an MCP streamable HTTP server. |
model | string | Model to use (e.g., gpt-5-codex). |
model_auto_compact_token_limit | number | Token threshold that triggers automatic history compaction (unset uses model defaults). |
model_catalog_json | string (path) | Optional path to a JSON model catalog loaded on startup. Profile-level profiles.<name>.model_catalog_json can override this per profile. |
model_context_window | number | Context window tokens available to the active model. |
model_instructions_file | string (path) | Replacement for built-in instructions instead of AGENTS.md. |
model_provider | string | Provider id from model_providers (default: openai). |
model_providers.<id>.base_url | string | API base URL for the model provider. |
model_providers.<id>.env_http_headers | map<string,string> | HTTP headers populated from environment variables when present. |
model_providers.<id>.env_key | string | Environment variable supplying the provider API key. |
model_providers.<id>.env_key_instructions | string | Optional setup guidance for the provider API key. |
model_providers.<id>.experimental_bearer_token | string | Direct bearer token for the provider (discouraged; use env_key). |
model_providers.<id>.http_headers | map<string,string> | Static HTTP headers added to provider requests. |
model_providers.<id>.name | string | Display name for a custom model provider. |
model_providers.<id>.query_params | map<string,string> | Extra query parameters appended to provider requests. |
model_providers.<id>.request_max_retries | number | Retry count for HTTP requests to the provider (default: 4). |
model_providers.<id>.requires_openai_auth | boolean | The provider uses OpenAI authentication (defaults to false). |
model_providers.<id>.stream_idle_timeout_ms | number | Idle timeout for SSE streams in milliseconds (default: 300000). |
model_providers.<id>.stream_max_retries | number | Retry count for SSE streaming interruptions (default: 5). |
model_providers.<id>.supports_websockets | boolean | Whether that provider supports the Responses API WebSocket transport. |
model_providers.<id>.wire_api | responses | Protocol used by the provider. responses is the only supported value, and it is the default when omitted. |
model_reasoning_effort | minimal | low | medium | high | xhigh | Adjust reasoning effort for supported models (Responses API only; xhigh is model-dependent). |
model_reasoning_summary | auto | concise | detailed | none | Select reasoning summary detail or disable summaries entirely. |
model_supports_reasoning_summaries | boolean | Force Codex to send or not send reasoning metadata. |
model_verbosity | low | medium | high | Optional GPT-5 Responses API verbosity override; when unset, the selected model/preset default is used. |
notice.hide_full_access_warning | boolean | Track acknowledgement of the full access warning prompt. |
notice.hide_gpt-5.1-codex-max_migration_prompt | boolean | Track acknowledgement of the gpt-5.1-codex-max migration prompt. |
notice.hide_gpt5_1_migration_prompt | boolean | Track acknowledgement of the GPT-5.1 migration prompt. |
notice.hide_rate_limit_model_nudge | boolean | Track opt-out of the rate limit model switch reminder. |
notice.hide_world_writable_warning | boolean | Track acknowledgement of the Windows world-writable directories warning. |
notice.model_migrations | map<string,string> | Track acknowledged model migrations as old->new mappings. |
notify | array<string> | Command invoked for notifications; receives a JSON payload from Codex. |
openai_base_url | string | Base URL override for the built-in openai model provider. |
oss_provider | lmstudio | ollama | Default local provider used when running with --oss (defaults to prompting if unset). |
otel.environment | string | Environment tag applied to emitted OpenTelemetry events (default: dev). |
otel.exporter | none | otlp-http | otlp-grpc | Select the OpenTelemetry exporter and provide any endpoint metadata. |
otel.exporter.<id>.endpoint | string | Exporter endpoint for OTEL logs. |
otel.exporter.<id>.headers | map<string,string> | Static headers included with OTEL exporter requests. |
otel.exporter.<id>.protocol | binary | json | Protocol used by the OTLP/HTTP exporter. |
otel.exporter.<id>.tls.ca-certificate | string | CA certificate path for OTEL exporter TLS. |
otel.exporter.<id>.tls.client-certificate | string | Client certificate path for OTEL exporter TLS. |
otel.exporter.<id>.tls.client-private-key | string | Client private key path for OTEL exporter TLS. |
otel.log_user_prompt | boolean | Opt in to exporting raw user prompts with OpenTelemetry logs. |
otel.metrics_exporter | none | statsig | otlp-http | otlp-grpc | Select the OpenTelemetry metrics exporter (defaults to statsig). |
otel.trace_exporter | none | otlp-http | otlp-grpc | Select the OpenTelemetry trace exporter and provide any endpoint metadata. |
otel.trace_exporter.<id>.endpoint | string | Trace exporter endpoint for OTEL logs. |
otel.trace_exporter.<id>.headers | map<string,string> | Static headers included with OTEL trace exporter requests. |
otel.trace_exporter.<id>.protocol | binary | json | Protocol used by the OTLP/HTTP trace exporter. |
otel.trace_exporter.<id>.tls.ca-certificate | string | CA certificate path for OTEL trace exporter TLS. |
otel.trace_exporter.<id>.tls.client-certificate | string | Client certificate path for OTEL trace exporter TLS. |
otel.trace_exporter.<id>.tls.client-private-key | string | Client private key path for OTEL trace exporter TLS. |
permissions.<name>.filesystem | table | Named filesystem permission profile. Each key is an absolute path or special token such as :minimal or :project_roots. |
permissions.<name>.filesystem.":project_roots".<subpath> | "read" | "write" | "none" | Scoped filesystem access relative to the detected project roots. Use "." for the root itself. |
permissions.<name>.filesystem.<path> | "read" | "write" | "none" | table | Grant direct access for a path or special token, or scope nested entries under that root. |
permissions.<name>.network.allow_local_binding | boolean | Permit local bind/listen operations through the managed proxy. |
permissions.<name>.network.allow_unix_sockets | array<string> | Allowlist of Unix socket paths permitted through the managed proxy. |
permissions.<name>.network.allow_upstream_proxy | boolean | Allow the managed proxy to chain to another upstream proxy. |
permissions.<name>.network.allowed_domains | array<string> | Allowlist of domains permitted through the managed proxy. |
permissions.<name>.network.dangerously_allow_all_unix_sockets | boolean | Allow the proxy to use arbitrary Unix sockets instead of the default restricted set. |
permissions.<name>.network.dangerously_allow_non_loopback_proxy | boolean | Permit non-loopback bind addresses for the managed proxy listener. |
permissions.<name>.network.denied_domains | array<string> | Denylist of domains blocked by the managed proxy. |
permissions.<name>.network.enable_socks5 | boolean | Expose a SOCKS5 listener when this permissions profile enables the managed network proxy. |
permissions.<name>.network.enable_socks5_udp | boolean | Allow UDP over the SOCKS5 listener when enabled. |
permissions.<name>.network.enabled | boolean | Enable network access for this named permissions profile. |
permissions.<name>.network.mode | limited | full | Network proxy mode used for subprocess traffic. |
permissions.<name>.network.proxy_url | string | HTTP proxy endpoint used when this permissions profile enables the managed network proxy. |
permissions.<name>.network.socks_url | string | SOCKS5 proxy endpoint used by this permissions profile. |
personality | none | friendly | pragmatic | Default communication style for models that advertise supportsPersonality; can be overridden per thread/turn or via /personality. |
plan_mode_reasoning_effort | none | minimal | low | medium | high | xhigh | Plan-mode-specific reasoning override. When unset, Plan mode uses its built-in preset default. |
profile | string | Default profile applied at startup (equivalent to --profile). |
profiles.<name>.* | various | Profile-scoped overrides for any of the supported configuration keys. |
profiles.<name>.analytics.enabled | boolean | Profile-scoped analytics enablement override. |
profiles.<name>.experimental_use_unified_exec_tool | boolean | Legacy name for enabling unified exec; prefer [features].unified_exec. |
profiles.<name>.model_catalog_json | string (path) | Profile-scoped model catalog JSON path override (applied on startup only; overrides the top-level model_catalog_json for that profile). |
profiles.<name>.model_instructions_file | string (path) | Profile-scoped replacement for the built-in instruction file. |
profiles.<name>.oss_provider | lmstudio | ollama | Profile-scoped OSS provider for --oss sessions. |
profiles.<name>.personality | none | friendly | pragmatic | Profile-scoped communication style override for supported models. |
profiles.<name>.plan_mode_reasoning_effort | none | minimal | low | medium | high | xhigh | Profile-scoped Plan-mode reasoning override. |
profiles.<name>.service_tier | flex | fast | Profile-scoped service tier preference for new turns. |
profiles.<name>.tools_view_image | boolean | Enable or disable the view_image tool in that profile. |
profiles.<name>.web_search | disabled | cached | live | Profile-scoped web search mode override (default: "cached"). |
profiles.<name>.windows.sandbox | unelevated | elevated | Profile-scoped Windows sandbox mode override. |
project_doc_fallback_filenames | array<string> | Additional filenames to try when AGENTS.md is missing. |
project_doc_max_bytes | number | Maximum bytes read from AGENTS.md when building project instructions. |
project_root_markers | array<string> | List of project root marker filenames; used when searching parent directories for the project root. |
projects.<path>.trust_level | string | Mark a project or worktree as trusted or untrusted ( "trusted" | "untrusted"). Untrusted projects skip project-scoped .codex/ layers. |
review_model | string | Optional model override used by /review (defaults to the current session model). |
sandbox_mode | read-only | workspace-write | danger-full-access | Sandbox policy for filesystem and network access during command execution. |
sandbox_workspace_write.exclude_slash_tmp | boolean | Exclude /tmp from writable roots in workspace-write mode. |
sandbox_workspace_write.exclude_tmpdir_env_var | boolean | Exclude $TMPDIR from writable roots in workspace-write mode. |
sandbox_workspace_write.network_access | boolean | Allow outbound network access inside the workspace-write sandbox. |
sandbox_workspace_write.writable_roots | array<string> | Additional writable roots when sandbox_mode = "workspace-write". |
service_tier | flex | fast | Preferred service tier for new turns. |
shell_environment_policy.exclude | array<string> | Glob patterns for removing environment variables after the defaults. |
shell_environment_policy.experimental_use_profile | boolean | Use the user shell profile when spawning subprocesses. |
shell_environment_policy.ignore_default_excludes | boolean | Keep variables containing KEY/SECRET/TOKEN before other filters run. |
shell_environment_policy.include_only | array<string> | Whitelist of patterns; when set only matching variables are kept. |
shell_environment_policy.inherit | all | core | none | Baseline environment inheritance when spawning subprocesses. |
shell_environment_policy.set | map<string,string> | Explicit environment overrides injected into every subprocess. |
show_raw_agent_reasoning | boolean | Surface raw reasoning content when the active model emits it. |
skills.config | array<object> | Per-skill enablement overrides stored in config.toml. |
skills.config.<index>.enabled | boolean | Enable or disable the referenced skill. |
skills.config.<index>.path | string (path) | Path to a skill folder containing SKILL.md. |
sqlite_home | string (path) | Directory where Codex stores the SQLite-backed state DB used by agent jobs and other resumable runtime state. |
suppress_unstable_features_warning | boolean | Suppress the warning that appears when under-development feature flags are enabled. |
tool_output_token_limit | number | Token budget for storing individual tool/function outputs in history. |
tools.view_image | boolean | Enable the local-image attachment tool view_image. |
tools.web_search | boolean | { context_size = "low|medium|high", allowed_domains = [string], location = { country, region, city, timezone } } | Optional web search tool configuration. The legacy boolean form is still accepted, but the object form lets you set search context size, allowed domains, and approximate user location. |
tui | table | TUI-specific options such as enabling inline desktop notifications. |
tui.alternate_screen | auto | always | never | Control alternate screen usage for the TUI (default: auto; auto skips it in Zellij to preserve scrollback). |
tui.animations | boolean | Enable terminal animations (welcome screen, shimmer, spinner) (default: true). |
tui.model_availability_nux.<model> | integer | Internal startup-tooltip state keyed by model slug. |
tui.notification_method | auto | osc9 | bel | Notification method for unfocused terminal notifications (default: auto). |
tui.notifications | boolean | array<string> | Enable TUI notifications; optionally restrict to specific event types. |
tui.show_tooltips | boolean | Show onboarding tooltips in the TUI welcome screen (default: true). |
tui.status_line | array<string> | null | Ordered list of TUI footer status-line item identifiers. null disables the status line. |
tui.theme | string | Syntax-highlighting theme override (kebab-case theme name). |
web_search | disabled | cached | live | Web search mode (default: "cached"; cached uses an OpenAI-maintained index and does not fetch live pages; if you use --yolo or another full access sandbox setting, it defaults to "live"). Use "live" to fetch the most recent data from the web, or "disabled" to remove the tool. |
windows_wsl_setup_acknowledged | boolean | Track Windows onboarding acknowledgement (Windows only). |
windows.sandbox | unelevated | elevated | Windows-only native sandbox mode when running Codex natively on Windows. |
windows.sandbox_private_desktop | boolean | Run the final sandboxed child process on a private desktop by default on native Windows. Set false only for compatibility with the older Winsta0\\Default behavior. |
agents.<name>.config_filestring (path)agents.<name>.descriptionstringagents.<name>.nickname_candidatesarray<string>agents.job_max_runtime_secondsnumberspawn_agents_on_csv jobs. When unset, the tool falls back to 1800 seconds per worker.agents.max_depthnumberagents.max_threadsnumber6 when unset.allow_login_shellbooleantrue; when false, login = true requests are rejected and omitted login defaults to non-login shells.analytics.enabledbooleanapproval_policyuntrusted | on-request | never | { granular = { sandbox_approval = bool, rules = bool, mcp_elicitations = bool, request_permissions = bool, skill_approval = bool } }approval_policy = { granular = { ... } } to allow or auto-reject specific prompt categories while keeping other prompts interactive. on-failure is deprecated; use on-request for interactive runs or never for non-interactive runs.approval_policy.granular.mcp_elicitationsbooleantrue, MCP elicitation prompts are allowed to surface instead of being auto-rejected.approval_policy.granular.request_permissionsbooleantrue, prompts from the request_permissions tool are allowed to surface.approval_policy.granular.rulesbooleantrue, approvals triggered by execpolicy prompt rules are allowed to surface.approval_policy.granular.sandbox_approvalbooleantrue, sandbox escalation approval prompts are allowed to surface.approval_policy.granular.skill_approvalbooleantrue, skill-script approval prompts are allowed to surface.apps._default.destructive_enabledbooleandestructive_hint = true.apps._default.enabledbooleanapps._default.open_world_enabledbooleanopen_world_hint = true.apps.<id>.default_tools_approval_modeauto | prompt | approveapps.<id>.default_tools_enabledbooleanapps.<id>.destructive_enabledbooleandestructive_hint = true.apps.<id>.enabledbooleanapps.<id>.open_world_enabledbooleanopen_world_hint = true.apps.<id>.tools.<tool>.approval_modeauto | prompt | approveapps.<id>.tools.<tool>.enabledbooleanrepos/list).background_terminal_max_timeoutnumberwrite_stdin polls (background terminal polling). Default: 300000 (5 minutes). Replaces the older background_terminal_timeout key.chatgpt_base_urlstringcheck_for_update_on_startupbooleancli_auth_credentials_storefile | keyring | autocommit_attributionstringcompact_promptstringdefault_permissionsstringdeveloper_instructionsstringdisable_paste_burstbooleanexperimental_compact_prompt_filestring (path)experimental_use_unified_exec_toolboolean[features].unified_exec or codex --enable unified_exec.features.appsbooleanfeatures.enable_request_compressionbooleanfeatures.fast_modebooleanservice_tier = "fast" path (stable; on by default).features.multi_agentbooleanspawn_agent, send_input, resume_agent, wait_agent, and close_agent) (stable; on by default).features.personalitybooleanfeatures.prevent_idle_sleepbooleanfeatures.shell_snapshotbooleanfeatures.shell_toolbooleanshell tool for running commands (stable; on by default).features.skill_mcp_dependency_installbooleanfeatures.smart_approvalsbooleanfeatures.undobooleanfeatures.unified_execbooleanfeatures.web_searchbooleanweb_search setting.features.web_search_cachedbooleanweb_search is unset, true maps to web_search = "cached".features.web_search_requestbooleanweb_search is unset, true maps to web_search = "live".feedback.enabledboolean/feedback across Codex surfaces (default: true).file_openervscode | vscode-insiders | windsurf | cursor | nonevscode).forced_chatgpt_workspace_idstring (uuid)forced_login_methodchatgpt | apihide_agent_reasoningbooleancodex exec output.history.max_bytesnumberhistory.persistencesave-all | noneinstructionsstringmodel_instructions_file or AGENTS.md.log_dirstring (path)codex-tui.log); defaults to $CODEX_HOME/log.mcp_oauth_callback_portintegermcp_oauth_callback_urlstringmcp_oauth_callback_port still controls the callback listener port.mcp_oauth_credentials_storeauto | file | keyringmcp_servers.<id>.argsarray<string>mcp_servers.<id>.bearer_token_env_varstringmcp_servers.<id>.commandstringmcp_servers.<id>.cwdstringmcp_servers.<id>.disabled_toolsarray<string>enabled_tools for the MCP server.mcp_servers.<id>.enabledbooleanmcp_servers.<id>.enabled_toolsarray<string>mcp_servers.<id>.envmap<string,string>mcp_servers.<id>.env_http_headersmap<string,string>mcp_servers.<id>.env_varsarray<string>mcp_servers.<id>.http_headersmap<string,string>mcp_servers.<id>.oauth_resourcestringmcp_servers.<id>.requiredbooleanmcp_servers.<id>.scopesarray<string>mcp_servers.<id>.startup_timeout_msnumberstartup_timeout_sec in milliseconds.mcp_servers.<id>.startup_timeout_secnumbermcp_servers.<id>.tool_timeout_secnumbermcp_servers.<id>.urlstringmodelstringgpt-5-codex).model_auto_compact_token_limitnumbermodel_catalog_jsonstring (path)profiles.<name>.model_catalog_json can override this per profile.model_context_windownumbermodel_instructions_filestring (path)AGENTS.md.model_providerstringmodel_providers (default: openai).model_providers.<id>.base_urlstringmodel_providers.<id>.env_http_headersmap<string,string>model_providers.<id>.env_keystringmodel_providers.<id>.env_key_instructionsstringmodel_providers.<id>.experimental_bearer_tokenstringenv_key).model_providers.<id>.http_headersmap<string,string>model_providers.<id>.namestringmodel_providers.<id>.query_paramsmap<string,string>model_providers.<id>.request_max_retriesnumbermodel_providers.<id>.requires_openai_authbooleanmodel_providers.<id>.stream_idle_timeout_msnumbermodel_providers.<id>.stream_max_retriesnumbermodel_providers.<id>.supports_websocketsbooleanmodel_providers.<id>.wire_apiresponsesresponses is the only supported value, and it is the default when omitted.model_reasoning_effortminimal | low | medium | high | xhighxhigh is model-dependent).model_reasoning_summaryauto | concise | detailed | nonemodel_supports_reasoning_summariesbooleanmodel_verbositylow | medium | highnotice.hide_full_access_warningbooleannotice.hide_gpt-5.1-codex-max_migration_promptbooleannotice.hide_gpt5_1_migration_promptbooleannotice.hide_rate_limit_model_nudgebooleannotice.hide_world_writable_warningbooleannotice.model_migrationsmap<string,string>notifyarray<string>openai_base_urlstringopenai model provider.oss_providerlmstudio | ollama--oss (defaults to prompting if unset).otel.environmentstringdev).otel.exporternone | otlp-http | otlp-grpcotel.exporter.<id>.endpointstringotel.exporter.<id>.headersmap<string,string>otel.exporter.<id>.protocolbinary | jsonotel.exporter.<id>.tls.ca-certificatestringotel.exporter.<id>.tls.client-certificatestringotel.exporter.<id>.tls.client-private-keystringotel.log_user_promptbooleanotel.metrics_exporternone | statsig | otlp-http | otlp-grpcstatsig).otel.trace_exporternone | otlp-http | otlp-grpcotel.trace_exporter.<id>.endpointstringotel.trace_exporter.<id>.headersmap<string,string>otel.trace_exporter.<id>.protocolbinary | jsonotel.trace_exporter.<id>.tls.ca-certificatestringotel.trace_exporter.<id>.tls.client-certificatestringotel.trace_exporter.<id>.tls.client-private-keystringpermissions.<name>.filesystemtable:minimal or :project_roots.permissions.<name>.filesystem.":project_roots".<subpath>"read" | "write" | "none""." for the root itself.permissions.<name>.filesystem.<path>"read" | "write" | "none" | tablepermissions.<name>.network.allow_local_bindingbooleanpermissions.<name>.network.allow_unix_socketsarray<string>permissions.<name>.network.allow_upstream_proxybooleanpermissions.<name>.network.allowed_domainsarray<string>permissions.<name>.network.dangerously_allow_all_unix_socketsbooleanpermissions.<name>.network.dangerously_allow_non_loopback_proxybooleanpermissions.<name>.network.denied_domainsarray<string>permissions.<name>.network.enable_socks5booleanpermissions.<name>.network.enable_socks5_udpbooleanpermissions.<name>.network.enabledbooleanpermissions.<name>.network.modelimited | fullpermissions.<name>.network.proxy_urlstringpermissions.<name>.network.socks_urlstringpersonalitynone | friendly | pragmaticsupportsPersonality; can be overridden per thread/turn or via /personality.plan_mode_reasoning_effortnone | minimal | low | medium | high | xhighprofilestring--profile).profiles.<name>.*variousprofiles.<name>.analytics.enabledbooleanprofiles.<name>.experimental_use_unified_exec_toolboolean[features].unified_exec.profiles.<name>.model_catalog_jsonstring (path)model_catalog_json for that profile).profiles.<name>.model_instructions_filestring (path)profiles.<name>.oss_providerlmstudio | ollama--oss sessions.profiles.<name>.personalitynone | friendly | pragmaticprofiles.<name>.plan_mode_reasoning_effortnone | minimal | low | medium | high | xhighprofiles.<name>.service_tierflex | fastprofiles.<name>.tools_view_imagebooleanview_image tool in that profile.profiles.<name>.web_searchdisabled | cached | live"cached").profiles.<name>.windows.sandboxunelevated | elevatedproject_doc_fallback_filenamesarray<string>AGENTS.md is missing.project_doc_max_bytesnumberAGENTS.md when building project instructions.project_root_markersarray<string>projects.<path>.trust_levelstring"trusted" | "untrusted"). Untrusted projects skip project-scoped .codex/ layers.review_modelstring/review (defaults to the current session model).sandbox_moderead-only | workspace-write | danger-full-accesssandbox_workspace_write.exclude_slash_tmpboolean/tmp from writable roots in workspace-write mode.sandbox_workspace_write.exclude_tmpdir_env_varboolean$TMPDIR from writable roots in workspace-write mode.sandbox_workspace_write.network_accessbooleansandbox_workspace_write.writable_rootsarray<string>sandbox_mode = "workspace-write".service_tierflex | fastshell_environment_policy.excludearray<string>shell_environment_policy.experimental_use_profilebooleanshell_environment_policy.ignore_default_excludesbooleanshell_environment_policy.include_onlyarray<string>shell_environment_policy.inheritall | core | noneshell_environment_policy.setmap<string,string>show_raw_agent_reasoningbooleanskills.configarray<object>skills.config.<index>.enabledbooleanskills.config.<index>.pathstring (path)SKILL.md.sqlite_homestring (path)suppress_unstable_features_warningbooleantool_output_token_limitnumbertools.view_imagebooleanview_image.tools.web_searchboolean | { context_size = "low|medium|high", allowed_domains = [string], location = { country, region, city, timezone } }tuitabletui.alternate_screenauto | always | nevertui.animationsbooleantui.model_availability_nux.<model>integertui.notification_methodauto | osc9 | beltui.notificationsboolean | array<string>tui.show_tooltipsbooleantui.status_linearray<string> | nullnull disables the status line.tui.themestringweb_searchdisabled | cached | live"cached"; cached uses an OpenAI-maintained index and does not fetch live pages; if you use --yolo or another full access sandbox setting, it defaults to "live"). Use "live" to fetch the most recent data from the web, or "disabled" to remove the tool.windows_wsl_setup_acknowledgedbooleanwindows.sandboxunelevated | elevatedwindows.sandbox_private_desktopbooleanfalse only for compatibility with the older Winsta0\\Default behavior.You can find the latest JSON schema for config.toml here.
To get autocompletion and diagnostics when editing config.toml in VS Code or Cursor, you can install the Even Better TOML extension and add this line to the top of your config.toml:
#:schema https://developers.openai.com/codex/config-schema.json
Note: Rename experimental_instructions_file to model_instructions_file. Codex deprecates the old key; update existing configs to the new name.
requirements.toml
requirements.toml is an admin-enforced configuration file that constrains security-sensitive settings users can’t override. For details, locations, and examples, see Admin-enforced requirements.
For ChatGPT Business and Enterprise users, Codex can also apply cloud-fetched requirements. See the security page for precedence details.
Use [features] in requirements.toml to pin feature flags by the same
canonical keys that config.toml uses. Omitted keys remain unconstrained.
| Key | Type / Values | Details |
|---|---|---|
allowed_approval_policies | array<string> | Allowed values for approval_policy (for example untrusted, on-request, never, and granular). |
allowed_sandbox_modes | array<string> | Allowed values for sandbox_mode. |
allowed_web_search_modes | array<string> | Allowed values for web_search (disabled, cached, live). disabled is always allowed; an empty list effectively allows only disabled. |
features | table | Pinned feature values keyed by the canonical names from config.toml's [features] table. |
features.<name> | boolean | Require a specific canonical feature key to stay enabled or disabled. |
mcp_servers | table | Allowlist of MCP servers that may be enabled. Both the server name ( <id>) and its identity must match for the MCP server to be enabled. Any configured MCP server not in the allowlist (or with a mismatched identity) is disabled. |
mcp_servers.<id>.identity | table | Identity rule for a single MCP server. Set either command (stdio) or url (streamable HTTP). |
mcp_servers.<id>.identity.command | string | Allow an MCP stdio server when its mcp_servers.<id>.command matches this command. |
mcp_servers.<id>.identity.url | string | Allow an MCP streamable HTTP server when its mcp_servers.<id>.url matches this URL. |
rules | table | Admin-enforced command rules merged with .rules files. Requirements rules must be restrictive. |
rules.prefix_rules | array<table> | List of enforced prefix rules. Each rule must include pattern and decision. |
rules.prefix_rules[].decision | prompt | forbidden | Required. Requirements rules can only prompt or forbid (not allow). |
rules.prefix_rules[].justification | string | Optional non-empty rationale surfaced in approval prompts or rejection messages. |
rules.prefix_rules[].pattern | array<table> | Command prefix expressed as pattern tokens. Each token sets either token or any_of. |
rules.prefix_rules[].pattern[].any_of | array<string> | A list of allowed alternative tokens at this position. |
rules.prefix_rules[].pattern[].token | string | A single literal token at this position. |
allowed_approval_policiesarray<string>approval_policy (for example untrusted, on-request, never, and granular).allowed_sandbox_modesarray<string>sandbox_mode.allowed_web_search_modesarray<string>web_search (disabled, cached, live). disabled is always allowed; an empty list effectively allows only disabled.featurestableconfig.toml's [features] table.features.<name>booleanmcp_serverstable<id>) and its identity must match for the MCP server to be enabled. Any configured MCP server not in the allowlist (or with a mismatched identity) is disabled.mcp_servers.<id>.identitytablecommand (stdio) or url (streamable HTTP).mcp_servers.<id>.identity.commandstringmcp_servers.<id>.command matches this command.mcp_servers.<id>.identity.urlstringmcp_servers.<id>.url matches this URL.rulestable.rules files. Requirements rules must be restrictive.rules.prefix_rulesarray<table>pattern and decision.rules.prefix_rules[].decisionprompt | forbiddenrules.prefix_rules[].justificationstringrules.prefix_rules[].patternarray<table>token or any_of.rules.prefix_rules[].pattern[].any_ofarray<string>rules.prefix_rules[].pattern[].tokenstring