從寫程式碼,到創作下一幕

探索 字節跳動 - 火山方舟 的 AI 程式設計與影片創作活動。

Agent Plan & Coding Plan

一站體驗多款熱門模型,為 AI 程式設計與智能體開發提供更多選擇。新使用者可聯絡(微信: goo_lvyouyou)免費體驗 9.9 agent plan。

Seedance 2.5

讓創意,躍然成片。探索 30 秒影片、多模態參考與局部編輯,把腦海中的畫面變成下一支作品。

繁體中文

設定參考

Codex config.toml 和 requirements.toml 的完整參考

將此頁面用作 Codex 設定檔的可搜尋參考。如需概念指導和範例,請先參閱設定基礎和高階設定。

透過 Work Cloud 存取本機電腦的設定

啟用透過 Work Cloud 存取本機電腦的功能後,OpenAI 雲端負責協調任務,受支援的工具則在雲端或所連線的電腦上執行。要求用於設定限制;設定值用於提供預設值。

使用策略 API 管理 Global 設定。要管理 Local 或 Codex Cloud 設定,請使用 Agent Security 介面。遷移後,現有的 Global API 工作流程仍然可用。請測試你的指令碼和 Terraform 整合,並確認策略分配及排序保持不變。支援某個 requirements.toml 欄位本身並不能證明 API 相容性。

設定或設定類別 透過 Work Cloud 存取本機電腦時的作用域 指南
核准策略和審查要求 啟用受管策略時的 Global 編排器策略 將核准和審查控制保留在 Global 中。環境覆蓋設定無法更改編排器控制。本機執行與雲容器執行具有各自獨立的策略作用域。
受管應用、MCP server、外掛、市場和命令規則 Global 策略 將這些控制保留在全域作用域中。不要將欄位出現在資料結構中視為可以按環境編輯該欄位的證明。
檔案、沙箱和可跨環境使用的網路要求 本機執行 對於本機執行,MDM 和舊版受管裝置要求的優先順序高於 Agent Security。裝置的系統要求檔案的優先順序低於 Agent Security。新的企業 requirements.toml 設定不適用於 Work 雲容器,後者保留現有的 Work Cloud 策略。
特定平台的執行器控制 執行該步驟的電腦 支援情況取決於執行器和平台。
受管鉤子 啟用後,管理員定義的 MCP 鉤子會針對受支援的生命週期事件和工具事件在雲端協調器(編排器)上執行。 在依賴這些鉤子之前,請測試回呼連線,確認其接收的事件,並檢查失敗會如何影響任務。MCP 鉤子無法提供完整的 Compliance API 稽核追蹤記錄。雲端編排不支援命令鉤子、本機設定鉤子和外掛鉤子,即使工具在本機執行也是如此。對於編排和執行均在本機進行的純本機 Work 和 Codex 執行緒,現有的受支援鉤子仍然適用。
代理監聽地址、埠和程序設定 不屬於可跨環境使用的環境策略 雲端執行時不支援受管 HTTP/SOCKS 監聽埠和非迴環代理監聽器;套接字規則的支援情況取決於執行路徑。自訂代理設定與受支援的目標地址限制相互獨立。
僅適用於應用的設定和普通本機預設值 雲端協調不一定使用這些設定 即使透過 Work Cloud 存取本機電腦的功能不使用應用強制實施的控制,這些控制仍可能有效。雲端交付和雲端瀏覽器行為需要單獨驗證。

透過 Work Cloud 存取本機電腦的 Agent Security 要求

對於具有本機存取權限的 Work 和 dots,啟用受管策略後,受支援的 Global 策略會應用於共享的雲端編排器。本機執行要求約束所連線的電腦。Work 雲容器和 dots 雲電腦使用各自的執行設定和要求。請分別測試本機和雲端控制措施。

Agent Security UI 中提供的設定

  • 允許的核准策略
  • 允許的網頁搜尋模式

透過 TOML 設定的設定

  • allowed_approvals_reviewers
  • auto_review
  • guardian_policy_config
  • apps
  • mcp_servers
  • plugins
  • rules

這些編排器要求保留在 Global 中。它們不會設定共享雲端功能的權限,也不會使本機執行設定可移植到 Work 雲容器或 dots 雲電腦。

透過 Work Cloud 存取本機電腦的相容性限制

是否支援取決於欄位、策略的下發方式以及任務的執行位置。啟用同步前,請檢查成員實際生效的策略。如表中所述,某些控制措施需要在你的部署環境中測試。

在同一策略內,優先順序從高到低依次為:特定作業系統的環境覆蓋 → 所有作業系統的環境覆蓋 → Global。即使較低優先順序的策略更具體,仍以較高優先順序的策略為準。

對於本機執行,MDM 和舊版受管裝置要求的優先順序高於 Agent Security,而 Agent Security 的優先順序高於裝置的系統要求檔案。某些要求(包括網路要求)具有特定於欄位的合併規則和執行時限制。範例請參閱受管設定。

設定或設定類別 透過 Work Cloud 存取本機電腦的相容性 管理員指導
sqlite_home, log_dir, model_catalog_json 不支援用作受管雲端覆蓋。 本機路徑無法更改雲端儲存或日誌的位置。本機模型目錄不會沿用到雲端。
model_provider, model_providers 透過 Work Cloud 存取本機電腦的受管要求或設定不支援這些欄位。 自訂推理閘道器和供應商連線不會透過這些欄位沿用到雲端。這與模型選擇是兩回事。
enforce_residency 在任一雲端策略中啟用時,會阻止透過 Work Cloud 存取本機電腦。 如果在任一雲端策略中啟用 enforce_residency,Work 和 dots 的允許存取本機電腦 都會被停用。此保護措施不會設定工作區的資料駐留位置,也不會單獨停用 Work Cloud 或 dots。
application.network.enabled 和 application.network.domains 透過 Work Cloud 存取本機電腦不支援這些欄位。 請勿將這些應用目標地址限制用作透過 Work Cloud 存取本機電腦時的命令網路控制措施。
allow_browser_and_computer_use, in_app_browser, additional_developer_instructions 雲端策略下發需要驗證。透過 Work Cloud 存取本機電腦會拒絕這些受管要求鍵。 瀏覽器限制在應用端有檢查機制。這並不能證明策略會下發到雲端或在雲端瀏覽器中強制執行。additional_developer_instructions 需要編排器支援。
experimental_network 和 permissions.<profile>.network 部分支援。受支援的目標地址和執行器限制與自訂代理設定不同。 雲端執行時不支援受管 HTTP/SOCKS 監聽埠和非迴環代理監聽器;套接字規則的支援情況取決於執行路徑。本機執行的合併行為需單獨考慮。命令網路限制不會停用受管搜尋、MCP 或應用工具。
功能 / feature_requirements, 模型, computer_use 部分支援。 已停用的開關會被拒絕,例如 tool_search = false、tool_search_always_defer_mcp_tools = false、js_repl = true 和 remote_control = true。某些電腦使用設定仍需進行端到端驗證。
browser_use, allow_appshots, 回饋, allow_remote_control, 市場來源限制 在某些策略下發路徑中,應用或 app-server 會強制執行這些控制措施。 即使透過 Work Cloud 存取本機電腦時忽略某個欄位,應用控制措施仍可能生效。桌面瀏覽器站點規則不適用於 Work 雲容器。請驗證實際介面和策略下發路徑。

設定資料結構包含的某些鍵可能不適用於透過 Work Cloud 存取本機電腦,或不支援環境覆蓋。有關全域基線和優先順序,請參閱受管設定。

config.toml

使用者級設定位於 ~/.codex/config.toml。你還可以在 .codex/config.toml 檔案中新增專案範圍的覆蓋設定。只有當你信任專案時,Codex 才會載入專案範圍的設定檔。

專案範圍的設定不能覆蓋電腦本機的供應商、身分驗證、 宿主應用擁有的請求後設資料、通知、設定檔選擇或 遙測路由鍵。當 openai_base_url、 chatgpt_base_url、apps_mcp_product_sku、model_provider、 model_providers、notify、profile、profiles、 experimental_realtime_ws_base_url 和 otel 出現在專案本機的 .codex/config.toml 中時,Codex 會忽略它們;請改為將供應商、通知和遙測 鍵放在使用者級設定中。設定設定檔以 $CODEX_HOME/profile-name.config.toml 的形式與 config.toml 位於同一位置;使用 --profile profile-name 選擇一個設定檔。

對於沙箱和核准鍵(approval_policy、sandbox_mode 和 sandbox_workspace_write.*),請將本參考與沙箱和核准、可寫根目錄中的受保護路徑及網路存取配合使用。有關測試版權限設定檔,請參閱權限。

Codex 和 ChatGPT Work 不再支援 approval_policy = "untrusted"。 請移除該設定,或選擇受支援的策略。專案條目中設定的 trust_level = "untrusted" 在使用者級 ~/.codex/config.toml 中仍受支援。請參閱 從已停用的 untrusted 核准策略遷移, 瞭解範例及核准方式的權衡。

將 model 設定為你已登入的帳戶或工作區可用的模型。使用範例值前,請參閱 GPT-6.1 Sol 可用性。

