Config.toml | Updated Keys
Resolved 💬 19 comments Opened Aug 27, 2025 by Alfredo-Sandoval Closed Oct 28, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What is the type of issue?
Documentation is missing
What is the issue?
# ============================================================================
# Codex CLI — Comprehensive Configuration Template
# Generated: 2025-08-27
# ~/.codex/config.toml (aka $CODEX_HOME/config.toml)
# ============================================================================
# ----------------------------------------------------------------------------
# NEW ENTRIES (added in this release)
# ----------------------------------------------------------------------------
# 1) [tools].web_search = true # Added Aug 23, 2025
# Enables native web search tool. CLI flag is --search (TUI only); TOML key
# works for both TUI and codex-exec. Alias also accepted: web_search_request.
#
# 2) preferred_auth_method = "apikey" | "chatgpt" # Added Aug 18, 2025
# Prefer API key or ChatGPT auth when both are present.
#
# 3) [projects."/abs/path"].trust_level = "trusted" # Added Aug 7, 2025
# Mark specific repos trusted to reduce prompts in versioned workspaces.
#
# 4) model_verbosity = "low" | "medium" | "high" # Added Aug 22, 2025
# Controls Responses API text verbosity for GPT‑5 family models.
#
# 5) Per-provider network tuning in [model_providers.<id>] # Added Jul 18, 2025; caps Aug 25, 2025
# request_max_retries, stream_max_retries, stream_idle_timeout_ms.
# Note: only valid inside provider blocks; older top‑level keys are ignored.
#
# 6) show_raw_agent_reasoning = true # Added Aug 5, 2025
# Surfaces raw chain‑of‑thought events when available.
#
# 7) shell_environment_policy.experimental_use_profile = true # Added Jul 25, 2025
# Advanced: run shell commands through a profile (opt‑in).
#
# 8) chatgpt_base_url = "https://chatgpt.com/backend-api/" # Added Jul 11, 2025
# Advanced override for ChatGPT backend URL.
#
# 9) responses_originator_header_internal_override = "codex_cli_rs" # Added Aug 19, 2025
# Internal/testing only; do not set unless you know why.
# ----------------------------------------------------------------------------
####################################
# Root (top-level) keys
####################################
model = "gpt-5" # default model
# model_provider = "openai" # key under [model_providers]
# model_context_window = 200000 # tokens; override when unknown
# model_max_output_tokens = 100000 # tokens; override when unknown
#
approval_policy = "never" # "untrusted" | "on-failure" | "on-request" | "never"
sandbox_mode = "danger-full-access" # "read-only" | "workspace-write" | "danger-full-access"
# disable_response_storage = false # set true for ZDR accounts
#
# file_opener = "vscode" # "vscode" | "vscode-insiders" | "windsurf" | "cursor" | "none"
# hide_agent_reasoning = false
# show_raw_agent_reasoning = false
#
model_reasoning_effort = "high" # "minimal" | "low" | "medium" | "high" | "none"
# model_reasoning_summary = "auto" # "auto" | "concise" | "detailed" | "none"
# model_verbosity = "medium" # GPT‑5 family only; "low" | "medium" | "high"
# model_supports_reasoning_summaries = false # force-enable reasoning block
#
# chatgpt_base_url = "https://chatgpt.com/backend-api/" # advanced
# experimental_resume = "/abs/path/resume.jsonl" # advanced
# experimental_instructions_file = "/abs/path/base.txt" # advanced
# experimental_use_exec_command_tool = false # advanced
# responses_originator_header_internal_override = "codex_cli_rs" # internal/testing
#
# project_doc_max_bytes = 32768 # bytes to read from AGENTS.md
# preferred_auth_method = "chatgpt" # or "apikey"
#
# profile = "default" # active [profiles] entry
#
# instructions = "You are a helpful assistant." # extra system instructions (merged with AGENTS.md)
#
# notify = ["notify-send", "Codex"] # program argv; Codex appends JSON payload
####################################
# Tools (feature toggles)
####################################
[tools]
# Enable the native Responses web_search tool (same as TUI --search)
web_search = true
# alias for backwards compatibility:
# web_search_request = true
####################################
# Shell environment policy for spawned processes
####################################
[shell_environment_policy]
# inherit = "all" # "all" | "core" | "none"
# ignore_default_excludes = false # when false, drops vars whose NAMES contain KEY/SECRET/TOKEN
# exclude = ["AWS_*", "AZURE_*"] # case-insensitive globs
# set = { CI = "1" } # force-set values
# include_only = ["PATH", "HOME"] # keep-only whitelist (globs)
# experimental_use_profile = false # advanced
####################################
# Sandbox settings (apply when sandbox_mode = "workspace-write")
####################################
[sandbox_workspace_write]
# writable_roots = ["/additional/writable/path"]
# network_access = false
# exclude_tmpdir_env_var = false
# exclude_slash_tmp = false
####################################
# History persistence
####################################
[history]
persistence = "save-all" # "save-all" | "none"
# max_bytes = 10485760 # not strictly enforced yet
####################################
# MCP servers (tools via stdio)
####################################
# [mcp_servers.example]
# command = "npx"
# args = ["-y", "mcp-server-example"]
# env = { API_KEY = "value" }
####################################
# Model providers (extend/override built-ins)
####################################
# Built-in OpenAI provider can be customized here.
# [model_providers.openai]
# name = "OpenAI"
# base_url = "https://api.openai.com/v1" # OPENAI_BASE_URL env var also supported
# wire_api = "responses" # "responses" | "chat"
# query_params = {}
# http_headers = { version = "0.0.0" }
# env_http_headers = { "OpenAI-Organization" = "OPENAI_ORGANIZATION", "OpenAI-Project" = "OPENAI_PROJECT" }
# request_max_retries = 4
# stream_max_retries = 5
# stream_idle_timeout_ms = 300000
# requires_openai_auth = true
# Chat Completions-compatible provider example
# [model_providers.openai-chat-completions]
# name = "OpenAI using Chat Completions"
# base_url = "https://api.openai.com/v1"
# env_key = "OPENAI_API_KEY"
# wire_api = "chat"
# query_params = {}
# Azure example (requires api-version)
# [model_providers.azure]
# name = "Azure"
# base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"
# env_key = "AZURE_OPENAI_API_KEY"
# query_params = { api-version = "2025-04-01-preview" }
# Local OSS (Ollama) example
# [model_providers.ollama]
# name = "Ollama"
# base_url = "http://localhost:11434/v1"
# wire_api = "chat"
####################################
# Profiles (bundled overrides you can switch with --profile)
####################################
# [profiles.default]
# model = "gpt-5"
# model_provider = "openai"
# approval_policy = "never"
# disable_response_storage = false
# model_reasoning_effort = "high"
# model_reasoning_summary = "auto"
# model_verbosity = "medium"
# chatgpt_base_url = "https://chatgpt.com/backend-api/"
# experimental_instructions_file = "/abs/path/base_instructions.txt"
# [profiles.zdr]
# model = "o3"
# model_provider = "openai"
# approval_policy = "on-failure"
# disable_response_storage = true
####################################
# Projects trust (per-absolute-path)
####################################
# [projects."/absolute/path/to/your/repo"]
# trust_level = "trusted" # mark as trusted
####################################
# Quick reference: CLI overrides (for sharing/docs)
####################################
# codex -c model="o3"
# codex -c 'tools.web_search=true' "your prompt here"
# codex --sandbox workspace-write --ask-for-approval on-request
# Notes:
# - The TUI flag --search maps to [tools].web_search in TOML.
# - The built-in OpenAI provider also respects env: OPENAI_BASE_URL, OPENAI_ORGANIZATION, OPENAI_PROJECT.
# - OSS provider can be influenced by env: CODEX_OSS_BASE_URL, CODEX_OSS_PORT (envs, not TOML).
# NOTE: network_access is only valid under [sandbox_workspace_write].
# When sandbox_mode="danger-full-access", network is already unrestricted.
Where did you find it?
_No response_
19 Comments
Thanks!!
I had the file in ~/.codex/config.toml but somehow codex is not reading the file. When I try
codex, it still use o4-mini model:<img width="2476" height="576" alt="Image" src="https://github.com/user-attachments/assets/f07ab2bf-093a-4280-98c7-34f68eaeb2b0" />
The config.toml has specified to use gpt-5.
seems like none of these settings work now, still asks for approvals, reasoning is medium by default and web search is disabled, unlike with
codex --search@avxkim that's odd. Can you try this one?
Sadly, no, doesn't work. Are you on MacOS? I installed codex with
brew, only command line args work for me:I'm on linux. I would make sure that $CODEX_HOME is set to the same location as your config.toml. Does the npm install work on MacOS? If the CLI flags work so should those toml keys.
i chose brew because i don't want to mess with node versions, seems like it's really doesn't work on mac, these settings i mean, just tried another mac - same problem
I can confirm that the same issue happening to me.
Environment
OS:
Mac M3 - Sequoia - 15.6.1Codex:
codex-cli 0.30.0Configuration
File:
~/.codex/config.tomlNow, start
codexand list MCP servers:Let's list MCP servers:
So, it looks like it's not even looking at
~/.codex/config.tomlfileDoes setting it via $CODEX_HOME work? I'm about to get a Mac so very curious about this.
@Alfredo-Sandoval , I did set
$CODEX_HOME=~/.codexwhereconfig.tomlis located (~/.codex/config.toml) with MCP is configured. So far, no dice, no MCPs are showing.@codex deep dive into this issue
@Alfredo-Sandoval , it looks like codex is not fully mcp compliant. https://www.reddit.com/r/mcp/comments/1mn6s4h/codex_is_not_fully_mcp_compliant_how_to_work/
https://github.com/openai/codex/issues/3324
Your mcp keys are incorrect
config should be like
the example gives
[mcp_servers.servername]Thanks for replying. However, I am not quite sure what are you referring
to:
Node-based MCPs?
Or
differently. In that case what would be correct syntax?
Thank you.
On Wed, Sep 10, 2025, 3:04 AM Focused Instability @.***>
wrote:
@akamalov not at all, im just saying that the config posted had
[mcpServers.brave-search]when it should be
[mcp_servers.bravesearch]so it would be
Ive not tested docker, i was just commenting this difference as to why its likely not working.
Edit: I think the config would look like this... looking at the documentation - https://github.com/openai/codex/blob/main/docs/advanced.md#model-context-protocol-mcp
@MrAshRhodes , you're awesome! Thank you very much indeed for your help!!
I've got it working in the past with Azure OpenAI but now since 2 days the sidebar stays blank in vscode, codexcli is working. is this also possible trough remote-ssh with Azure openAI
Thanks for reporting the problem. The thread has explored a number of related topics, so it's not clear to me whether there's anything remaining to do with the original documentation issue. I think the docs are now up to date, so I'm going to mark this issue as closed. If you're aware of any config keys that are still missing from the docs, please open a new issue.
@etraut-openai docs still not up do date:
From https://developers.openai.com/codex/local-config/
Key | Type / Values | Details
-- | -- | --
tools.web_search | boolean | Enable the built-in web search tool (alias:
web_search_request).tools.view_image | boolean | Allow Codex to attach local image files from the workspace to messages.
Leads to warnings in Codex CLI:
⚠
tools.view_imageis deprecated. Useview_image_toolinstead.You can either enable it using the CLI with
--enable view_image_toolor through the config.toml file with[features].view_image_tool⚠
tools.web_searchis deprecated. Useweb_search_requestinstead.You can either enable it using the CLI with
--enable web_search_requestor through the config.toml file with[features].web_search_request