Skip to main content
This page provides a comprehensive reference of all configuration options available in config.toml.

Configuration File

Location: ~/.codex/config.toml Format: TOML (Tom’s Obvious, Minimal Language) Schema: codex-rs/core/config.schema.json

Top-Level Options

Model Configuration

string
default:"o4-mini"
Default model to use for conversations.Examples: "gpt-4.1", "gpt-5.1", "gpt-5.1-codex", "o4-mini"
string
Key from model_providers map identifying which provider to use.Example: "openai", "azure", "ollama"
string
Default reasoning effort for reasoning-capable models.Options: "none", "minimal", "low", "medium", "high", "xhigh"
string
default:"auto"
Controls reasoning summary presentation.Options: "auto", "concise", "detailed", "none"
string
Output detail level for GPT-5 models.Options: "low", "medium", "high"
string
Reasoning effort override specifically for Plan mode.When unset, Plan mode uses built-in default ("medium"). When set (including "none"), overrides Plan preset.
integer
Context window size for the model in tokens.
integer
Token threshold that triggers automatic conversation compaction.
string
Path to file containing custom model instructions.⚠️ Warning: Overriding built-in instructions may degrade performance.
string
Path to JSON model catalog file (applied on startup only).
boolean
Force-enable reasoning summaries for the configured model.

Approval & Execution

string|object
default:"untrusted"
When to ask user for approval before executing operations.String options:
  • "untrusted" - Auto-approve only safe read operations
  • "on-request" - Model decides when to ask
  • "on-failure" - DEPRECATED: Auto-approve sandboxed, escalate on failure
  • "never" - Never ask; return failures to model
Object form (fine-grained rejection):
string
default:"workspace-write"
Filesystem access boundaries.Options:
  • "read-only" - Read-only access
  • "workspace-write" - Read anywhere, write in workspace
  • "danger-full-access" - Full filesystem access
boolean
default:"true"
Whether model may request login shell for shell tools.If false, login = true requests are rejected and default is non-login shell.

Sandbox Workspace Write

boolean
default:"false"
Allow network access in workspace-write mode.
boolean
default:"false"
Exclude /tmp from writable paths.
boolean
default:"false"
Exclude $TMPDIR from writable paths.
array
default:"[]"
Additional absolute paths where writes are allowed.Example: ["/additional/path", "/another/path"]

Authentication

string
default:"auto"
Where to store CLI authentication credentials.Options:
  • "file" - ~/.codex/auth.json
  • "keyring" - OS keyring service
  • "auto" - Prefer keyring, fallback to file
  • "ephemeral" - Memory only (current process)
string
Restrict login mechanism.Options: "chatgpt", "api"
string
When set, restricts ChatGPT login to specific workspace.
string
Base URL for ChatGPT (as opposed to OpenAI API) requests.

Instructions

string
Global system instructions for the agent.
string
Developer role message instructions.
string
Custom prompt for conversation history compaction.
string
Path to file containing custom compaction prompt.

Profiles

string
Active profile name from the profiles map.
object
default:"{}"
Named configuration profiles for easy switching.Each profile can override any configuration option.Example:

Personality

string
Agent personality mode.Options: "none", "friendly", "pragmatic"

Model Providers

object
default:"{}"
User-defined provider configurations.Example:

Provider Configuration

string
required
Friendly display name for the provider.
string
Base URL for provider’s OpenAI-compatible API.
string
Environment variable storing the API key.
string
Help text for obtaining and setting the API key.
boolean
default:"false"
Whether provider requires OpenAI API key or ChatGPT login.
object
Static HTTP headers (key-value pairs).
object
Headers with values from environment variables (header → env var name).
object
Query parameters to append to requests.
integer
default:"3"
Maximum HTTP request retries.
integer
default:"30000"
Idle timeout (ms) before treating streaming connection as lost.
integer
default:"3"
Maximum streaming reconnection attempts.
boolean
default:"false"
Whether provider supports Responses API WebSocket transport.
string
default:"responses"
Wire protocol the provider expects. Currently only "responses" supported.