鍵 類型 / 值 詳細資訊
agents table 多智能體設定和自訂角色宣告。標量設定名為保留名稱,不能用作自訂角色名。
agents.<name>.config_file string (path) 為該角色宣告設定層的 TOML 檔案路徑;相對路徑以宣告該角色的設定檔所在目錄為基準解析。
agents.<name>.description string 向 Codex 展示的角色指導,用於選擇並生成該類型的智能體。
agents.default_subagent_model string 新生成智能體的預設模型。顯式指定的 spawn 模型優先。
agents.default_subagent_reasoning_effort string 新生成智能體的預設推理強度。顯式指定的 spawn 推理強度優先。
agents.enabled boolean 啟用或停用多智能體工具(預設:true)。
agents.interrupt_message boolean 智能體回合被中斷時,記錄模型可見的訊息(預設:true)。
agents.max_concurrent_threads_per_session number 可同時開啟的已生成智能體 thread 的最大數量,不包括主 thread。未設定時,由 Codex 選擇預設值。
agents.max_threads number agents.max_concurrent_threads_per_session 的舊別名。
allow_login_shell boolean 允許基於 shell 的工具使用登入 shell 語義。預設值為 true;為 false 時,login = true 請求會被拒絕,省略 login 時預設使用非登入 shell。
analytics.enabled boolean 啟用或停用此裝置或設定檔的分析功能。未設定時使用客戶端預設值。
approval_policy on-request | never | { granular = { sandbox_approval = bool, rules = bool, mcp_elicitations = bool, request_permissions = bool, skill_approval = bool } } 控制 Codex 何時在執行命令前暫停並請求核准。也可以使用 approval_policy = { granular = { ... } } 允許或自動拒絕特定類別的核准提示,同時讓其他提示繼續互動。untrusted 不受支援,on-failure 已棄用;互動式執行請使用 on-request,非互動式執行請使用 never。
approval_policy.granular.mcp_elicitations boolean 為 true 時,允許顯示 MCP elicitation 提示,而不是自動拒絕。
approval_policy.granular.request_permissions boolean 為 true 時,允許顯示 request_permissions 工具的提示。
approval_policy.granular.rules boolean 為 true 時,允許顯示 execpolicy prompt 規則觸發的核准提示。
approval_policy.granular.sandbox_approval boolean 為 true 時,允許顯示沙箱權限提升的核准提示。
approval_policy.granular.skill_approval boolean 為 true 時,允許顯示 skill 指令碼的核准提示。
approvals_reviewer user | auto_review 在 on-request 或細粒度核准策略下,由誰審查符合條件的核准提示。預設值為 user;auto_review 使用審查子智能體。此設定不會改變沙箱,也不會審查沙箱內已經允許的操作。
apps._default.approvals_reviewer user | auto_review 應用工具核准提示的預設審查方,除非有針對某個應用的覆蓋值。省略時,應用繼承頂層 approvals_reviewer 值。
apps._default.default_tools_approval_mode auto | prompt | writes | approve 沒有應用級或工具級覆蓋值時,應用工具的預設核准行為。
apps._default.destructive_enabled boolean destructive_hint = true 的應用工具的預設允許或拒絕設定。
apps._default.enabled boolean 所有應用的預設啟用狀態,除非有針對某個應用的覆蓋值。
apps._default.open_world_enabled boolean open_world_hint = true 的應用工具的預設允許或拒絕設定。
apps.<id>.approvals_reviewer user | auto_review 此應用工具核准提示的審查方。覆蓋 apps._default.approvals_reviewer。
apps.<id>.default_tools_approval_mode auto | prompt | writes | approve 沒有工具級覆蓋值時,此應用工具的預設核准行為。
apps.<id>.default_tools_enabled boolean 此應用中工具的預設啟用狀態,除非有工具級覆蓋值。
apps.<id>.destructive_enabled boolean 允許或阻止此應用中宣告 destructive_hint = true 的工具。
apps.<id>.enabled boolean 按 ID 啟用或停用特定應用或連接器(預設:true)。
apps.<id>.open_world_enabled boolean 允許或阻止此應用中宣告 open_world_hint = true 的工具。
apps.<id>.tools.<tool>.approval_mode auto | prompt | writes | approve 覆蓋單一應用工具的核准行為。
apps.<id>.tools.<tool>.enabled boolean 覆蓋某個應用工具的啟用狀態(例如 repos/list)。
auto_review.extra_policy string 用於自動審查的附加本機 Markdown 策略,與主策略一並提供。受管理的 guardian_extra_policy 優先。空白值會被忽略。
auto_review.policy string 用於自動審查的本機 Markdown 策略指令。受管理的 guardian_policy_config 優先。空白值會被忽略。
background_terminal_max_timeout number 空 write_stdin 輪詢的最大等待時間,單位為毫秒(用於背景終端輪詢)。預設值:300000(5 分鐘)。替代舊的 background_terminal_timeout 鍵。
browser_use.allow_history_access boolean 設為 false 可限制存取瀏覽器歷史記錄。受管理要求可以強制實施此限制。
browser_use.default_origin_policy table 瀏覽器來源的預設限制。支援 access、uploads、downloads 和 full_cdp_access,每項可設為 allow 或 deny。
browser_use.origins.<origin> table 各瀏覽器來源的限制,欄位與 browser_use.default_origin_policy 相同。須包含 HTTP 或 HTTPS 協議,可包含埠;不含路徑、查詢參數或片段。本機值不能放寬受管理的拒絕規則。
chatgpt_base_url string 覆蓋 ChatGPT 登入流程使用的基礎 URL。
check_for_update_on_startup boolean 啟動時檢查 Codex 更新(僅在更新由組織集中管理時設為 false)。
cli_auth_credentials_store file | keyring | auto | ephemeral 控制 CLI 快取憑證的儲存位置。
compact_prompt string 直接覆蓋歷史記錄壓縮提示詞。
computer_use.default_app_access allow | deny Computer Use 的預設原生應用存取策略。應用專用條目可以提供策略;本機設定不能放寬受管理限制。
computer_use.macos.bundle_ids map<string, allow | deny> 以 bundle identifier 為鍵的 macOS 原生應用存取設定。
computer_use.windows.always_allowed_app_ids array<string> Computer Use 無需詢問即可開啟的 Windows 應用識別符。不在列表中的應用需要核准;可在 ChatGPT 桌面應用程式的 Computer Use 設定中刪除已儲存的條目。
computer_use.windows.aumids map<string, allow | deny> 以 Application User Model ID(AUMID)為鍵的 Windows 打包應用存取設定。
computer_use.windows.exes array<table> Windows 執行檔存取規則。每條規則必須包含 publisher_name、product_name 和 access(allow 或 deny);binary_name 可選。
default_permissions string 應用於沙箱工具呼叫的預設權限設定檔名稱。內建設定檔為 :read-only、:workspace 和 :danger-full-access;自訂名稱須有對應的 [permissions.&lt;name&gt;] 表。不得與 sandbox_mode 或 [sandbox_workspace_write] 合用。
desktop.custom_file_handlers.<id> table 僅限使用者級設定。為 ChatGPT 桌面應用程式定義一個附加的 Open in 目標。範例及處理器 ID 限制請參閱 新增自訂檔案處理器。
desktop.custom_file_handlers.<id>.args array<string> 插入命令與檔案輸入之間的參數(預設:[])。
desktop.custom_file_handlers.<id>.command string 用於檢測和啟動的執行檔路徑或命令名。必填。
desktop.custom_file_handlers.<id>.icon string 處理器圖示的打包資源路徑、Base64 編碼的 data:image/... URL、檔案 URI 或本機絕對路徑。必填;不支援的來源使用預設 VS Code 圖示。
desktop.custom_file_handlers.<id>.input path | json_argument | json_stdin 應用向處理器傳遞檔案輸入的方式(預設:path)。
desktop.custom_file_handlers.<id>.label string 在 Open in 選單中顯示的名稱。必填。
desktop.custom_file_handlers.<id>.supports_ssh boolean 是否為 SSH 工作區中的檔案提供此處理器(預設:false)。
developer_instructions string 注入會話的附加開發者指令(可選)。
disable_paste_burst boolean 停用 TUI 中的突發貼上檢測。
experimental_compact_prompt_file string (path) 從檔案載入壓縮提示詞覆蓋值(實驗性)。
experimental_use_unified_exec_tool boolean 啟用 unified exec 的舊名稱;優先使用 [features].unified_exec 或 codex --enable unified_exec。
features.apps boolean 啟用應用(連接器)整合(穩定功能;預設開啟)。應用和連接器流量不受沙箱命令網路代理及其網域允許列表控制。
features.code_mode.direct_only_tool_namespaces array<string> code mode 只能透過直接工具呼叫使用的工具命名空間。
features.code_mode.enabled boolean 啟用 code mode 功能設定。此功能正在開發中,預設關閉。
features.code_mode.excluded_tool_namespaces array<string> code mode 不納入巢狀工具說明和執行器暴露範圍的工具命名空間。
features.context_management.experimental_mode boolean 實驗性上下文管理設定。此功能目前不可用。
features.enable_request_compression boolean 支援時使用 zstd 壓縮流式請求體(穩定功能;預設開啟)。
features.fast_mode boolean 在 TUI 中啟用模型目錄的服務層級選擇;當前模型宣告支援時,也包括 Fast 層級命令(穩定功能;預設開啟)。
features.goals boolean 啟用持久化目標和自動繼續(穩定功能;預設開啟)。
features.hooks boolean 啟用從 hooks.json 或內聯 [hooks] 設定載入的生命週期鉤子。features.codex_hooks 是已棄用的別名。
features.memories boolean 啟用 記憶(預設關閉)。
features.multi_agent boolean 啟用多智能體協作工具(spawn_agent、send_input、resume_agent、wait_agent 和 close_agent)(穩定功能;預設開啟)。
features.network_proxy boolean | table 為沙箱命令啟動網路代理(實驗性;預設關閉)。除非管理員管理的 experimental_network 要求已啟動代理,否則必須啟用此項才能實施權限設定檔的網域規則。設定 domains 等功能級策略選項時使用表。不會過濾網頁搜尋、應用、MCP 或其他託管工具。
features.network_proxy.allow_local_binding boolean 允許更廣泛的本機或私有網路存取。預設值為 false;精確本機 IP 字面量或 localhost 允許規則仍可放行特定本機目標。
features.network_proxy.allow_upstream_proxy boolean 允許串聯環境中指定的上游代理。預設值為 true。
features.network_proxy.dangerously_allow_all_unix_sockets boolean 允許任意 Unix socket 目標,而不使用僅限允許列表的存取方式。預設值為 false;僅在嚴格受控的環境中使用。
features.network_proxy.dangerously_allow_non_loopback_proxy boolean 允許非迴環監聽地址。預設值為 false;啟用後可能將代理監聽器暴露到 localhost 之外。
features.network_proxy.domains map<string, allow | deny> 沙箱網路的網域策略。預設未設定,意味著加入 allow 規則前,不允許存取任何外部目標。支援精確主機、僅匹配子網域的 *.example.com、同時匹配根網域及子網域的 **.example.com,以及全域 * 允許規則。優先使用範圍明確的規則,因為 * 會廣泛開放外部存取。用 deny 規則阻止目標;發生衝突時以 deny 為準。
features.network_proxy.enable_socks5 boolean 提供 SOCKS5 支援。預設值為 true。
features.network_proxy.enable_socks5_udp boolean 允許透過 SOCKS5 使用 UDP。預設值為 true。
features.network_proxy.enabled boolean 啟用命令網路存取時啟動沙箱命令網路代理。預設值為 false;代理關閉時,不實施權限設定檔的網域規則。
features.network_proxy.proxy_url string 沙箱網路的 HTTP 監聽 URL。預設值為 "http://127.0.0.1:3128"。
features.network_proxy.socks_url string SOCKS5 監聽 URL。預設值為 "http://127.0.0.1:8081"。
features.network_proxy.unix_sockets map<string, allow | deny> 沙箱網路的 Unix socket 策略。預設未設定;新增 allow 條目可允許相應 socket。
features.personality boolean 啟用個性風格選擇控制項(穩定功能;預設開啟)。
features.prevent_idle_sleep boolean 有 turn 正在執行時,防止裝置進入睡眠(實驗性;預設關閉)。
features.remote_plugin boolean 啟用遠端 plugin 目錄(穩定功能;預設開啟)。
features.rollout_budget.enabled boolean 啟用 rollout 預算追蹤。此功能正在開發中,預設關閉。啟用時必須設定 features.rollout_budget.limit_tokens。
features.rollout_budget.limit_tokens integer rollout 預算追蹤的正數 token 上限。啟用 rollout 預算時必須設定。
features.rollout_budget.prefill_token_weight number rollout 預算統計中,預填充 token 的有限非負乘數。預設值為 1.0。
features.rollout_budget.reminder_interval_tokens integer rollout 預算提醒之間的正數 token 間隔。預設佔 limit_tokens 的 10%,最少為 1 token。
features.rollout_budget.sampling_token_weight number rollout 預算統計中,取樣 token 的有限非負乘數。預設值為 1.0。
features.shell_snapshot boolean 儲存 shell 環境快照,加快重複執行命令(穩定功能;預設開啟)。
features.shell_tool boolean 啟用預設 shell 工具以執行命令(穩定功能;預設開啟)。
features.skill_mcp_dependency_install boolean 允許為 skill 提示並安裝缺少的 MCP 依賴(穩定功能;預設開啟)。
features.unified_exec boolean 使用統一的基於 PTY 的 exec 工具(穩定功能;Windows 之外的平台預設啟用)。
features.web_search boolean 已棄用的舊開關;優先使用頂層 web_search 設定。
features.web_search_cached boolean 已棄用的舊開關。當 web_search 未設定時,true 對應 web_search = "cached"。
features.web_search_request boolean 已棄用的舊開關。當 web_search 未設定時,true 對應 web_search = "live"。
feedback.enabled boolean 在各本機客戶端啟用透過 /feedback 提交回饋(預設:true)。
file_opener vscode | vscode-insiders | windsurf | cursor | none 從 Codex 輸出開啟引用所使用的 URI scheme(預設:vscode)。
forced_chatgpt_workspace_id string (uuid) 將 ChatGPT 登入限制為特定工作區識別符。
forced_login_method chatgpt | api 將 Codex 限制為特定認證方式。
hide_agent_reasoning boolean 在 TUI 和 codex exec 輸出中隱藏推理事件。
history.max_bytes number 設定後,透過丟棄最舊條目,將歷史記錄檔案限制在指定位元組數以內。
history.persistence save-all | none 控制 Codex 是否將會話記錄儲存到 history.jsonl。
hooks table 在 config.toml 中內聯設定的生命週期鉤子。使用與 hooks.json 相同的事件 schema;範例及支援的事件請參閱鉤子指南。
hooks.<Event> array<table> 鉤子事件的匹配器分組,例如 PreToolUse、PermissionRequest、PostToolUse、PreCompact、PostCompact、SessionStart、SessionEnd、SubagentStart、SubagentStop、UserPromptSubmit、Stop 或 Interrupt。
hooks.<Event>[].hooks array<table> 匹配器分組的鉤子處理器。支援 command 和 MCP tool 鉤子;prompt 和 agent 鉤子會被解析,但跳過執行。
hooks.<Event>[].hooks[].additionalContextLimit integer 每個處理器的近似 token 門檻,用於將過大的 additionalContext 儲存到磁碟,並向模型提供較短預覽。預設值為 2500;0 將完整上下文直接傳給模型。參見 大體積鉤子輸出。
hooks.<Event>[].hooks[].async boolean 在背景執行 command 鉤子,不延遲觸發它的操作。預設值為 false;SessionEnd 始終同步執行。參見 在背景執行鉤子。
hooks.<Event>[].hooks[].commandWindows string command 鉤子的 Windows 專用命令覆蓋值。也支援 TOML 別名 command_windows。
instructions string 為將來使用保留;優先使用 model_instructions_file 或 AGENTS.md。
log_dir string (path) Codex 寫入日誌檔案的目錄;預設值為 $CODEX_HOME/log。顯式設定此目錄還會在其中啟用需主動開啟的明文 TUI 日誌 codex-tui.log。
marketplaces.<name>.ref string 市場的可選 Git 分支、標籤或提交。
marketplaces.<name>.source string Git 儲存庫地址或本機市場根目錄。本機來源使用絕對路徑;該目錄包含 .agents/plugins/marketplace.json。
marketplaces.<name>.source_type git | local 已設定 plugin 市場的來源類型。市場可在系統、雲端管理、使用者或受信任專案的 config.toml 中定義。
marketplaces.<name>.sparse_paths array<string> Git 市場的可選稀疏檢出路徑。須包含市場目錄及其引用的所有本機 plugin 目錄。
mcp_oauth_callback_port integer MCP OAuth 登入時使用的本機 HTTP 回呼 server 的可選全域固定埠。server 專用 oauth.callback_port 優先。兩者均未設定時,Codex 繫結作業系統選定的臨時埠。
mcp_oauth_callback_url string MCP OAuth 登入的可選基礎回呼 URL,例如 devbox 入口 URL。授權 server 支援 issuer identification 時,新加入的預註冊客戶端原樣使用此 URL;沒有已儲存回呼地址的現有客戶端會附加 server 專用回呼 ID。不支援 issuer identification 時,任何預註冊 MCP server 若設定的回呼地址缺少必需 ID,則回退到此 URL 並附加該 ID。回呼 URL 中的埠不決定監聽埠。
mcp_oauth_credentials_store auto | file | keyring MCP OAuth 憑證的首選儲存方式。
mcp_optional_startup_grace_ms integer (milliseconds) 建置初始工具目錄時,可選 MCP server 的共享等待時間。預設值為 1000。設為 0 可改為等待各 server 的 startup_timeout_sec。
mcp_servers.<id>.args array<string> 傳給 MCP stdio server 的參數。
mcp_servers.<id>.auth oauth | chatgpt MCP HTTP server 在已設定的 bearer token 和授權標頭之後嘗試的備用認證方式。oauth(預設)在可用時使用已儲存的 MCP OAuth 憑證。chatgpt 為可信的第一方 ChatGPT 來源使用當前 ChatGPT 會話,然後回退到已儲存的 OAuth。兩種模式在沒有找到任何憑證來源時都可以嘗試無認證連線。
mcp_servers.<id>.bearer_token_env_var string 提供 MCP HTTP server bearer token 的環境變數。
mcp_servers.<id>.command string MCP stdio server 的啟動命令。
mcp_servers.<id>.cwd string MCP stdio server 程序的工作目錄。
mcp_servers.<id>.default_tools_approval_mode auto | prompt | writes | approve 此 server 上 MCP 工具的預設核准行為,除非存在工具級覆蓋值。
mcp_servers.<id>.disabled_tools array<string> 在 enabled_tools 之後應用的拒絕列表。
mcp_servers.<id>.enabled boolean 停用 MCP server,但保留其設定。
mcp_servers.<id>.enabled_tools array<string> MCP server 暴露的工具名稱允許列表。
mcp_servers.<id>.env map<string,string> 傳給 MCP stdio server 的環境變數。
mcp_servers.<id>.env_http_headers map<string,string> 從環境變數讀取值的 MCP HTTP server 請求標頭。
mcp_servers.<id>.env_vars array<string | { name = string, source = "local" | "remote" }> 為 MCP stdio server 額外加入允許列表的環境變數。字串條目預設使用 source = "local";只有由執行器支援的遠端 stdio 才使用 source = "remote"。
mcp_servers.<id>.experimental_environment local | remote MCP server 的實驗性執行位置。remote 透過遠端執行器啟動 stdio server;尚未實現 streamable HTTP 的遠端執行。
mcp_servers.<id>.http_headers map<string,string> 每個 MCP HTTP 請求附帶的靜態 HTTP 標頭。
mcp_servers.<id>.http_headers_helper string (command) 輸出 HTTP 標頭名稱和值組成的 JSON 物件的本機命令。僅支援在本機連線的 HTTP MCP server。顯式 bearer token 和 OAuth 憑證優先於輔助程式提供的 Authorization 標頭。
mcp_servers.<id>.oauth_resource string MCP 登入期間可選的 RFC 8707 OAuth resource 參數。
mcp_servers.<id>.oauth.callback_port integer 此 MCP server 的固定 OAuth 回呼監聽埠。覆蓋 mcp_oauth_callback_port。直接使用帶顯式 URL 埠的迴環回呼時,須設定相同的監聽埠。
mcp_servers.<id>.oauth.callback_url string server 專用 OAuth 回呼地址。如果支援 issuer identification,或 URL 已以 server 專用回呼 ID 結尾,預註冊客戶端會重複使用此地址。否則,Codex 使用全域或預設回呼地址並附加該 ID。沒有預註冊 ID 的客戶端在註冊時使用此回呼地址。
mcp_servers.<id>.oauth.client_id string 對此 MCP server 進行授權及 token 交換時使用的預註冊 OAuth 客戶端 ID。
mcp_servers.<id>.required boolean 為 true 時,如果此已啟用的 MCP server 無法初始化,則啟動或恢復失敗。
mcp_servers.<id>.scopes array<string> 對此 MCP server 進行認證時請求的 OAuth scope。
mcp_servers.<id>.startup_timeout_ms number startup_timeout_sec 的毫秒形式別名。
mcp_servers.<id>.startup_timeout_sec number 覆蓋預設的 10 秒 server 啟動超時。
mcp_servers.<id>.tool_timeout_sec number 覆蓋預設的 60 秒單次工具呼叫超時。
mcp_servers.<id>.tools.<tool>.approval_mode auto | prompt | writes | approve 覆蓋此 server 上某個 MCP 工具的核准行為。
mcp_servers.<id>.tools.<tool>.output_token_limit integer (positive) 單一 MCP 工具輸出的 token 預算,隨後還會加上標準的 20% 序列化餘量。覆蓋模型對此工具的預設輸出截斷預算。
mcp_servers.<id>.url string MCP streamable HTTP server 的端點。
memories.consolidation_model string 全域記憶整合的可選模型覆蓋值。
memories.disable_on_external_context boolean 為 true 時,使用 MCP 工具呼叫、網頁搜尋或工具搜尋等外部上下文的 thread 不參與記憶生成。預設值為 false。舊別名:memories.no_memories_if_mcp_or_web_search。
memories.extract_model string 按 thread 提取記憶時的可選模型覆蓋值。
memories.generate_memories boolean 為 false 時,新建 thread 不會作為記憶生成輸入儲存。預設值為 true。
memories.max_raw_memories_for_consolidation number 用於全域整合而保留的近期原始記憶的最大數量。預設值為 256,上限為 4096。
memories.max_rollout_age_days number 可用於記憶生成的 thread 的最長保留天數。預設值為 30,範圍限定在 0–90。
memories.max_rollouts_per_startup number 每次啟動掃描處理的 rollout 候選項的最大數量。預設值為 16,上限為 128。
memories.max_unused_days number 記憶自上次使用起,仍可參與整合的最長天數。預設值為 30,範圍限定在 0–365。
memories.min_rate_limit_remaining_percent number 開始生成記憶前,Codex 速率限制視窗必須保有的最低剩餘百分比。預設值為 25,範圍限定在 0–100。
memories.min_rollout_idle_hours number thread 可參與記憶生成前所需的最短空閒時間。預設值為 6,範圍限定在 1–48。
memories.use_memories boolean 為 false 時,Codex 不會向後續會話注入已有記憶。預設值為 true。
model string 要使用的模型(例如 gpt-6.1-sol)。
model_auto_compact_token_limit number 觸發歷史記錄自動壓縮的 token 門檻(未設定時使用模型預設值)。
model_auto_compact_token_limit_scope total | body_after_prefix 控制自動壓縮門檻統計整個當前上下文(預設值 total),還是僅統計已沿用的壓縮視窗前綴之後新增的內容(body_after_prefix)。
model_catalog_json string (path) 啟動時載入的 JSON 模型目錄的可選路徑。選取的 $CODEX_HOME/profile-name.config.toml 設定檔可按設定檔覆蓋此值。
model_context_window number 當前模型可用的上下文視窗 token 數。
model_instructions_file string (path) 替換內建指令,而不是使用 AGENTS.md。
model_provider string model_providers 中的供應商 ID(預設:openai)。
model_providers.<id> table 自訂供應商定義。內建供應商 ID(openai、ollama 和 lmstudio)為保留名稱,不能覆蓋。
model_providers.<id>.auth table 自訂供應商基於命令取得 bearer token 的設定。不得與 env_key、experimental_bearer_token 或 requires_openai_auth 合用。
model_providers.<id>.auth.args array<string> token 命令的參數。
model_providers.<id>.auth.command string Codex 需要 bearer token 時執行的命令。此命令必須將 token 輸出到 stdout。
model_providers.<id>.auth.cwd string (path) token 命令的工作目錄。
model_providers.<id>.auth.refresh_interval_ms number Codex 主動重新整理 token 的間隔,單位為毫秒(預設:300000)。設為 0 可僅在認證重試後重新整理。
model_providers.<id>.auth.timeout_ms number token 命令的最長執行時間,單位為毫秒(預設:5000)。
model_providers.<id>.base_url string 模型供應商的 API 基礎 URL。
model_providers.<id>.env_http_headers map<string,string> 有對應環境變數時,從中讀取的 HTTP 標頭。
model_providers.<id>.env_key string 提供供應商 API key 的環境變數。
model_providers.<id>.env_key_instructions string 供應商 API key 的可選設定指引。
model_providers.<id>.experimental_bearer_token string 直接填寫的供應商 bearer token(不推薦;請使用 env_key)。
model_providers.<id>.http_headers map<string,string> 供應商請求附帶的靜態 HTTP 標頭。
model_providers.<id>.name string 自訂模型供應商的顯示名稱。
model_providers.<id>.query_params map<string,string> 供應商請求附帶的額外查詢參數。
model_providers.<id>.request_max_retries number 供應商 HTTP 請求的重試次數(預設:4)。
model_providers.<id>.requires_openai_auth boolean 供應商是否使用 OpenAI 認證(預設 false)。
model_providers.<id>.stream_idle_timeout_ms number SSE 流的空閒超時,單位為毫秒(預設:300000)。
model_providers.<id>.stream_max_retries number SSE 流中斷後的重試次數(預設:5)。
model_providers.<id>.supports_standalone_web_search boolean 宣告支援相容的獨立網頁搜尋端點(預設:false)。獨立搜尋仍在開發中,預設關閉;供應商相容本身不會啟用此功能。
model_providers.<id>.supports_websockets boolean 此供應商是否支援 Responses API 的 WebSocket 傳輸。
model_providers.<id>.wire_api responses 供應商使用的協議。responses 是唯一支援的值,省略時也是預設值。
model_providers.amazon-bedrock.aws.profile string 內建 amazon-bedrock 供應商使用的 AWS 設定檔名稱。
model_providers.amazon-bedrock.aws.region string 內建 amazon-bedrock 供應商使用的 AWS 區域。
model_reasoning_effort string 所選模型宣告支援的推理強度,例如 low、medium、high、xhigh、max 或 ultra。可用層級取決於模型和客戶端。
model_reasoning_summary auto | concise | detailed | none 選擇推理摘要的詳細程度,或完全停用摘要。
model_supports_reasoning_summaries boolean 強制 Codex 傳送或不傳送推理後設資料。
model_verbosity low | medium | high 可選的 GPT-5 Responses API 詳細程度覆蓋值;未設定時使用所選模型或預設的預設值。
notice.hide_full_access_warning boolean 記錄完全存取權限警告提示的確認狀態。
notice.hide_gpt-5.1-codex-max_migration_prompt boolean 記錄 gpt-5.1-codex-max 遷移提示的確認狀態。
notice.hide_gpt5_1_migration_prompt boolean 記錄 GPT-5.1 遷移提示的確認狀態。
notice.hide_rate_limit_model_nudge boolean 記錄使用者不再接收速率限制模型切換提醒的選擇。
notice.hide_world_writable_warning boolean 記錄 Windows 全域可寫目錄警告的確認狀態。
notice.model_migrations map<string,string> 以 old->new 對映記錄已確認的模型遷移。
notify array<string> 用於通知的呼叫命令;接收 Codex 提供的 JSON 載荷。
openai_base_url string 覆蓋內建 openai 模型供應商的基礎 URL。
oss_provider lmstudio | ollama 使用 --oss 執行時的預設本機供應商(未設定時預設詢問使用者)。
otel.environment string 附加到輸出的 OpenTelemetry 事件上的環境標籤(預設:dev)。
otel.exporter none | otlp-http | otlp-grpc 選擇 OpenTelemetry 匯出器,並提供端點後設資料。
otel.exporter.<id>.endpoint string OTEL 日誌的匯出器端點。
otel.exporter.<id>.headers map<string,string> OTEL 匯出器請求附帶的靜態標頭。
otel.exporter.<id>.protocol binary | json OTLP/HTTP 匯出器使用的協議。
otel.exporter.<id>.tls.ca-certificate string OTEL 匯出器 TLS 的 CA 憑證路徑。
otel.exporter.<id>.tls.client-certificate string OTEL 匯出器 TLS 的客戶端憑證路徑。
otel.exporter.<id>.tls.client-private-key string OTEL 匯出器 TLS 的客戶端私鑰路徑。
otel.log_user_prompt boolean 主動選擇透過 OpenTelemetry 日誌匯出使用者原始提示詞。
otel.metrics_exporter none | statsig | otlp-http | otlp-grpc 選擇 OpenTelemetry metrics 匯出器(預設:statsig)。
otel.trace_exporter none | otlp-http | otlp-grpc 選擇 OpenTelemetry trace 匯出器,並提供端點後設資料。
otel.trace_exporter.<id>.endpoint string OTEL 日誌的 trace 匯出器端點。
otel.trace_exporter.<id>.headers map<string,string> OTEL trace 匯出器請求附帶的靜態標頭。
otel.trace_exporter.<id>.protocol binary | json OTLP/HTTP trace 匯出器使用的協議。
otel.trace_exporter.<id>.tls.ca-certificate string OTEL trace 匯出器 TLS 的 CA 憑證路徑。
otel.trace_exporter.<id>.tls.client-certificate string OTEL trace 匯出器 TLS 的客戶端憑證路徑。
otel.trace_exporter.<id>.tls.client-private-key string OTEL trace 匯出器 TLS 的客戶端私鑰路徑。
permissions.<name>.description string 此命名設定檔的說明。設定檔不會透過 extends 繼承父設定檔的說明。
permissions.<name>.extends string 在此命名設定檔之前應用的可選父設定檔。可指定另一個命名設定檔、:read-only 或 :workspace;:danger-full-access、未定義的父設定檔和迴圈繼承會被拒絕。
permissions.<name>.filesystem table 命名檔案系統權限設定檔。每個鍵為絕對路徑或 :minimal、:workspace_roots 等特殊 token。
permissions.<name>.filesystem.":workspace_roots".<subpath-or-glob> "read" | "write" | "deny" 相對於每個有效工作區根目錄的檔案系統存取範圍。使用 "." 表示根目錄本身;"**/*.env" 等 glob 子路徑可透過 "deny" 禁止讀取。
permissions.<name>.filesystem.<path-or-glob> "read" | "write" | "deny" | table 為路徑、glob 模式或特殊 token 授予直接存取權限,或將巢狀條目的範圍限定在該根目錄下。使用 "deny" 可禁止讀取匹配路徑。
permissions.<name>.filesystem.glob_scan_max_depth number 在沙箱啟動前對匹配項建立快照的平台上,deny-read glob 模式展開的最大深度。設定時至少為 1。
permissions.<name>.network.allow_local_binding boolean 允許透過沙箱網路存取更廣泛的本機或私有網路。精確本機 IP 字面量或 localhost 允許規則仍可放行特定本機目標,即使此項保持 false。
permissions.<name>.network.allow_upstream_proxy boolean 允許沙箱網路串聯另一個上游代理。
permissions.<name>.network.dangerously_allow_all_unix_sockets boolean 允許任意 Unix socket 目標,而不使用預設的受限集合。僅在嚴格受控的環境中使用。
permissions.<name>.network.dangerously_allow_non_loopback_proxy boolean 允許沙箱網路監聽器繫結非迴環地址。啟用後可能將監聽器暴露到 localhost 之外。
permissions.<name>.network.domains table 沙箱命令的網域規則。只有 features.network_proxy 或已啟用的管理員管理網路要求啟用代理時才實施。支援精確主機、*.example.com、**.example.com 和全域 * 允許規則;以 deny 為準。不會限制網頁搜尋、應用或 MCP server。
permissions.<name>.network.domains.<pattern> allow | deny 允許或拒絕精確主機或 *.example.com、**.example.com 等限定範圍的萬用字元模式。
permissions.<name>.network.enable_socks5 boolean 此權限設定檔啟用沙箱網路時,提供 SOCKS5 支援。
permissions.<name>.network.enable_socks5_udp boolean 啟用後,允許透過 SOCKS5 監聽器使用 UDP。
permissions.<name>.network.enabled boolean 為此權限設定檔中的命令啟用網路存取。此項不會啟動網路代理。未啟用 features.network_proxy 或管理員管理的網路要求時,命令直接存取網路,不實施設定檔的網域規則。
permissions.<name>.network.mode limited | full 子程序流量使用的網路代理模式。
permissions.<name>.network.proxy_url string 此權限設定檔啟用沙箱網路時使用的 HTTP 監聽 URL。
permissions.<name>.network.socks_url string 此權限設定檔使用的 SOCKS5 代理端點。
permissions.<name>.network.unix_sockets table 沙箱網路的 Unix socket 允許列表覆蓋值。使用 socket 路徑作為鍵;allow 新增路徑,deny 拒絕路徑。
permissions.<name>.network.unix_sockets.<path> allow | deny 用 allow 將 Unix socket 絕對路徑加入有效允許列表,或用 deny 拒絕該路徑。被拒絕的條目不會進入有效允許列表。
permissions.<name>.workspace_roots table 設定檔定義的工作區根目錄;這些目錄與會話執行時工作區根目錄一同應用 :workspace_roots 檔案系統規則。
permissions.<name>.workspace_roots.<path> boolean 為 true 時,將路徑加入此設定檔的工作區根目錄集合。停用的條目保持不生效。
personality none | friendly | pragmatic 支援 supportsPersonality 的模型的預設溝通風格;可按 thread 或 turn 覆蓋,也可透過 /personality 覆蓋。
plan_mode_reasoning_effort string 計畫模式專用的推理強度覆蓋值,須使用所選模型支援的層級。未設定時,計畫模式使用其內建預設組態的預設值。
plugins.<plugin>.enabled boolean 使用 plugin-name@marketplace-name 鍵啟用或停用本機市場中的 plugin。從有效的合併設定中讀取;受信任專案設定可覆蓋使用者、雲端管理和系統預設值。重新整理市場時,即使 plugin 已停用,也可安裝或重新整理已設定的 plugin。此設定不會覆蓋工作區管理的啟用狀態。
plugins.<plugin>.mcp_servers.<server>.default_tools_approval_mode auto | prompt | writes | approve plugin 提供的 MCP server 上工具的預設核准行為。
plugins.<plugin>.mcp_servers.<server>.disabled_tools array<string> 在 plugin 提供的 MCP server 的 enabled_tools 之後應用的拒絕列表。
plugins.<plugin>.mcp_servers.<server>.enabled boolean 啟用或停用已安裝 plugin 隨附的 MCP server,無需修改 plugin manifest。
plugins.<plugin>.mcp_servers.<server>.enabled_tools array<string> plugin 提供的 MCP server 暴露的工具允許列表。
plugins.<plugin>.mcp_servers.<server>.tools.<tool>.approval_mode auto | prompt | writes | approve 覆蓋 plugin 提供的某個 MCP 工具的核准行為。
project_doc_fallback_filenames array<string> 缺少 AGENTS.md 時嘗試的其他檔名。
project_doc_max_bytes number 建置專案指令時,從 AGENTS.md 讀取的最大位元組數。
project_root_markers array<string> 專案根目錄標記檔名列表;向父目錄搜尋專案根目錄時使用。
projects.<path>.trust_level string 將專案或工作樹標記為受信任或不受信任("trusted" | "untrusted")。不受信任的專案跳過專案級 .codex/ 設定層,包括專案本機設定、鉤子和規則。
review_model string /review 使用的可選模型覆蓋值(預設使用當前會話模型)。
sandbox_mode read-only | workspace-write | danger-full-access 命令執行期間的檔案系統和網路存取沙箱策略。
sandbox_workspace_write.exclude_slash_tmp boolean 在 workspace-write 模式下,將 /tmp 排除在可寫根目錄之外。
sandbox_workspace_write.exclude_tmpdir_env_var boolean 在 workspace-write 模式下,將 $TMPDIR 排除在可寫根目錄之外。
sandbox_workspace_write.network_access boolean 允許在 workspace-write 沙箱內存取外部網路。
sandbox_workspace_write.writable_roots array<string> 當 sandbox_mode = "workspace-write" 時的附加可寫根目錄。
service_tier string 新 turn 的首選服務層級。使用 fast 或當前模型宣告的其他層級;fast 對應請求值 priority。
shell_environment_policy.exclude array<string> 舊版環境變數排除模式。新設定使用 shell_environment_policy.filters;同一設定層中不得合用兩種形式。
shell_environment_policy.experimental_use_profile boolean 生成子程序時使用使用者的 shell 設定檔。
shell_environment_policy.filters map<string, include | exclude> 規範的、不區分大小寫的環境變數模式過濾器。include 條目構成允許列表,不能恢復已排除的值。顯式 set 值在排除操作之後應用。同一設定層中,不得將 filters 與舊 exclude 或 include_only 陣列合用。
shell_environment_policy.ignore_default_excludes boolean 在其他過濾器執行前,保留名稱中包含 KEY、SECRET 或 TOKEN 的變數(預設:true)。設為 false 可自動排除名稱疑似秘密的變數。
shell_environment_policy.include_only array<string> 舊版環境變數模式允許列表。新設定使用 shell_environment_policy.filters;同一設定層中不得合用兩種形式。
shell_environment_policy.inherit all | core | none 生成子程序時的基本環境繼承策略。
shell_environment_policy.set map<string,string> 排除操作後注入的顯式環境變數值;include 過濾器仍可將其移除。
show_raw_agent_reasoning boolean 當前模型輸出原始推理內容時將其顯示出來。
skills.config array<object> 儲存在 config.toml 中、針對各 skill 的啟用狀態覆蓋值。
skills.config.<index>.enabled boolean 啟用或停用引用的 skill。
skills.config.<index>.path string (path) 包含 SKILL.md 的 skill 資料夾路徑。
skills.max_context_tokens integer (positive) 可用 skill 目錄的 token 預算。預設佔模型上下文視窗的 2%。顯式值上限為 10000 token。
sqlite_home string (path) Codex 儲存基於 SQLite 的狀態資料庫的目錄,用於智能體作業及其他可恢復執行時狀態。
suppress_unstable_features_warning boolean 隱藏啟用開發中功能開關時顯示的警告。
tool_output_token_limit number 在歷史記錄中儲存單一工具或函式輸出的 token 預算。
tool_suggest.disabled_tools array<table> 停用特定可發現連接器或 plugin 的推薦。每個條目使用 type = "connector" 或 "plugin",並提供 id。
tool_suggest.discoverables array<table> 允許工具推薦其他可發現的連接器或 plugin。每個條目使用 type = "connector" 或 "plugin",並提供 id。
tools.view_image boolean 啟用本機圖片附件工具 view_image。
tools.web_search boolean | { context_size = "low|medium|high", allowed_domains = [string], location = { country, region, city, timezone } } 可選的網頁搜尋工具設定。物件形式可設定搜尋上下文大小、允許的搜尋網域及使用者的大致位置。這些搜尋網域過濾器獨立於沙箱命令的網路網域規則,不限制連接器或 MCP server。
tui table TUI 專用選項,例如啟用內聯桌面通知。
tui.alternate_screen auto | always | never 控制 TUI 的備用螢幕使用方式(預設:auto;auto 在 Zellij 中跳過備用螢幕,以保留滾動歷史)。
tui.animations boolean 啟用終端動畫(歡迎畫面、閃光效果、旋轉指示器)(預設:true)。
tui.keymap.<context>.<action> string | array<string> TUI 操作的鍵盤快捷鍵繫結。支援的上下文包括 global、chat、composer、editor、vim_normal、vim_operator、vim_text_object、pager、list 和 approval。部分編輯器操作在未設定時使用 tui.keymap.global 繫結;支援時,上下文專用繫結優先。
tui.keymap.<context>.<action> = [] empty array 在該鍵位對映上下文中取消繫結此操作。鍵名使用規範化字串,例如 ctrl-a、shift-enter、page-down 或 minus。
tui.model_availability_nux.<model> integer 以模型 slug 為鍵的內部啟動工具提示狀態。
tui.notification_condition unfocused | always 控制 TUI 通知是僅在終端未獲焦點時觸發,還是無論焦點狀態都觸發。預設值為 unfocused。
tui.notification_method auto | osc9 | bel 終端通知所使用的通知方式(預設:auto)。
tui.notifications boolean | array<string> 啟用 TUI 通知;可選地限制為特定事件類型。
tui.raw_output_mode boolean 讓 TUI 啟動時進入原始滾動歷史模式,便於在終端中選擇並複製(預設:false)。可透過 /raw 或預設快捷鍵 alt-r 切換。
tui.resume_cwd current | session 恢復或分叉會話時使用的工作目錄。未設定時,如果當前目錄與會話儲存的目錄不同,Codex 會請你選擇。
tui.show_tooltips boolean 在 TUI 歡迎畫面中顯示入門工具提示(預設:true)。
tui.status_line array<string> | null TUI 頁尾狀態行條目識別符的有序列表。null 可停用狀態行。
tui.terminal_title array<string> | null 終端視窗或分頁標題條目識別符的有序列表。預設值為 ["spinner", "project"];null 可停用標題更新。
tui.theme string 語法高亮主題覆蓋值(採用 kebab-case 主題名)。
tui.vim_mode_default boolean 讓編輯器啟動時進入 Vim 普通模式,而不是插入模式(預設:false)。仍可透過 /vim 為每個會話切換。
web_search disabled | cached | indexed | live 網頁搜尋模式(預設:"cached";cached 使用 OpenAI 維護的索引,不存取外部網頁;indexed 僅在搜尋索引允許時存取外部網頁;使用 --yolo 或其他完全存取權限的沙箱設定時,預設值為 "live")。使用 "live" 可不受搜尋索引限制地即時檢索;使用 "disabled" 可移除此工具。
windows_wsl_setup_acknowledged boolean 記錄 Windows 入門提示的確認狀態(僅限 Windows)。
windows.sandbox unelevated | elevated | mxc 在 Windows 上原生執行 Codex 時使用的 Windows 專用原生沙箱模式。

