Primary navigation

Configuration Reference

Complete reference for Codex config.toml and requirements.toml

Use this page as a searchable reference for Codex configuration files. For conceptual guidance and examples, start with Basic Config and Advanced Config.

config.toml

User-level configuration lives in ~/.codex/config.toml.

Key
approval_policy
Type / Values
untrusted | on-failure | on-request | never
Details

Controls when Codex pauses for approval before executing commands.

Key
chatgpt_base_url
Type / Values
string
Details

Override the base URL used during the ChatGPT login flow.

Key
check_for_update_on_startup
Type / Values
boolean
Details

Check for Codex updates on startup (set to false only when updates are centrally managed).

Key
cli_auth_credentials_store
Type / Values
file | keyring | auto
Details

Control where the CLI stores cached credentials (file-based auth.json vs OS keychain).

Key
compact_prompt
Type / Values
string
Details

Inline override for the history compaction prompt.

Key
developer_instructions
Type / Values
string
Details

Additional developer instructions injected into the session (optional).

Key
disable_paste_burst
Type / Values
boolean
Details

Disable burst-paste detection in the TUI.

Key
experimental_compact_prompt_file
Type / Values
string (path)
Details

Load the compaction prompt override from a file (experimental).

Key
experimental_use_freeform_apply_patch
Type / Values
boolean
Details

Legacy name for enabling freeform apply_patch; prefer `[features].apply_patch_freeform` or `codex --enable apply_patch_freeform`.

Key
experimental_use_unified_exec_tool
Type / Values
boolean
Details

Legacy name for enabling unified exec; prefer `[features].unified_exec` or `codex --enable unified_exec`.

Key
features.apply_patch_freeform
Type / Values
boolean
Details

Expose the freeform `apply_patch` tool (experimental).

Key
features.child_agents_md
Type / Values
boolean
Details

Append AGENTS.md scope/precedence guidance even when no AGENTS.md is present (experimental).

Key
features.elevated_windows_sandbox
Type / Values
boolean
Details

Enable the elevated Windows sandbox pipeline (experimental).

Key
features.exec_policy
Type / Values
boolean
Details

Enforce rules checks for `shell`/`unified_exec` (experimental; on by default).

Key
features.experimental_windows_sandbox
Type / Values
boolean
Details

Run the Windows restricted-token sandbox (experimental).

Key
features.powershell_utf8
Type / Values
boolean
Details

Force PowerShell UTF-8 output (defaults to true).

Key
features.remote_compaction
Type / Values
boolean
Details

Enable remote compaction (ChatGPT auth only; experimental; on by default).

Key
features.remote_models
Type / Values
boolean
Details

Refresh remote model list before showing readiness (experimental).

Key
features.shell_snapshot
Type / Values
boolean
Details

Snapshot shell environment to speed up repeated commands (beta).

Key
features.shell_tool
Type / Values
boolean
Details

Enable the default `shell` tool for running commands (stable; on by default).

Key
features.unified_exec
Type / Values
boolean
Details

Use the unified PTY-backed exec tool (beta).

Key
features.web_search_request
Type / Values
boolean
Details

Allow the model to issue web searches (stable).

Key
feedback.enabled
Type / Values
boolean
Details

Enable feedback submission via `/feedback` across Codex surfaces (default: true).

Key
file_opener
Type / Values
vscode | vscode-insiders | windsurf | cursor | none
Details

URI scheme used to open citations from Codex output (default: `vscode`).

Key
forced_chatgpt_workspace_id
Type / Values
string (uuid)
Details

Limit ChatGPT logins to a specific workspace identifier.

Key
forced_login_method
Type / Values
chatgpt | api
Details

Restrict Codex to a specific authentication method.

Key
hide_agent_reasoning
Type / Values
boolean
Details

Suppress reasoning events in both the TUI and `codex exec` output.

Key
history.max_bytes
Type / Values
number
Details

If set, caps the history file size in bytes by dropping oldest entries.

Key
history.persistence
Type / Values
save-all | none
Details

Control whether Codex saves session transcripts to history.jsonl.

Key
include_apply_patch_tool
Type / Values
boolean
Details

Legacy name for enabling freeform apply_patch; prefer `[features].apply_patch_freeform`.

Key
instructions
Type / Values
string
Details

Reserved for future use; prefer `model_instructions_file` or `AGENTS.md`.

Key
mcp_oauth_callback_port
Type / Values
integer
Details

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.

Key
mcp_oauth_credentials_store
Type / Values
auto | file | keyring
Details

Preferred store for MCP OAuth credentials.

Key
mcp_servers.<id>.args
Type / Values
array<string>
Details

Arguments passed to the MCP stdio server command.

Key
mcp_servers.<id>.bearer_token_env_var
Type / Values
string
Details