MCP Servers

object
default:"{}"
MCP server configurations keyed by server name.Example:

MCP Server Configuration

string
Executable to launch (stdio transport).
array
Command arguments (stdio transport).
string
Server URL (streamable HTTP transport).
boolean
default:"true"
Whether server is enabled.
boolean
default:"false"
If true, Codex fails to start if server connection fails.
object
Environment variables for server process (stdio only).
array
Environment variable names to inherit from parent.
string
Working directory for server process (stdio only).
string
Environment variable with bearer token (HTTP only).
object
Static HTTP headers (HTTP only).
object
Headers from environment variables (HTTP only).
number
Maximum server startup time (seconds).
number
Maximum tool execution time (seconds).
array
Whitelist of enabled tools. If set, only these are exposed.
array
Blacklist of disabled tools.
array
OAuth scopes to request.
string
OAuth resource identifier.

MCP OAuth Settings

string
default:"auto"
Where to store MCP OAuth credentials.Options: "auto", "file", "keyring"
integer
Fixed port for OAuth callback server. If unset, uses ephemeral port.
string
Redirect URI for OAuth flow. Local listener still binds to 127.0.0.1.

Apps Configuration

object
App/connector control settings.Example:

App Settings

boolean
default:"true"
Default enabled state for all apps.
boolean
Whether destructive tools are allowed by default.
boolean
Whether open-world tools are allowed by default.
boolean
default:"true"
Enable or disable specific app.
boolean
Whether tools are enabled by default for this app.
string
Default approval mode for app tools.Options: "auto", "prompt", "approve"
boolean
Allow destructive tools for this app.
boolean
Allow open-world tools for this app.
boolean
Enable/disable specific tool.
string
Approval mode for specific tool.

Shell Environment Policy

string
Which environment to inherit.Options:
  • "core" - Essential variables only (HOME, PATH, USER, etc.)
  • "all" - Full parent environment
  • "none" - Empty environment
array
If set, only inherit variables matching these regex patterns.
array
Regex patterns for variables to exclude (after inherit).
boolean
Ignore built-in exclude patterns.
object
Explicitly set environment variables.
boolean
Experimental: Use shell profile during initialization.

Agent Configuration

integer
Maximum concurrent agent threads. If unset, no limit.
integer
Maximum nesting depth for spawned agents (root = 0).
integer
Default maximum runtime for agent job workers (seconds).
string
Path to role-specific config layer.
string
Human-facing role documentation.

Tools

boolean
Enable view_image tool for attaching local images.
Enable web search tool.
Web search mode.Options: "disabled", "cached", "live"
integer
Token budget for tool/function output storage.

Permissions

boolean
Enable network proxy.
string
Network access mode.Options: "limited", "full"
array
Allowed domain patterns.
array
Explicitly denied domains.
array
Allowed Unix socket paths.
boolean
Allow all Unix sockets (use with caution).
boolean
Allow binding to local ports.
boolean
Allow proxying to upstream servers.
string
HTTP proxy URL.
string
SOCKS proxy URL.
string
Admin interface URL.
boolean
Enable SOCKS5 proxy.
boolean
Enable SOCKS5 UDP support.

TUI Settings

boolean
default:"true"
Enable desktop notifications when terminal unfocused.
string
default:"auto"
Notification method.Options: "auto", "osc9", "bel"
string
default:"auto"
Alternate screen buffer mode.Options:
  • "auto" - Disable in Zellij, enable elsewhere
  • "always" - Always use alternate screen
  • "never" - Never use (preserves scrollback)
boolean
default:"true"
Enable TUI animations and effects.
boolean
default:"true"
Show startup tooltips in welcome screen.
string
Syntax highlighting theme name (kebab-case).Overrides automatic light/dark detection. Custom themes in $CODEX_HOME/themes.
array
Ordered list of status line item identifiers.Default: ["model-with-reasoning", "context-remaining", "current-dir"]

History

string
default:"save-all"
History persistence mode.Options:
  • "save-all" - Save to ~/.codex/history.jsonl
  • "none" - Don’t save to disk