你可以在此處找到 config.toml 的最新 JSON Schema。

要在 VS Code 或 Cursor 中編輯 config.toml 時獲得自動補全和診斷功能,可以安裝 Even Better TOML 擴展,並將以下行新增到 config.toml 頂部:

#:schema https://developers.openai.com/codex/config-schema.json

注意:將 experimental_instructions_file 重新命名為 model_instructions_file。Codex 已棄用舊鍵;請將現有設定更新為新名稱。

requirements.toml

requirements.toml 是由管理員強制執行的設定檔,用於約束使用者無法覆蓋的安全敏感設定。有關詳細資訊、位置和範例,請參閱管理員強制執行的要求。

對於 ChatGPT Business 和 Enterprise 使用者,Codex 還可以應用從雲端取得的 要求。有關優先順序的詳細資訊,請參閱安全頁面。

在 requirements.toml 中使用 [features],透過與 config.toml 所用相同的 規範鍵固定執行時功能開關。要求還可以包含不屬於 config.toml 的、已有文件說明的 僅限應用的鍵。未指定的鍵不受 約束。

某些受管要求會強制執行精確的設定值,而不是 允許列表。使用者無法覆蓋強制執行的路徑、更新偏好設定、登入 shell 策略、回饋設定或 Windows 私有桌面設定。