Environment variable sourcing the bearer token for an MCP HTTP server.

Key
mcp_servers.<id>.command
Type / Values
string
Details

Launcher command for an MCP stdio server.

Key
mcp_servers.<id>.cwd
Type / Values
string
Details

Working directory for the MCP stdio server process.

Key
mcp_servers.<id>.disabled_tools
Type / Values
array<string>
Details

Deny list applied after `enabled_tools` for the MCP server.

Key
mcp_servers.<id>.enabled
Type / Values
boolean
Details

Disable an MCP server without removing its configuration.

Key
mcp_servers.<id>.enabled_tools
Type / Values
array<string>
Details

Allow list of tool names exposed by the MCP server.

Key
mcp_servers.<id>.env
Type / Values
map<string,string>
Details

Environment variables forwarded to the MCP stdio server.

Key
mcp_servers.<id>.env_http_headers
Type / Values
map<string,string>
Details

HTTP headers populated from environment variables for an MCP HTTP server.

Key
mcp_servers.<id>.env_vars
Type / Values
array<string>
Details

Additional environment variables to whitelist for an MCP stdio server.

Key
mcp_servers.<id>.http_headers
Type / Values
map<string,string>
Details

Static HTTP headers included with each MCP HTTP request.

Key
mcp_servers.<id>.startup_timeout_ms
Type / Values
number
Details

Alias for `startup_timeout_sec` in milliseconds.

Key
mcp_servers.<id>.startup_timeout_sec
Type / Values
number
Details

Override the default 10s startup timeout for an MCP server.

Key
mcp_servers.<id>.tool_timeout_sec
Type / Values
number
Details

Override the default 60s per-tool timeout for an MCP server.

Key
mcp_servers.<id>.url
Type / Values
string
Details

Endpoint for an MCP streamable HTTP server.

Key
model
Type / Values
string
Details

Model to use (e.g., `gpt-5-codex`).

Key
model_auto_compact_token_limit
Type / Values
number
Details

Token threshold that triggers automatic history compaction (unset uses model defaults).

Key
model_context_window
Type / Values
number
Details

Context window tokens available to the active model.

Key
model_instructions_file
Type / Values
string (path)
Details

Replacement for built-in instructions instead of `AGENTS.md`.

Key
model_provider
Type / Values
string
Details

Provider id from `model_providers` (default: `openai`).

Key
model_providers.<id>.base_url
Type / Values
string
Details

API base URL for the model provider.

Key
model_providers.<id>.env_http_headers
Type / Values
map<string,string>
Details

HTTP headers populated from environment variables when present.

Key
model_providers.<id>.env_key
Type / Values
string
Details

Environment variable supplying the provider API key.

Key
model_providers.<id>.env_key_instructions
Type / Values
string
Details

Optional setup guidance for the provider API key.

Key
model_providers.<id>.experimental_bearer_token
Type / Values
string
Details

Direct bearer token for the provider (discouraged; use `env_key`).

Key
model_providers.<id>.http_headers
Type / Values
map<string,string>
Details

Static HTTP headers added to provider requests.

Key
model_providers.<id>.name
Type / Values
string
Details

Display name for a custom model provider.

Key
model_providers.<id>.query_params
Type / Values
map<string,string>
Details

Extra query parameters appended to provider requests.

Key
model_providers.<id>.request_max_retries
Type / Values
number
Details

Retry count for HTTP requests to the provider (default: 4).

Key
model_providers.<id>.requires_openai_auth
Type / Values
boolean
Details

The provider uses OpenAI authentication (defaults to false).

Key
model_providers.<id>.stream_idle_timeout_ms
Type / Values
number
Details

Idle timeout for SSE streams in milliseconds (default: 300000).

Key
model_providers.<id>.stream_max_retries
Type / Values
number
Details

Retry count for SSE streaming interruptions (default: 5).

Key
model_providers.<id>.wire_api
Type / Values
chat | responses
Details

Protocol used by the provider (defaults to `chat` if omitted).

Key
model_reasoning_effort
Type / Values
minimal | low | medium | high | xhigh
Details

Adjust reasoning effort for supported models (Responses API only; `xhigh` is model-dependent).

Key
model_reasoning_summary
Type / Values
auto | concise | detailed | none
Details

Select reasoning summary detail or disable summaries entirely.

Key
model_supports_reasoning_summaries
Type / Values
boolean
Details

Force Codex to send reasoning metadata even for unknown models.

Key
model_verbosity
Type / Values
low | medium | high
Details

Control GPT-5 Responses API verbosity (defaults to `medium`).

Key
notice.hide_full_access_warning
Type / Values
boolean
Details

Track acknowledgement of the full access warning prompt.

Key
notice.hide_gpt-5.1-codex-max_migration_prompt
Type / Values
boolean
Details