integer
Maximum history file size (bytes). Oldest entries dropped when exceeded.

Memories

boolean
Inject memory usage instructions into prompts.
boolean
Enable automatic memory generation.
integer
Maximum age of threads for memory generation (days).
integer
Minimum idle time before memory creation (hours, >12 recommended).
integer
Maximum rollout candidates processed per pass.
integer
Maximum days since last use before memory becomes ineligible.
integer
Maximum recent raw memories retained for global consolidation.
string
Model for thread summarization.
string
Model for memory consolidation.

Ghost Snapshots

integer
Exclude untracked files larger than this (bytes).
integer
Ignore untracked dirs with this many files or more.
boolean
Disable ghost snapshot warning events.

Skills

array
User-level skill configurations.Example:

Project Settings

array
default:"[\".git\"]"
Markers for detecting project root when searching for .codex folders.
array
Fallback filenames when AGENTS.md is missing.
integer
Maximum bytes to include from AGENTS.md files.
string
Trust level for project directory.Options: "trusted", "untrusted"

Notices

boolean
Tracks whether user acknowledged full access warning.
boolean
Tracks whether user opted out of rate limit model nudge.
object
Tracks acknowledged model migrations (old → new mappings).

Notification

array
External command to run for notifications.Example: ["terminal-notifier", "-title", "Codex", "-message", "Done"]

Analytics & Feedback

boolean
default:"true"
Enable usage analytics.
boolean
default:"true"
Enable feedback prompts.

Logging & Storage

string
Directory for log files. Defaults to $CODEX_HOME/log.
string
SQLite database directory. Defaults to $CODEX_SQLITE_HOME or $CODEX_HOME.

JavaScript REPL

string
Absolute path to Node.js runtime for js_repl.
array
Ordered list of Node module search directories.

Miscellaneous

string
URI-based file opener for file citations.Options: "vscode", "vscode-insiders", "windsurf", "cursor", "none"
string
Commit attribution text for co-author trailers. Empty string disables.
boolean
default:"true"
Check for Codex updates on startup.
boolean
Disable burst-paste detection for typed input.
boolean
default:"false"
Hide AgentReasoning events from UI.
boolean
default:"false"
Show raw agent reasoning content events.
boolean
Suppress warnings about unstable features.
integer
default:"300000"
Maximum poll window for background terminal output (ms).
string
Model override for /review feature.
string
Preferred OSS provider for local models (e.g., "lmstudio", "ollama").
string
Absolute path to patched zsh for zsh-exec-bridge shell execution.

Windows Settings

string
Windows sandbox mode.Options: "elevated", "unelevated"
boolean
Tracks whether Windows onboarding screen was acknowledged.

OpenTelemetry

string
default:"dev"
Environment tag for traces (dev, staging, prod, test).
boolean
default:"false"
Include user prompts in trace logs.
string|object
Log exporter configuration.
string|object
Trace exporter configuration.
string|object
Metrics exporter configuration.

Audio

string
Realtime audio microphone device preference.
string
Realtime audio speaker device preference.

Feature Flags

object
Centralized feature flags for experimental features.Available flags:
  • multi_agent
  • memories
  • web_search
  • sqlite
  • undo
  • collaboration_modes
  • realtime_conversation
  • voice_transcription
  • And many more…

Configuration Priority

Configuration is merged in this order (later overrides earlier):
  1. Built-in defaults
  2. Global config (~/.codex/config.toml)
  3. Project config (.codex/config.toml in project root)
  4. Profile settings (when profile is set or --profile flag used)
  5. CLI flags (--model, --approval-policy, etc.)
  6. Environment variables (CODEX_MODEL, etc.)

Validation

Codex validates configuration against JSON Schema at codex-rs/core/config.schema.json. Common validation errors:
  • Invalid enum values (e.g., unknown approval_policy)
  • Type mismatches (string vs integer)
  • Missing required fields in nested objects
  • Invalid path formats for file paths

Next Steps

Basic Configuration

Get started with essential options

Advanced Configuration

Explore power user features