受管權限設定檔允許列表要求 Codex 0.138.0 或更高版本。Codex 0.137.0 及更早版本會忽略 allowed_permission_profiles 和受管的 default_permissions。

將 allowed_sandbox_modes 與 sandbox_mode 搭配使用。對於權限設定檔 部署,請將 allowed_permission_profiles 與受管的 default_permissions 搭配使用。

untrusted 條目在 allowed_approval_policies 中仍然有效,適用於 Codex 在專案使用以下設定時推導出的更嚴格的核准行為: trust_level = "untrusted"。這並不允許顯式設定 approval_policy = "untrusted"。

[models.new_thread] 表提供受管的預設值,而非強制約束。 如果你透過 --model、 --config 或 --profile 顯式覆蓋模型或推理強度,Codex 會忽略 model 和 model_reasoning_effort,這兩個欄位均位於 [models.new_thread] 中。service_tier 獨立生效。

瀏覽器要求涵蓋三個獨立的操作介面。in_app_browser 控制由使用者直接開啟和使用的瀏覽器窗格。browser_use 控制由智能體在瀏覽器中執行的操作。computer_use 控制由智能體在 原生桌面應用程式中執行的操作。

巢狀的 Browser Use 和 Computer Use 策略值本身並不會授予存取權限。 針對特定來源或應用的 allow 可以覆蓋同一策略來源的 回退設定,但常規的功能、核准及其他策略檢查仍然適用。當受管要求與 config.toml 同時適用時,只要其中任一方設為 deny, 就以此為準。