Track acknowledgement of the gpt-5.1-codex-max migration prompt.

Key
notice.hide_gpt5_1_migration_prompt
Type / Values
boolean
Details

Track acknowledgement of the GPT-5.1 migration prompt.

Key
notice.hide_rate_limit_model_nudge
Type / Values
boolean
Details

Track opt-out of the rate limit model switch reminder.

Key
notice.hide_world_writable_warning
Type / Values
boolean
Details

Track acknowledgement of the Windows world-writable directories warning.

Key
notice.model_migrations
Type / Values
map<string,string>
Details

Track acknowledged model migrations as old->new mappings.

Key
notify
Type / Values
array<string>
Details

Command invoked for notifications; receives a JSON payload from Codex.

Key
oss_provider
Type / Values
lmstudio | ollama
Details

Default local provider used when running with `--oss` (defaults to prompting if unset).

Key
otel.environment
Type / Values
string
Details

Environment tag applied to emitted OpenTelemetry events (default: `dev`).

Key
otel.exporter
Type / Values
none | otlp-http | otlp-grpc
Details

Select the OpenTelemetry exporter and provide any endpoint metadata.

Key
otel.exporter.<id>.endpoint
Type / Values
string
Details

Exporter endpoint for OTEL logs.

Key
otel.exporter.<id>.headers
Type / Values
map<string,string>
Details

Static headers included with OTEL exporter requests.

Key
otel.exporter.<id>.protocol
Type / Values
binary | json
Details

Protocol used by the OTLP/HTTP exporter.

Key
otel.exporter.<id>.tls.ca-certificate
Type / Values
string
Details

CA certificate path for OTEL exporter TLS.

Key
otel.exporter.<id>.tls.client-certificate
Type / Values
string
Details

Client certificate path for OTEL exporter TLS.

Key
otel.exporter.<id>.tls.client-private-key
Type / Values
string
Details

Client private key path for OTEL exporter TLS.

Key
otel.log_user_prompt
Type / Values
boolean
Details

Opt in to exporting raw user prompts with OpenTelemetry logs.

Key
otel.trace_exporter
Type / Values
none | otlp-http | otlp-grpc
Details

Select the OpenTelemetry trace exporter and provide any endpoint metadata.

Key
otel.trace_exporter.<id>.endpoint
Type / Values
string
Details

Trace exporter endpoint for OTEL logs.

Key
otel.trace_exporter.<id>.headers
Type / Values
map<string,string>
Details

Static headers included with OTEL trace exporter requests.

Key
otel.trace_exporter.<id>.protocol
Type / Values
binary | json
Details

Protocol used by the OTLP/HTTP trace exporter.

Key
otel.trace_exporter.<id>.tls.ca-certificate
Type / Values
string
Details

CA certificate path for OTEL trace exporter TLS.

Key
otel.trace_exporter.<id>.tls.client-certificate
Type / Values
string
Details

Client certificate path for OTEL trace exporter TLS.

Key
otel.trace_exporter.<id>.tls.client-private-key
Type / Values
string
Details

Client private key path for OTEL trace exporter TLS.

Key
profile
Type / Values
string
Details

Default profile applied at startup (equivalent to `--profile`).

Key
profiles.<name>.*
Type / Values
various
Details

Profile-scoped overrides for any of the supported configuration keys.

Key
profiles.<name>.experimental_use_freeform_apply_patch
Type / Values
boolean
Details

Legacy name for enabling freeform apply_patch; prefer `[features].apply_patch_freeform`.

Key
profiles.<name>.experimental_use_unified_exec_tool
Type / Values
boolean
Details

Legacy name for enabling unified exec; prefer `[features].unified_exec`.

Key
profiles.<name>.include_apply_patch_tool
Type / Values
boolean
Details

Legacy name for enabling freeform apply_patch; prefer `[features].apply_patch_freeform`.

Key
profiles.<name>.oss_provider
Type / Values
lmstudio | ollama
Details

Profile-scoped OSS provider for `--oss` sessions.

Key
project_doc_fallback_filenames
Type / Values
array<string>
Details

Additional filenames to try when `AGENTS.md` is missing.

Key
project_doc_max_bytes
Type / Values
number
Details

Maximum bytes read from `AGENTS.md` when building project instructions.

Key
project_root_markers
Type / Values
array<string>
Details

List of project root marker filenames; used when searching parent directories for the project root.

Key
projects.<path>.trust_level
Type / Values
string
Details

Mark a project or worktree as trusted or untrusted (`"trusted"` | `"untrusted"`).

Key
review_model
Type / Values
string
Details

Optional model override used by `/review` (defaults to the current session model).

Key
sandbox_mode
Type / Values
read-only | workspace-write | danger-full-access
Details

Sandbox policy for filesystem and network access during command execution.