鍵 類型 / 值 詳細資訊
additional_developer_instructions string 以單獨開發者訊息形式新增的受管理開發者指令。Codex 會拒絕超過約 10,000 token 上限的指令,計數包含上下文標記。
allow_appshots boolean 設為 false 可為受管理使用者停用 Appshots。省略時,Appshots 不受此要求限制,按產品的一般可用性規則提供。
allow_browser_and_computer_use boolean 設為 false 可同時阻止智能體驅動的 Browser Use 和原生應用 Computer Use。設為 true 或省略此項,不會直接啟用這兩項功能;其他功能、策略和核准檢查仍然適用。
allow_login_shell boolean 強制指定 shell 工具是否可以啟動登入 shell。
allow_managed_hooks_only boolean 為 true 時,Codex 跳過使用者、專案、會話及 plugin 鉤子,但仍允許 requirements.toml 和其他受管理設定層提供的鉤子。
allow_remote_control boolean 設為 false 可為受管理使用者停用裝置遠端控制。省略時,裝置遠端控制不受此要求限制,按產品的一般可用性規則提供。
allowed_approval_policies array<string> 允許的核准策略,例如 on-request、never 和 granular。加入 untrusted 可允許不受信任專案派生的更嚴格策略;不能直接透過 approval_policy 選擇該策略。
allowed_approvals_reviewers array<string> approvals_reviewer 允許的值,例如 user 和 auto_review。
allowed_chatgpt_workspaces array<string> 將 ChatGPT 登入(包括 Codex access token)限制為所列工作區 ID。空列表停用 ChatGPT 登入;若允許 API 認證,該方式仍可用。透過本機系統要求檔案或 macOS MDM 設定;雲端管理值會被忽略。
allowed_login_methods array<string> 允許 chatgpt、api 或兩者。省略時,不限制登入方式。設定時,列表必須至少包含一種方式。api 允許 API 認證,包括 Amazon Bedrock。透過本機系統要求檔案或 macOS MDM 設定。雲端管理值會被忽略。
allowed_permission_profiles table<boolean> 允許的權限設定檔完整列表。設為 true 的設定檔才被允許。省略或設為 false 的設定檔均被拒絕,包括未來版本加入的設定檔。合併要求來源時,按設定檔名稱匹配條目。
allowed_permission_profiles.<name> boolean 允許或拒絕已載入設定或要求來源中定義的內建或自訂權限設定檔。後加入且優先順序更高的要求來源可以用 false 停用較早且優先順序更低的來源所允許的設定檔。
allowed_sandbox_modes array<string> sandbox_mode 允許的值。
allowed_web_search_modes array<string> web_search 允許的值(disabled、cached、indexed、live)。disabled 始終被允許;空列表實際上僅允許 disabled。
apps table 以應用識別符為鍵的受管理應用要求。要求可以停用應用或約束個別工具的核准行為。
apps.<id>.enabled boolean 設為 false 可停用應用。合併多個要求來源時,停用要求仍然具有約束力。
apps.<id>.tools.<tool>.approval_mode auto | prompt | writes | approve 設定某個應用工具的受管理核准模式。
auto_review table 受管理的自動審查要求。
auto_review.ignore_rules array<string> Codex 在命令執行策略中忽略 allow 前綴規則的完整模型 slug。須精確匹配 slug,有供應商命名空間時也須包含;與 required_on_models 不同,此項不接受省略命名空間的別名。拒絕規則和網路規則仍然生效。
auto_review.required_on_models array<string> 必須使用自動審查的模型 slug。slug 必須非空、不含供應商命名空間,且前後無空白。多個要求來源的列表會合併。
browser_use table 智能體驅動的 Browser Use 的受管理要求。
browser_use.allow_global_persistent_approval boolean 設為 false 可阻止 Browser Use 建立或採用覆蓋所有網站的 Always allow(始終允許)核准,例如允許從任意網站下載。已儲存的核准會被忽略,但不會刪除。設為 true 或省略此項,不會建立核准。
browser_use.allow_history_access boolean 設為 false 可阻止 Browser Use 讀取瀏覽器歷史記錄。設為 true 或省略時,仍使用正常的歷史記錄設定和可用性檢查。
browser_use.default_origin_policy table 當 browser_use.origins 下沒有匹配條目定義相應設定時,各項 Browser Use 設定的預設值。匹配的來源規則會替換該策略來源中的預設值。隨後,Codex 在受管理要求與使用者設定中選擇更嚴格的結果。
browser_use.default_origin_policy.access allow | deny 使用 deny 可阻止 Browser Use 存取採用預設策略的來源。被拒絕的來源也會阻止上傳、下載、完整瀏覽器除錯存取和自動審查。allow 僅允許繼續正常的核准和策略檢查。
browser_use.default_origin_policy.access_approval_lifetime turn | thread 設定非持久性網站存取核准的有效期:turn 限於當前 turn,thread 持續到當前 thread 結束。persistent_approval 單獨控制是否提供 Always allow(始終允許)。產品預設值為 thread。
browser_use.default_origin_policy.auto_review allow | deny 使用 deny 可對採用預設策略的來源跳過自動審查,改為請求使用者核准。allow 在其他設定允許時保留自動審查。
browser_use.default_origin_policy.downloads allow | deny 使用 deny 可阻止 Browser Use 從採用預設策略的來源下載。allow 僅允許繼續正常的核准和策略檢查。
browser_use.default_origin_policy.full_cdp_access allow | deny 使用 deny 可阻止對採用預設策略的來源進行完整 Chrome DevTools Protocol(CDP)存取。allow 僅允許繼續正常的主動啟用和核准檢查。
browser_use.default_origin_policy.persistent_approval boolean 設為 false 可阻止 Browser Use 儲存或採用針對使用預設策略的來源的 Always allow(始終允許)核准。當前 turn 或 thread 的核准仍可生效。true 在其他條件允許時提供 Always allow 選項,但不會建立核准。
browser_use.default_origin_policy.uploads allow | deny 使用 deny 可阻止 Browser Use 向採用預設策略的來源上傳。allow 僅允許繼續正常的核准和策略檢查。
browser_use.disable_auto_review boolean 設為 true 可讓 Browser Use 跳過自動審查,改為請求使用者核准。設為 false 或省略時,只要其他設定允許,仍可使用自動審查。
browser_use.origins map<string, table> 針對特定來源的 Browser Use 策略。鍵採用 &lt;scheme&gt;://&lt;host-pattern&gt;[:&lt;port&gt;] 格式,協議為 http 或 https。可使用精確主機、僅匹配子網域的 *.example.com,或匹配根網域及其子網域的 **.example.com。其他 * 萬用字元可以跨越點號,因此 region*.example.com 也匹配 region.api.example.com;主機 * 匹配該協議的所有主機。協議和非預設埠參與匹配;顯式預設埠會被規範化移除。路徑、查詢參數、嵌入的使用者名稱或密碼,以及萬用字元協議或埠均無效。在 TOML 中用引號包裹模式,例如 [browser_use.origins."https://**.example.com"]。
browser_use.origins.<pattern> table 匹配此模式的來源的策略。多個模式匹配時,Codex 對每項能力採用最嚴格的值:deny 優先於 allow、false 優先於 true、turn 優先於 thread。
browser_use.origins.<pattern>.access allow | deny 使用 deny 可阻止 Browser Use 存取匹配的來源。拒絕存取也會阻止該來源上的上傳、下載、完整瀏覽器除錯存取和自動審查。allow 僅允許繼續正常的核准和策略檢查。
browser_use.origins.<pattern>.access_approval_lifetime turn | thread 設定針對匹配來源的非持久性網站存取核准的有效期:turn 限於當前 turn,thread 持續到當前 thread 結束。persistent_approval 單獨控制是否提供 Always allow(始終允許)。
browser_use.origins.<pattern>.auto_review allow | deny 使用 deny 可對匹配的來源跳過自動審查,改為請求使用者核准。allow 在其他設定允許時保留自動審查。
browser_use.origins.<pattern>.downloads allow | deny 使用 deny 可阻止 Browser Use 從匹配的來源下載。allow 僅允許繼續正常的核准和策略檢查。
browser_use.origins.<pattern>.full_cdp_access allow | deny 使用 deny 可阻止對匹配的來源進行完整 Chrome DevTools Protocol(CDP)存取。allow 僅允許繼續正常的主動啟用和核准檢查。
browser_use.origins.<pattern>.persistent_approval boolean 設為 false 可阻止 Browser Use 儲存或採用針對匹配來源的 Always allow(始終允許)核准。當前 turn 或 thread 的核准仍可生效。true 在其他條件允許時提供 Always allow 選項,但不會建立核准。
browser_use.origins.<pattern>.uploads allow | deny 使用 deny 可阻止 Browser Use 向匹配的來源上傳。allow 僅允許繼續正常的核准和策略檢查。
chatgpt_base_url string 在認證和取得雲端策略前強制指定 ChatGPT 服務基礎 URL。此項不會設定所有 Codex 網路目標。透過本機系統要求檔案或 macOS MDM 設定;雲端管理值會被忽略。
check_for_update_on_startup boolean 強制指定 Codex 是否在啟動時檢查更新。
cli_auth_credentials_store file | keyring | auto | ephemeral 在載入認證前強制指定 CLI 憑證儲存方式。file 使用 CODEX_HOME/auth.json;keyring 要求使用作業系統憑證儲存;auto 在憑證儲存不可用時回退到檔案;ephemeral 在當前程序記憶體中儲存憑證。透過本機系統要求檔案或 macOS MDM 設定;雲端管理值會被忽略。
computer_use table 智能體在原生桌面應用程式中工作的受管理要求。受管理應用規則和 config.toml 應用規則都會實施;應用必須得到每個策略來源的允許。
computer_use.allow_locked_computer_use boolean 設為 false 可阻止使用者在受管理的 macOS 裝置上啟用 Locked Use。此要求會移除啟用控制項;如果 Locked Use 已啟用,不會將其關閉。省略時按產品的一般可用性規則提供。
computer_use.allow_persistent_approval boolean 設為 false 可移除跨會話儲存應用核准的選項。當前會話的核准仍可用。設為 true 或省略此項,不會核准某個應用。
computer_use.default_app_access allow | deny 不匹配平台專用規則的原生應用的預設存取策略。deny 阻止存取。allow 僅允許繼續正常的核准和策略檢查。產品預設值為 allow。
computer_use.macos table macOS 的 Computer Use 應用規則。
computer_use.macos.bundle_ids map<string, allow | deny> 將精確的 macOS bundle identifier 對映為 allow 或 deny。匹配規則會替換同一策略來源中的 computer_use.default_app_access。受管理要求或使用者設定任一來源的拒絕規則仍會阻止存取。
computer_use.macos.bundle_ids.<bundle-id> allow | deny 使用 deny 可阻止存取此精確 bundle identifier。allow 僅覆蓋此策略來源的預設值;其他策略來源和正常核准流程仍須允許該應用。
computer_use.windows table Windows 打包和未打包應用的 Computer Use 應用規則。
computer_use.windows.aumids map<string, allow | deny> 將已簽名打包應用的精確已註冊 Application User Model ID(AUMID)對映為 allow 或 deny。匹配規則會替換同一策略來源中的 computer_use.default_app_access。
computer_use.windows.aumids.<aumid> allow | deny 使用 deny 可阻止存取此精確打包應用識別。allow 僅覆蓋此策略來源的預設值;其他策略來源和正常核准流程仍須允許該應用。
computer_use.windows.exes array<table> 已簽名、未打包的 Windows 執行檔規則。規則匹配執行檔經驗證的發布者及已簽名的版本資訊,而不是路徑或當前檔名。匹配的拒絕規則優先於匹配的允許規則。未簽名的執行檔使用 computer_use.default_app_access;無法明確驗證簽名身分的執行檔會被阻止。
computer_use.windows.exes[].access allow | deny 必填。匹配執行檔的存取決定。deny 阻止存取。allow 僅覆蓋此策略來源的預設值;其他策略來源和正常核准流程仍須允許該應用。
computer_use.windows.exes[].binary_name string 可選。執行檔已簽名版本資訊中的 OriginalFilename。匹配不區分大小寫。如果匹配發布者和產品的規則要求此值,而執行檔未提供,Computer Use 會阻止該執行檔。
computer_use.windows.exes[].product_name string 必填。執行檔已簽名版本資訊中的精確 ProductName。
computer_use.windows.exes[].publisher_name string 必填。執行檔可信簽名憑證中的精確發布者名稱,格式為 Windows X.500 distinguished name。
default_permissions string 受管理的預設權限設定檔。該設定檔必須在 allowed_permission_profiles 中被允許。請顯式設定,以獲得可預測的行為;省略時,預設設定檔只會是 :workspace,且前提是 :workspace 和 :read-only 都被顯式允許。
enforce_residency string 要求 Codex 服務流量使用受支援的資料駐留區域。目前接受 us。
experimental_network table 沙箱本機命令的管理員管理網路要求,透過 requirements.toml 實施。啟用後,這些要求可在未啟用 features.network_proxy 時啟動命令網路代理。瀏覽器工具會另行檢查受管理的網路拒絕規則和排他性允許列表。這些要求不會將瀏覽器流量送入代理,也不控制網頁搜尋、應用、MCP server、原生應用流量或其他特定能力的流量。在支援的受管理 Codex Cloud 路徑中,這些要求與獨立的 Cloud 環境網際網路設定共同約束命令網路。在策略允許時,獲批的完全沙箱權限提升可繞過命令代理。Work Cloud 不繼承這些要求。
experimental_network.allow_local_binding boolean 允許透過沙箱網路存取更廣泛的本機或私有網路。在支援的 Codex Cloud 代理路徑中,即使網域被允許,顯式 false 也可阻止上游代理存取。僅當沒有適用的要求、所選網路設定檔或代理功能設定提供值時,預設值才為 true。繼承的 false 仍是顯式值。受支援的、更高優先順序的 Cloud 覆蓋值可以修改它,而不擴大 Local 的 Global 設定或新增網域 Allow 條目。須核實執行器是否支援。不要將此 Cloud 預設值用於 Local。
experimental_network.allow_upstream_proxy boolean 允許沙箱網路串聯環境中指定的上游代理。
experimental_network.allowed_domains array<string> 受管理網路代理啟用時,沙箱命令網路的管理員允許規則。這些規則不適用於網頁搜尋、應用或 MCP server。不得與 experimental_network.domains 合用。
experimental_network.dangerously_allow_all_unix_sockets boolean 允許任意 Unix socket 目標,而不使用僅限允許列表的存取方式。僅在嚴格受控的環境中使用。
experimental_network.dangerously_allow_non_loopback_proxy boolean 允許 [experimental_network] 要求使用非迴環監聽地址。啟用後可能將監聽器暴露到 localhost 之外。
experimental_network.denied_domains array<string> 採用列表形式的管理員沙箱網路拒絕規則。不得與 experimental_network.domains 合用。
experimental_network.domains map<string, allow | deny> 採用對映形式的管理員沙箱網路網域策略。支援精確主機、僅匹配子網域的 *.example.com、同時匹配根網域及子網域的 **.example.com 和全域 * 允許規則。優先使用範圍明確的規則,因為 * 會廣泛開放外部存取。同一策略中,Environment 規則可替換同名 Global 網域鍵。更高優先順序值替換同名鍵,其他繼承的鍵保留。組合後,其他匹配的 deny(包括繼承的萬用字元)仍會阻止請求。空的環境對映不會清除 Global 規則。須核實執行器是否支援。不得與 experimental_network.allowed_domains 或 experimental_network.denied_domains 合用。
experimental_network.domains.<pattern> allow | deny 允許或拒絕存取匹配網域模式的沙箱網路。多個模式匹配時,拒絕規則優先。
experimental_network.enabled boolean 啟用沙箱網路要求。當前沙箱關閉命令網路時,此項不會授予網路存取權限。
experimental_network.http_port integer [experimental_network] 要求使用的迴環 HTTP 監聽埠。
experimental_network.managed_allowed_domains_only boolean 網路要求已啟用且此項為 true 時,普通使用者設定及逐網域核准無法擴大受管理代理的允許列表。若沒有有效的已設定或繼承 Allow 條目,普通受管理命令沒有任何允許的存取目標。只有拒絕規則的策略不會放行其餘網際網路。此項不覆蓋所有工具,也不覆蓋已獲批的完全沙箱權限提升。
experimental_network.socks_port integer [experimental_network] 要求使用的迴環 SOCKS5 監聽埠。
experimental_network.unix_sockets map<string, allow | deny> macOS 上管理員管理的沙箱網路 Unix socket 允許列表。路徑必須為絕對路徑。
experimental_network.unix_sockets.<path> allow | deny 在 macOS 上,allow 將 Unix socket 絕對路徑加入允許列表;deny 不將其加入。啟用允許所有 Unix socket 時,deny 條目無法阻止某個 socket。
features table 固定的功能值。執行時功能使用 config.toml 中的規範名稱;此處也支援文件列出的應用專用要求鍵。
features.<name> boolean 要求文件列出的某項執行時或應用功能保持啟用或停用。
features.apps boolean 為受管理使用者固定應用整合的可用性,強制開啟或關閉。
features.browser_use boolean 設為 false(在 requirements.toml 中),可停用智能體驅動的 Browser Use。
features.browser_use_external boolean 設為 false(在 requirements.toml 中),可阻止 Codex 透過 ChatGPT 瀏覽器擴充功能操作支援的瀏覽器,包括已有分頁和已登入會話。
features.browser_use_full_cdp_access boolean 設為 false(在 requirements.toml 中),可停用本機執行時的完整 Chrome DevTools Protocol 存取,包括 Browser Developer 模式,並阻止 ChatGPT 桌面應用程式啟用對應設定。省略時按產品的一般可用性規則提供。
features.computer_use boolean 設為 false(在 requirements.toml 中),可停用 Computer Use、Record & Replay 及相關安裝或啟用流程。
features.fast_mode boolean 為受管理使用者固定規範的 fast_mode 功能,強制開啟或關閉。
features.guardian_approval boolean 為受管理使用者固定 Guardian 核准的可用性,強制開啟或關閉。
features.in_app_browser boolean 設為 false(在 requirements.toml 中),可停用使用者直接開啟和操作的內建瀏覽器面板。
features.in_app_chat boolean 設為 false 可在 ChatGPT 桌面應用程式中隱藏 ChatGPT 和 ChatGPT Work 會話介面及相關雲端自動化介面。此設定不會阻止 ChatGPT Voice,也不會停止已有雲端任務。設為 true 不會繞過帳戶、工作區權限或功能逐步開放檢查。
features.in_app_dictation boolean 設為 false 可停用桌面應用程式內的語音轉寫。設為 true 不會繞過其他可用性檢查。
features.in_app_local_automation boolean 設為 false 可停用桌面應用程式中的本機定時任務。設為 true 不會繞過其他可用性檢查。
features.in_app_updates boolean 設為 false(在 requirements.toml 中),可停用應用內更新。省略此要求時,預設仍啟用更新。
features.memories boolean 為受管理使用者固定記憶功能的可用性,強制開啟或關閉。
features.multi_agent boolean 為受管理使用者固定多智能體功能的可用性,強制開啟或關閉。
features.plugin_sharing boolean 設為 false(在雲端管理的 requirements.toml 中),可停用本機建置 plugin 的工作區共享。
features.plugins boolean 為受管理使用者固定 plugin 的可用性,強制開啟或關閉。
features.realtime_conversation boolean 設為 false 可停用 Codex CLI 中實驗性的 /voice 命令。不要依賴此設定來阻止桌面應用程式中的 ChatGPT Voice 或 app-server 語音會話。設為 true 不會繞過客戶端或功能逐步開放檢查。
features.remote_plugin boolean 為受管理使用者固定遠端 plugin 目錄的可用性,強制開啟或關閉。
features.workspace_dependencies boolean 為受管理使用者固定隨附的工作區依賴執行時的可用性,強制開啟或關閉。
feedback table 受管理的回饋設定。
feedback.enabled boolean 強制指定使用者是否可透過 Codex 客戶端提交回饋。
guardian_extra_policy string 用於自動審查的附加受管理 Markdown 策略,與主策略一並提供。優先於本機 [auto_review].extra_policy。空白值會被忽略。
guardian_policy_config string 用於自動審查的受管理 Markdown 策略指令。優先於本機 [auto_review].policy。空白值會被忽略。
hooks table 管理員強制實施的受管理生命週期鉤子。要求提供受管理鉤子目錄,並使用與內聯 [hooks] 相同的事件 schema,該內聯設定位於 config.toml。
hooks.<Event> array<table> 鉤子事件的匹配器分組,例如 PreToolUse、PermissionRequest、PostToolUse、PreCompact、PostCompact、SessionStart、SessionEnd、SubagentStart、SubagentStop、UserPromptSubmit 或 Stop。
hooks.<Event>[].hooks array<table> 匹配器分組的鉤子處理器。支援 command 和 MCP tool 鉤子;prompt 和 agent 鉤子會被解析,但跳過執行。
hooks.<Event>[].hooks[].additionalContextLimit integer 每個處理器的近似 token 門檻,用於將過大的 additionalContext 儲存到磁碟,並向模型提供較短預覽。預設值為 2500;0 將完整上下文直接傳給模型。參見 大體積鉤子輸出。
hooks.<Event>[].hooks[].async boolean 在背景執行 command 鉤子,不延遲觸發它的操作。預設值為 false;SessionEnd 始終同步執行。參見 在背景執行鉤子。
hooks.<Event>[].hooks[].commandWindows string command 鉤子的 Windows 專用命令覆蓋值。也支援 TOML 別名 command_windows。
hooks.managed_dir string (absolute path) macOS 和 Linux 上存放受管理鉤子指令碼的目錄。Codex 在載入受管理鉤子前,驗證其為絕對路徑且確實存在。
hooks.windows_managed_dir string (absolute path) Windows 上存放受管理鉤子指令碼的目錄。Codex 在載入受管理鉤子前,驗證其為絕對路徑且確實存在。
in_app_browser table 內建瀏覽器面板的要求。這些設定不控制智能體驅動的 Browser Use。
in_app_browser.allow_external_browser_settings_import boolean 設為 false 可阻止使用者將外部瀏覽器的設定或瀏覽資料匯入內建瀏覽器。設為 true 或省略時,只要其他產品檢查允許,匯入功能仍可用。此設定僅限受管理設定,不可透過 config.toml 覆蓋。
log_dir string (path) 強制指定 Codex 寫入本機日誌檔案的目錄。
marketplaces table plugin 市場來源的管理員要求。restrict_to_allowed_sources 為 true 時,這些規則生效。
marketplaces.allowed_sources table 以管理員選定規則名為鍵的允許市場來源。不同名稱的條目會累積;同一名稱的欄位按常規設定層優先順序處理。
marketplaces.allowed_sources.<name> table 一條允許的來源規則。要求合併後,最終的 source 值決定 Codex 解釋哪些關聯欄位。
marketplaces.allowed_sources.<name>.host_pattern string source = "host_pattern" 時必填的正規表示式。Codex 用它匹配從 HTTPS、SSH 或 SCP 形式 Git 源解析出的轉小寫主機名。使用 ^ 和 $ 要求匹配整個主機名。
marketplaces.allowed_sources.<name>.path string (absolute path) source = "local" 時必填的本機市場目錄。Codex 要求提供絕對路徑,並在規範化後比較路徑。
marketplaces.allowed_sources.<name>.ref string git 規則的可選精確 Git ref。省略時,此規則允許匹配儲存庫的任意 ref。
marketplaces.allowed_sources.<name>.source git | host_pattern | local 市場來源匹配器類型。單一儲存庫使用 git;按正規表示式匹配 Git 主機使用 host_pattern;本機目錄使用 local。
marketplaces.allowed_sources.<name>.url string source = "git" 時必填的 Git 儲存庫 URL。Codex 會規範化已設定和允許的 URL,再要求精確匹配。
marketplaces.restrict_to_allowed_sources boolean 為 true 時,要求執行 marketplace add、plugin install、refresh 及執行時載入所使用的已設定市場來源與 allowed_sources 匹配。OpenAI 精選 Git 目錄(包括 API key 目錄)也必須匹配允許列表。隨附 plugin 和遠端安裝的工作區 plugin 獨立於此精選 Git 來源策略。
mcp_servers table 可以啟用的 MCP server 允許列表。MCP server 的名稱(&lt;id&gt;)及身分都必須與條目匹配。不在允許列表中或身分不匹配的已設定 MCP server 會被停用。
mcp_servers.<id>.identity table 單一 MCP server 的身分規則。設定 command(stdio)或 url(streamable HTTP)中的一項。
mcp_servers.<id>.identity.command string | table 透過精確命令字串允許 MCP stdio server,或使用匹配器表要求精確執行檔及有序參數匹配器。字串形式不檢查參數、cwd、env 或 env_vars。
mcp_servers.<id>.identity.command.args array<table> stdio server 的有序參數匹配器。已設定參數列表長度必須相同,且每個位置都匹配。命令匹配器不檢查 cwd、env 或 env_vars。
mcp_servers.<id>.identity.command.args[].expression string regex 參數匹配器使用的正規表示式。表示式必須有效,且匹配完整參數值。
mcp_servers.<id>.identity.command.args[].match exact | prefix | regex 此參數位置的匹配操作。
mcp_servers.<id>.identity.command.args[].value string exact 或 prefix 參數匹配器使用的值。
mcp_servers.<id>.identity.command.executable string stdio server 設定的 command 必須精確匹配的執行檔。
mcp_servers.<id>.identity.url string | table 透過精確 URL 字串允許 MCP streamable HTTP server,或使用 exact、prefix、regex 值匹配器表。
mcp_servers.<id>.identity.url.expression string regex URL 匹配器使用的正規表示式。表示式必須有效,且匹配完整 URL 值。
mcp_servers.<id>.identity.url.match exact | prefix | regex 已設定 MCP server URL 的匹配操作。
mcp_servers.<id>.identity.url.value string exact 或 prefix URL 匹配器使用的值。
model_catalog_json string (path) 強制指定 Codex 啟動時使用的 JSON 模型目錄。
model_provider string 強制指定模型供應商 ID,覆蓋本機和會話設定。
model_providers map<string, table> 受管理的模型供應商定義。每個條目會整體替換同 ID 的已設定供應商,不與使用者定義逐欄位合併。其他 ID 的供應商仍可用。
model_providers.<id> table 完整的受管理供應商定義。使用與 config.toml 相同的欄位,包括 name、base_url、認證和傳輸設定。
models table 包含 [models.new_thread] 表。
models.new_thread table 新本機 thread 啟動時應用的可選預設值。優先於使用者和專案預設值,但仍可被顯式覆蓋值替代。
models.new_thread.model string 新 thread 的預設模型。顯式覆蓋模型或推理強度中的任意一項時,這兩個欄位都會被忽略。
models.new_thread.model_reasoning_effort string 新 thread 的預設推理強度。顯式覆蓋模型或推理強度中的任意一項時,這兩個欄位都會被忽略。
models.new_thread.service_tier string 新 thread 的預設服務層級。顯式覆蓋服務層級時,此欄位會被忽略。
permissions table 以設定檔名稱為鍵的管理員定義權限設定檔。欄位與 config.toml 相同。
permissions.<name> table 管理員定義的權限設定檔。名稱不能以 : 開頭,不能使用保留名稱 filesystem,也不能與已載入設定中的設定檔重名。欄位與 config.toml 相同;完整 schema 請參閱權限指南。
permissions.filesystem.deny_read array<string> 管理員強制實施的檔案系統讀取拒絕規則。條目可以是路徑或 glob 模式,使用者不能透過本機設定放寬。
plugins table 以 plugin 識別符為鍵的 plugin 專用 MCP server 允許列表。此表存在時,若 plugin 隨附的 server 沒有匹配的 plugin 及 server 條目,就會被停用。
plugins.<plugin>.mcp_servers table 某個 plugin 隨附的 MCP server 的允許列表。plugin server 要求使用與頂層 mcp_servers 要求相同的精確身分和匹配器形式。
plugins.<plugin>.mcp_servers.<server>.identity table 單一 plugin 隨附 MCP server 的身分規則。設定 command(stdio)或 url(streamable HTTP)中的一項。
plugins.<plugin>.mcp_servers.<server>.identity.command string | table 透過精確命令字串允許 plugin 的 stdio MCP server,或使用匹配器表要求精確執行檔及有序參數匹配器。
plugins.<plugin>.mcp_servers.<server>.identity.command.args array<table> plugin 隨附 stdio server 的有序參數匹配器。已設定參數列表長度必須相同,且每個位置都匹配。
plugins.<plugin>.mcp_servers.<server>.identity.command.args[].expression string regex 參數匹配器使用的正規表示式。表示式必須匹配完整參數值。
plugins.<plugin>.mcp_servers.<server>.identity.command.args[].match exact | prefix | regex 此參數位置的匹配操作。
plugins.<plugin>.mcp_servers.<server>.identity.command.args[].value string exact 或 prefix 參數匹配器使用的值。
plugins.<plugin>.mcp_servers.<server>.identity.command.executable string plugin 隨附 stdio server 設定的 command 必須精確匹配的執行檔。
plugins.<plugin>.mcp_servers.<server>.identity.url string | table 透過精確 URL 字串允許 plugin 的 streamable HTTP MCP server,或使用 exact、prefix、regex 值匹配器表。
plugins.<plugin>.mcp_servers.<server>.identity.url.expression string regex URL 匹配器使用的正規表示式。表示式必須匹配完整 URL 值。
plugins.<plugin>.mcp_servers.<server>.identity.url.match exact | prefix | regex plugin 隨附 MCP server URL 的匹配操作。
plugins.<plugin>.mcp_servers.<server>.identity.url.value string exact 或 prefix URL 匹配器使用的值。
remote_sandbox_config array<table> 主機專用沙箱要求。第一個 hostname_patterns 匹配解析後主機名的條目會覆蓋該要求來源的頂層 allowed_sandbox_modes。主機專用條目目前僅覆蓋沙箱模式。
remote_sandbox_config[].allowed_sandbox_modes array<string> 此主機專用條目匹配時應用的允許沙箱模式。
remote_sandbox_config[].hostname_patterns array<string> 不區分大小寫的主機名模式。支援用 * 匹配任意字元序列、用 ? 匹配單一字元。
rules table 與 .rules 檔案合併的管理員強制命令規則。要求中的規則必須具有限制性。
rules.prefix_rules array<table> 強制實施的前綴規則列表。每條規則必須包含 pattern 和 decision。
rules.prefix_rules[].decision prompt | forbidden 必填。要求中的規則只能提示或禁止,不能允許。
rules.prefix_rules[].justification string 核准提示或拒絕訊息中顯示的可選非空理由。
rules.prefix_rules[].pattern array<table> 以模式 token 表達的命令前綴。每個 token 設定 token 或 any_of 中的一項。
rules.prefix_rules[].pattern[].any_of array<string> 此位置允許的備選 token 列表。
rules.prefix_rules[].pattern[].token string 此位置的單一字面 token。
sqlite_home string (path) 強制指定 Codex 儲存基於 SQLite 的執行時狀態的目錄。
windows table Windows 原生沙箱要求。
windows.allowed_sandbox_implementations array<string> 允許的舊版 Windows 原生沙箱實現(elevated 和 unelevated)。列表不得為空。兩者均被允許且未選擇模式時,Codex 優先使用 elevated。此列表不限制可用時的 mxc 沙箱。