Key
sandbox_workspace_write.exclude_slash_tmp
Type / Values
boolean
Details

Exclude `/tmp` from writable roots in workspace-write mode.

Key
sandbox_workspace_write.exclude_tmpdir_env_var
Type / Values
boolean
Details

Exclude `$TMPDIR` from writable roots in workspace-write mode.

Key
sandbox_workspace_write.network_access
Type / Values
boolean
Details

Allow outbound network access inside the workspace-write sandbox.

Key
sandbox_workspace_write.writable_roots
Type / Values
array<string>
Details

Additional writable roots when `sandbox_mode = "workspace-write"`.

Key
shell_environment_policy.exclude
Type / Values
array<string>
Details

Glob patterns for removing environment variables after the defaults.

Key
shell_environment_policy.experimental_use_profile
Type / Values
boolean
Details

Use the user shell profile when spawning subprocesses.

Key
shell_environment_policy.ignore_default_excludes
Type / Values
boolean
Details

Keep variables containing KEY/SECRET/TOKEN before other filters run.

Key
shell_environment_policy.include_only
Type / Values
array<string>
Details

Whitelist of patterns; when set only matching variables are kept.

Key
shell_environment_policy.inherit
Type / Values
all | core | none
Details

Baseline environment inheritance when spawning subprocesses.

Key
shell_environment_policy.set
Type / Values
map<string,string>
Details

Explicit environment overrides injected into every subprocess.

Key
show_raw_agent_reasoning
Type / Values
boolean
Details

Surface raw reasoning content when the active model emits it.

Key
skills.config
Type / Values
array<object>
Details

Per-skill enablement overrides stored in config.toml.

Key
skills.config.<index>.enabled
Type / Values
boolean
Details

Enable or disable the referenced skill.

Key
skills.config.<index>.path
Type / Values
string (path)
Details

Path to a skill folder containing `SKILL.md`.

Key
tool_output_token_limit
Type / Values
number
Details

Token budget for storing individual tool/function outputs in history.

Key
tui
Type / Values
table
Details

TUI-specific options such as enabling inline desktop notifications.

Key
tui.alternate_screen
Type / Values
auto | always | never
Details

Control alternate screen usage for the TUI (default: auto; auto skips it in Zellij to preserve scrollback).

Key
tui.animations
Type / Values
boolean
Details

Enable terminal animations (welcome screen, shimmer, spinner) (default: true).

Key
tui.notifications
Type / Values
boolean | array<string>
Details

Enable TUI notifications; optionally restrict to specific event types.

Key
tui.scroll_events_per_tick
Type / Values
number
Details

Wheel event density used to normalize TUI2 scrolling.

Key
tui.scroll_invert
Type / Values
boolean
Details

Invert mouse scroll direction in TUI2.

Key
tui.scroll_mode
Type / Values
auto | wheel | trackpad
Details

Scroll interpretation mode for TUI2.

Key
tui.scroll_trackpad_accel_events
Type / Values
number
Details

Trackpad events required to gain +1x acceleration.

Key
tui.scroll_trackpad_accel_max
Type / Values
number
Details

Maximum acceleration multiplier for trackpad scrolling.

Key
tui.scroll_trackpad_lines
Type / Values
number
Details

Baseline trackpad scroll sensitivity for TUI2.

Key
tui.scroll_wheel_like_max_duration_ms
Type / Values
number
Details

Auto-mode wheel fallback duration threshold (ms).

Key
tui.scroll_wheel_lines
Type / Values
number
Details

Lines per wheel notch for TUI2 scrolling.

Key
tui.scroll_wheel_tick_detect_max_ms
Type / Values
number
Details

Auto-mode wheel tick detection threshold (ms).

Key
tui.show_tooltips
Type / Values
boolean
Details

Show onboarding tooltips in the TUI welcome screen (default: true).

Key
windows_wsl_setup_acknowledged
Type / Values
boolean
Details

Track Windows onboarding acknowledgement (Windows only).

Note: experimental_instructions_file has been renamed to model_instructions_file. The old key is deprecated; 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.

Key
allowed_approval_policies
Type / Values
array<string>
Details

Allowed values for `approval_policy`.

Key
allowed_sandbox_modes
Type / Values
array<string>
Details

Allowed values for `sandbox_mode`.

Key
mcp_servers
Type / Values
table
Details

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.

Key
mcp_servers.<id>.identity
Type / Values
table
Details

Identity rule for a single MCP server. Set either `command` (stdio) or `url` (streamable HTTP).

Key
mcp_servers.<id>.identity.command
Type / Values
string
Details

Allow an MCP stdio server when its `mcp_servers.<id>.command` matches this command.

Key
mcp_servers.<id>.identity.url
Type / Values
string
Details

Allow an MCP streamable HTTP server when its `mcp_servers.<id>.url` matches this URL.