本頁提供可搜尋的 Codex 設定檔參考資料。如需概念說明和範例,請先參閱基本設定和進階設定。
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 會忽略這些設定;請改將提供者、通知和遙測
設定鍵放在使用者層級組態中。設定檔與
config.toml 存放於同一目錄,路徑為 $CODEX_HOME/profile-name.config.toml;請使用
--profile profile-name 選取。
如需瞭解沙盒與核准設定鍵(approval_policy、sandbox_mode 和 sandbox_workspace_write.*),請搭配本參考資料閱讀沙盒與核准、可寫入根目錄中的受保護路徑及網路存取。如需瞭解 Beta 版權限設定檔,請參閱權限。
Codex 和 ChatGPT Work 已不再支援 approval_policy = "untrusted"。
請移除此設定,或選擇支援的政策。使用者層級 ~/.codex/config.toml 中
設有 trust_level = "untrusted" 的專案項目仍受支援。如需範例及核准方式的取捨說明,請參閱
從已停用的 untrusted 核准政策遷移
。
| Key | Type / Values | Details |
|---|---|---|
agents | table | 多智慧體設定與自訂角色宣告。純量設定名稱為保留名稱,不能用作自訂角色名稱。 |
agents.<name>.config_file | string (path) | 該角色的 TOML 組態層路徑;相對路徑以宣告該角色的設定檔所在目錄為基準解析。 |
agents.<name>.description | string | Codex 選擇並建立該類型智慧體時會看到的角色指引。 |
agents.default_subagent_model | string | 所建立智慧體的預設模型。建立時明確指定的模型優先適用。 |
agents.default_subagent_reasoning_effort | string | 所建立智慧體的預設推理強度。建立時明確指定的推理強度優先適用。 |
agents.enabled | boolean | 啟用或停用多智慧體工具(預設:true)。 |
agents.interrupt_message | boolean | 智慧體回合中斷時,記錄一則模型可見的訊息(預設:true)。 |
agents.max_concurrent_threads_per_session | number | 所建立的智慧體對話串可同時開啟的數量上限,不含主要對話串。未設定時,由 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 資訊請求提示,而非自動拒絕。 |
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 時,允許顯示技能指令碼的核准提示。 |
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.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.macos.bundle_ids | map<string, allow | deny> | 以套件識別碼為索引鍵的原生 macOS 應用程式存取設定。 |
computer_use.windows.always_allowed_app_ids | array<string> | 電腦功能無須提示即可開啟的 Windows 應用程式識別碼。清單以外的應用程式需要核准;可從 ChatGPT 桌面版應用程式的電腦設定中移除已儲存的項目。 |
computer_use.windows.aumids | map<string, allow | deny> | 以應用程式使用者模型 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.<name>] 資料表。請勿與 sandbox_mode 或 [sandbox_workspace_write] 同時使用。 |
desktop.custom_file_handlers.<id> | table | 僅適用於使用者層級。為 ChatGPT 桌面版應用程式定義額外的以此開啟目標。如需範例與處理常式 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 | 顯示在以此開啟選單中的名稱。必填。 |
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 | 啟用統一執行功能的舊版名稱;建議使用 [features].unified_exec 或 codex --enable unified_exec。 |
features.apps | boolean | 啟用應用程式(連接器)整合(穩定功能;預設開啟)。應用程式與連接器的流量不受沙盒指令的網路代理伺服器或其網域允許清單控制。 |
features.code_mode.direct_only_tool_namespaces | array<string> | 程式碼模式只能透過直接工具呼叫使用的工具命名空間。 |
features.code_mode.enabled | boolean | 啟用程式碼模式的功能組態。此功能仍在開發中,預設關閉。 |
features.code_mode.excluded_tool_namespaces | array<string> | 程式碼模式要從巢狀程式碼模式的工具指引及執行器可用工具中排除的工具命名空間。 |
features.context_management.experimental_mode | boolean | 啟用實驗性上下文管理(預設關閉)。此功能透過筆記與可搜尋的歷史紀錄保留累積的細節,而非反覆將上下文壓縮成單一摘要。必須使用 Plus、Pro 或 Pro Lite 方案登入 ChatGPT。 |
features.enable_request_compression | boolean | 支援時,使用 zstd 壓縮串流請求本文(穩定功能;預設啟用)。 |
features.fast_mode | boolean | 在 TUI 中啟用模型目錄的服務層級選擇功能;若目前使用的模型宣告支援快速層級指令,也會一併啟用(穩定功能;預設啟用)。 |
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 通訊端目的地,而不限於允許清單。預設為 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 通訊端政策。預設未設定;請為允許的通訊端新增 allow 項目。 |
features.personality | boolean | 啟用個性選擇控制項(穩定功能;預設啟用)。 |
features.prevent_idle_sleep | boolean | 回合正在執行時,防止電腦進入睡眠(實驗性功能;預設停用)。 |
features.remote_plugin | boolean | 啟用遠端外掛程式目錄(穩定功能;預設啟用)。 |
features.rollout_budget.enabled | boolean | 啟用執行歷程預算追蹤。此功能仍在開發中,預設關閉。啟用時必須設定 features.rollout_budget.limit_tokens。 |
features.rollout_budget.limit_tokens | integer | 執行歷程預算追蹤的 Token 上限,必須為正數。啟用執行歷程預算時必須設定。 |
features.rollout_budget.prefill_token_weight | number | 計算執行歷程預算時,套用於預填 Token 的有限非負乘數。預設為 1.0。 |
features.rollout_budget.reminder_interval_tokens | integer | 執行歷程預算提醒之間的 Token 間隔,必須為正數。預設為 limit_tokens 的 10%,最少為 1 個 Token。 |
features.rollout_budget.sampling_token_weight | number | 計算執行歷程預算時,套用於取樣 Token 的有限非負乘數。預設為 1.0。 |
features.shell_snapshot | boolean | 建立 shell 環境快照,以加快重複執行指令的速度(穩定功能;預設啟用)。 |
features.shell_tool | boolean | 啟用預設的 shell 工具以執行指令(穩定功能;預設啟用)。 |
features.skill_mcp_dependency_install | boolean | 允許顯示提示並安裝技能缺少的 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 配置(預設值: 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 相同的事件結構描述;範例與支援的事件請參閱掛勾指南。 |
hooks.<Event> | array<table> | 掛勾事件的比對器群組,例如 PreToolUse、PermissionRequest、PostToolUse、PreCompact、PostCompact、SessionStart、SessionEnd、SubagentStart、SubagentStop、UserPromptSubmit、Stop 或 Interrupt。 |
hooks.<Event>[].hooks | array<table> | 比對器群組的掛勾處理常式。支援指令與 MCP 工具掛勾;提示詞與智慧體掛勾處理常式則會解析,但略過執行。 |
hooks.<Event>[].hooks[].additionalContextLimit | integer | 每個處理常式的近似 Token 門檻;超過門檻時,會將過大的 additionalContext 儲存至磁碟,並向模型提供較短的預覽。預設為 2500;設為 0 會將完整上下文直接傳給模型。請參閱大型掛勾輸出。 |
hooks.<Event>[].hooks[].async | boolean | |
hooks.<Event>[].hooks[].commandWindows | string | 僅適用於 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 | 已設定之外掛程式市集的來源類型。可在系統、雲端管理、使用者或受信任專案的 config.toml 中定義市集。 |
marketplaces.<name>.sparse_paths | array<string> | Git 市集的選用稀疏簽出路徑。請包含市集目錄清單,以及其中參照的所有本機外掛程式目錄。 |
mcp_oauth_callback_port | integer | 選用的全域固定連接埠,供 MCP OAuth 登入時的本機 HTTP 回呼伺服器使用。伺服器專屬的 oauth.callback_port 優先。如果兩者皆未設定,Codex 會繫結至作業系統選定的臨時連接埠。 |
mcp_oauth_callback_url | string | 選用的 MCP OAuth 登入基底回呼 URL,例如 devbox 的入口 URL。當授權伺服器支援簽發者識別時,新加入的預先註冊用戶端會直接使用此 URL,不做變更;未儲存回呼的現有用戶端則會附加伺服器專屬的回呼 ID。若不支援簽發者識別,任何已預先註冊的 MCP 伺服器只要其設定的回呼缺少必要 ID,就會改用此 URL 並附加該 ID。回呼 URL 中的連接埠不會決定監聽連接埠。 |
mcp_oauth_credentials_store | auto | file | keyring | MCP OAuth 憑證的偏好儲存位置。 |
mcp_optional_startup_grace_ms | integer (milliseconds) | 建立初始工具目錄時,非必要 MCP 伺服器共用的等待時間。預設為 1000。設為 0 則改為依各伺服器的 startup_timeout_sec 等待。 |
mcp_servers.<id>.args | array<string> | 傳給 MCP stdio 伺服器指令的引數。 |
mcp_servers.<id>.auth | oauth | chatgpt | MCP HTTP 伺服器的備援身分驗證方式,優先順序低於已設定的 bearer Token 與授權標頭。 oauth(預設)會在有已儲存的 MCP OAuth 憑證時使用該憑證。chatgpt 會針對受信任的第一方 ChatGPT 來源使用目前的 ChatGPT 工作階段,再以已儲存的 OAuth 憑證作為備援。若所有憑證來源都無法提供憑證,兩種模式都可以在未經身分驗證的情況下連線。 |
mcp_servers.<id>.bearer_token_env_var | string | 提供 MCP HTTP 伺服器 bearer Token 的環境變數。 |
mcp_servers.<id>.command | string | MCP stdio 伺服器的啟動指令。 |
mcp_servers.<id>.cwd | string | MCP stdio 伺服器程序的工作目錄。 |
mcp_servers.<id>.default_tools_approval_mode | auto | prompt | writes | approve | 此伺服器上 MCP 工具的預設核准行為,個別工具的覆寫設定優先適用。 |
mcp_servers.<id>.disabled_tools | array<string> | 在 MCP 伺服器的 enabled_tools 之後套用的拒絕清單。 |
mcp_servers.<id>.enabled | boolean | 停用 MCP 伺服器,但保留其組態。 |
mcp_servers.<id>.enabled_tools | array<string> | 允許 MCP 伺服器提供的工具名稱清單。 |
mcp_servers.<id>.env | map<string,string> | 轉送至 MCP stdio 伺服器的環境變數。 |
mcp_servers.<id>.env_http_headers | map<string,string> | MCP HTTP 伺服器使用的 HTTP 標頭,其值由環境變數填入。 |
mcp_servers.<id>.env_vars | array<string | { name = string, source = "local" | "remote" }> | 要加入 MCP stdio 伺服器允許清單的其他環境變數。字串項目預設使用 source = "local";只有透過執行器運作的遠端 stdio 才能使用 source = "remote"。 |
mcp_servers.<id>.experimental_environment | local | remote | MCP 伺服器的實驗性執行位置設定。 remote 會透過遠端執行器環境啟動 stdio 伺服器;可串流 HTTP 的遠端執行位置尚未實作。 |
mcp_servers.<id>.http_headers | map<string,string> | 每個 MCP HTTP 請求都會包含的靜態 HTTP 標頭。 |
mcp_servers.<id>.http_headers_helper | string (command) | 輸出包含 HTTP 標頭名稱與值之 JSON 物件的本機指令。僅支援從本機連線的 HTTP MCP 伺服器。明確設定的 bearer Token 與 OAuth 憑證優先於輔助程式提供的 Authorization 標頭。 |
mcp_servers.<id>.oauth_resource | string | MCP 登入時可選擇加入的 RFC 8707 OAuth 資源參數。 |
mcp_servers.<id>.oauth.callback_port | integer | 此 MCP 伺服器的固定 OAuth 回呼監聽連接埠。覆寫 mcp_oauth_callback_port。若直接使用回送位址的回呼 URL 明確指定了連接埠,請將監聽連接埠設為相同值。 |
mcp_servers.<id>.oauth.callback_url | string | 伺服器專屬的 OAuth 回呼。若支援簽發者識別,或 URL 已以伺服器專屬的回呼 ID 結尾,預先註冊的用戶端就會沿用此回呼。否則,Codex 會使用全域或預設回呼,並在其後附加該 ID。沒有預先註冊 ID 的用戶端會在用戶端註冊期間使用此回呼。 |
mcp_servers.<id>.oauth.client_id | string | 預先註冊的 OAuth 用戶端 ID,用於向此 MCP 伺服器取得授權及交換 Token。 |
mcp_servers.<id>.required | boolean | 設為 true 時,如果此已啟用的 MCP 伺服器無法初始化,啟動或恢復作業就會失敗。 |
mcp_servers.<id>.scopes | array<string> | 向該 MCP 伺服器進行身分驗證時要請求的 OAuth 範圍。 |
mcp_servers.<id>.startup_timeout_ms | number | startup_timeout_sec 的別名,以毫秒為單位。 |
mcp_servers.<id>.startup_timeout_sec | number | 覆寫 MCP 伺服器預設的 10 秒啟動逾時時間。 |
mcp_servers.<id>.tool_timeout_sec | number | 覆寫 MCP 伺服器預設的每個工具 60 秒逾時時間。 |
mcp_servers.<id>.tools.<tool>.approval_mode | auto | prompt | writes | approve | 覆寫此伺服器上單一 MCP 工具的核准行為。 |
mcp_servers.<id>.tools.<tool>.output_token_limit | integer (positive) | 單一 MCP 工具輸出的 Token 預算,尚未加上標準的 20% 序列化額度。覆寫模型對該工具預設的輸出截斷預算。 |
mcp_servers.<id>.url | string | MCP 可串流 HTTP 伺服器的端點。 |
memories.consolidation_model | string | 可選的模型覆寫設定,用於全域記憶整合。 |
memories.disable_on_external_context | boolean | 設為 true 時,使用 MCP 工具呼叫、網頁搜尋或工具搜尋等外部上下文的對話串不會用於生成記憶。預設為 false。舊版別名:memories.no_memories_if_mcp_or_web_search。 |
memories.extract_model | string | 可選的模型覆寫設定,用於從各個對話串擷取記憶。 |
memories.generate_memories | boolean | 設為 false 時,新建立的對話串不會儲存為記憶生成的輸入。預設為 true。 |
memories.max_raw_memories_for_consolidation | number | 為全域整合保留的近期原始記憶數量上限。預設為 256,最高為 4096。 |
memories.max_rollout_age_days | number | 可納入記憶生成的對話串存續時間上限。預設為 30,數值會限制在 0-90 範圍內。 |
memories.max_rollouts_per_startup | number | 每次啟動處理作業可處理的候選執行紀錄數量上限。預設為 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 | 對話串須閒置至少多久,才會納入記憶生成的考量。預設為 6,數值會限制在 1-48 範圍內。 |
memories.use_memories | boolean | 設為 false 時,Codex 不會將現有記憶注入後續工作階段。預設為 true。 |
model | string | 要使用的模型(例如 gpt-5.6-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 金鑰的環境變數。 |
model_providers.<id>.env_key_instructions | string | 可選的供應商 API 金鑰設定指引。 |
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 | minimal | low | medium | high | xhigh | 調整支援此設定之模型的推理程度(僅限 Responses API; xhigh 是否可用取決於模型)。 |
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> | 以舊模型到新模型的對應關係記錄已確認的模型遷移。 |
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 指標匯出器(預設值: statsig)。 |
otel.trace_exporter | none | otlp-http | otlp-grpc | 選擇 OpenTelemetry 追蹤匯出器,並提供端點中繼資料。 |
otel.trace_exporter.<id>.endpoint | string | OTEL 日誌的追蹤匯出器端點。 |
otel.trace_exporter.<id>.headers | map<string,string> | OTEL 追蹤匯出器請求中包含的靜態標頭。 |
otel.trace_exporter.<id>.protocol | binary | json | OTLP/HTTP 追蹤匯出器使用的通訊協定。 |
otel.trace_exporter.<id>.tls.ca-certificate | string | OTEL 追蹤匯出器 TLS 使用的 CA 憑證路徑。 |
otel.trace_exporter.<id>.tls.client-certificate | string | OTEL 追蹤匯出器 TLS 使用的用戶端憑證路徑。 |
otel.trace_exporter.<id>.tls.client-private-key | string | OTEL 追蹤匯出器 TLS 使用的用戶端私密金鑰路徑。 |
permissions.<name>.description | string | 此具名設定檔的易讀說明。設定檔不會透過 extends 繼承父設定檔的說明。 |
permissions.<name>.extends | string | 選用的父設定檔,會在此具名設定檔之前套用。可設為另一個具名設定檔、 :read-only 或 :workspace;:danger-full-access、未定義的父設定檔及循環繼承皆不被接受。 |
permissions.<name>.filesystem | table | 具名的檔案系統權限設定檔。每個索引鍵都是絕對路徑或特殊 Token,例如 :minimal 或 :workspace_roots。 |
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 | 在沙盒啟動前會對符合項目建立快照的平台上,展開拒絕讀取 glob 模式的最大深度。若有設定,值必須至少為 1。 |
permissions.<name>.network.allow_local_binding | boolean | 允許透過沙盒網路更廣泛地存取本機或私人網路。即使此值維持 false,仍可透過精確的本機 IP 位址字面值或 localhost 允許規則,允許存取特定本機目標。 |
permissions.<name>.network.allow_upstream_proxy | boolean | 允許沙盒網路串接另一個上游代理伺服器。 |
permissions.<name>.network.dangerously_allow_all_unix_sockets | boolean | 允許任意 Unix 通訊端目的地,不再限於預設的受限集合。僅應在嚴格控管的環境中使用。 |
permissions.<name>.network.dangerously_allow_non_loopback_proxy | boolean | 允許沙盒網路監聽器繫結至非回送位址。啟用後,可能讓 localhost 以外的來源也能存取監聽器。 |
permissions.<name>.network.domains | table | 沙盒內指令的網域規則。只有在 features.network_proxy 或已啟用的管理員控管網路要求啟動代理伺服器時,才會強制執行。支援精確主機名稱、*.example.com、**.example.com 及全域 * 允許規則;deny 優先。不會限制網頁搜尋、應用程式或 MCP 伺服器。 |
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 通訊端允許清單。以通訊端路徑作為索引鍵; allow 會加入路徑,deny 則會拒絕該路徑。 |
permissions.<name>.network.unix_sockets.<path> | allow | deny | 使用 allow 將 Unix 通訊端的絕對路徑加入有效允許清單,或使用 deny 拒絕該路徑。被拒絕的項目不會納入有效允許清單。 |
permissions.<name>.workspace_roots | table | 設定檔定義的工作區根目錄,會與工作階段執行時的工作區根目錄一同套用 :workspace_roots 檔案系統規則。 |
permissions.<name>.workspace_roots.<path> | boolean | 設為 true 時,將路徑納入此設定檔的工作區根目錄集合。已停用的項目仍不會生效。 |
personality | none | friendly | pragmatic | 宣告支援 supportsPersonality 的模型所使用的預設溝通風格;可針對個別對話串/回合覆寫,或透過 /personality 覆寫。 |
plan_mode_reasoning_effort | none | minimal | low | medium | high | xhigh | 規劃模式專用的推理覆寫設定。未設定時,規劃模式會使用其內建預設值。 |
plugins.<plugin>.enabled | boolean | 使用 plugin-name@marketplace-name 鍵啟用或停用本機市集外掛程式。此設定會從合併後生效的組態讀取;受信任專案的設定可覆寫使用者、雲端管理及系統的預設值。即使外掛程式已停用,重新整理市集時仍可安裝或重新整理已設定的外掛程式。此設定不會覆寫由工作區管理的啟用狀態。 |
plugins.<plugin>.mcp_servers.<server>.default_tools_approval_mode | auto | prompt | writes | approve | 外掛程式提供的 MCP 伺服器上各工具的預設核准行為。 |
plugins.<plugin>.mcp_servers.<server>.disabled_tools | array<string> | 外掛程式提供的 MCP 伺服器在套用 enabled_tools 後套用的拒絕清單。 |
plugins.<plugin>.mcp_servers.<server>.enabled | boolean | 啟用或停用已安裝外掛程式內附的 MCP 伺服器,而不變更外掛程式資訊清單。 |
plugins.<plugin>.mcp_servers.<server>.enabled_tools | array<string> | 外掛程式提供的 MCP 伺服器所公開工具的允許清單。 |
plugins.<plugin>.mcp_servers.<server>.tools.<tool>.approval_mode | auto | prompt | writes | approve | 個別覆寫外掛程式提供的 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 | 新回合偏好的服務層級。請使用 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> | 標準的環境變數模式篩選器,不區分大小寫。納入項目會建立允許清單,且無法還原已排除的值。明確指定的 set 值會在排除作業之後套用。請勿在同一層中將篩選器與舊版 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> | 在排除作業之後注入的明確指定環境變數值;納入篩選器仍可移除這些值。 |
show_raw_agent_reasoning | boolean | 目前使用的模型輸出原始推理內容時,將其顯示出來。 |
skills.config | array<object> | 儲存在 config.toml 中、針對個別技能是否啟用的覆寫設定。 |
skills.config.<index>.enabled | boolean | 啟用或停用指定的技能。 |
skills.config.<index>.path | string (path) | 包含 SKILL.md 的技能資料夾路徑。 |
skills.max_context_tokens | integer (positive) | 可用技能目錄的 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> | 停用特定可探索連接器或外掛程式的建議。每個項目都使用 type = "connector" 或 "plugin",並包含 id。 |
tool_suggest.discoverables | array<table> | 允許工具建議其他可探索的連接器或外掛程式。每個項目都使用 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 伺服器。 |
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 | 在 Windows 上以原生方式執行 Codex 時使用的原生沙盒模式,僅適用於 Windows。 |
windows.sandbox_private_desktop | boolean | 在原生 Windows 環境中,預設會在私人桌面上執行最終的沙盒子處理程序。只有為了相容舊版 Winsta0\\Default 行為時,才設為 false。 |
agentstableagents.<name>.config_filestring (path)agents.<name>.descriptionstringagents.default_subagent_modelstringagents.default_subagent_reasoning_effortstringagents.enabledbooleanagents.interrupt_messagebooleanagents.max_concurrent_threads_per_sessionnumberagents.max_threadsnumberagents.max_concurrent_threads_per_session 的舊版別名。allow_login_shellbooleantrue;設為 false 時,會拒絕 login = true 請求,且省略 login 時預設使用非登入 Shell。analytics.enabledbooleanapproval_policyon-request | never | { granular = { sandbox_approval = bool, rules = bool, mcp_elicitations = bool, request_permissions = bool, skill_approval = bool } }approval_policy = { granular = { ... } },允許或自動拒絕特定類別的提示,同時讓其他提示維持互動式處理。untrusted 不受支援,on-failure 已棄用;互動式執行請使用 on-request,非互動式執行請使用 never。approval_policy.granular.mcp_elicitationsbooleantrue 時,允許顯示 MCP 資訊請求提示,而非自動拒絕。approval_policy.granular.request_permissionsbooleantrue 時,允許顯示 request_permissions 工具的提示。approval_policy.granular.rulesbooleantrue 時,允許顯示由 execpolicy prompt 規則觸發的核准提示。approval_policy.granular.sandbox_approvalbooleantrue 時,允許顯示沙盒權限提升的核准提示。approval_policy.granular.skill_approvalbooleantrue 時,允許顯示技能指令碼的核准提示。approvals_revieweruser | auto_reviewon-request 或細分核准政策下,由誰審查符合條件的核准提示。預設值為 user;auto_review 會使用審查子代理程式。此設定不會變更沙盒設定,也不會審查沙盒內已允許的動作。apps._default.approvals_revieweruser | auto_reviewapprovals_reviewer 值。apps._default.default_tools_approval_modeauto | prompt | writes | approveapps._default.destructive_enabledbooleandestructive_hint = true 的應用程式工具,預設允許或拒絕。apps._default.enabledbooleanapps._default.open_world_enabledbooleanopen_world_hint = true 的應用程式工具,預設允許或拒絕。apps.<id>.approvals_revieweruser | auto_reviewapps._default.approvals_reviewer。apps.<id>.default_tools_approval_modeauto | prompt | writes | approveapps.<id>.default_tools_enabledbooleanapps.<id>.destructive_enabledbooleandestructive_hint = true 的工具。apps.<id>.enabledbooleanapps.<id>.open_world_enabledbooleanopen_world_hint = true 的工具。apps.<id>.tools.<tool>.approval_modeauto | prompt | writes | approveapps.<id>.tools.<tool>.enabledbooleanrepos/list)的啟用狀態。auto_review.policystringguardian_policy_config 優先。空白值會被忽略。background_terminal_max_timeoutnumberwrite_stdin 輪詢的最長輪詢時間,單位為毫秒(背景終端輪詢)。預設值:300000(5 分鐘)。取代舊版 background_terminal_timeout 鍵。browser_use.allow_history_accessbooleanfalse 可限制瀏覽器歷史紀錄的存取。受管理的要求可強制實施此限制。browser_use.default_origin_policytableaccess、uploads、downloads 和 full_cdp_access,各欄位可設為 allow 或 deny。browser_use.origins.<origin>tablebrowser_use.default_origin_policy 相同。請包含 HTTP 或 HTTPS 通訊協定,可選擇加上連接埠;請省略路徑、查詢字串及片段。本機設定值無法放寬受管理的拒絕規則。chatgpt_base_urlstringcheck_for_update_on_startupbooleancli_auth_credentials_storefile | keyring | auto | ephemeralcompact_promptstringcomputer_use.default_app_accessallow | denycomputer_use.macos.bundle_idsmap<string, allow | deny>computer_use.windows.always_allowed_app_idsarray<string>computer_use.windows.aumidsmap<string, allow | deny>computer_use.windows.exesarray<table>publisher_name、product_name 和 access(allow 或 deny);binary_name 為選填。default_permissionsstring:read-only、:workspace 和 :danger-full-access;自訂設定檔名稱必須有對應的 [permissions.<name>] 資料表。請勿與 sandbox_mode 或 [sandbox_workspace_write] 同時使用。desktop.custom_file_handlers.<id>tabledesktop.custom_file_handlers.<id>.argsarray<string>[])。desktop.custom_file_handlers.<id>.commandstringdesktop.custom_file_handlers.<id>.iconstringdata:image/... URL、檔案 URI 或本機絕對路徑。必填;不支援的來源會使用預設的 VS Code 圖示。desktop.custom_file_handlers.<id>.inputpath | json_argument | json_stdinpath)。desktop.custom_file_handlers.<id>.labelstringdesktop.custom_file_handlers.<id>.supports_sshbooleanfalse)。developer_instructionsstringdisable_paste_burstbooleanexperimental_compact_prompt_filestring (path)experimental_use_unified_exec_toolboolean[features].unified_exec 或 codex --enable unified_exec。features.appsbooleanfeatures.code_mode.direct_only_tool_namespacesarray<string>features.code_mode.enabledbooleanfeatures.code_mode.excluded_tool_namespacesarray<string>features.context_management.experimental_modebooleanfeatures.enable_request_compressionbooleanfeatures.fast_modebooleanfeatures.goalsbooleanfeatures.hooksbooleanhooks.json 或內嵌 [hooks] 組態載入的生命週期掛勾。features.codex_hooks 是已棄用的別名。features.multi_agentbooleanspawn_agent、send_input、resume_agent、wait_agent 和 close_agent)(穩定功能;預設啟用)。features.network_proxyboolean | tableexperimental_network 要求已啟用並啟動代理伺服器,否則必須啟用此功能,才能強制執行權限設定檔的網域規則。設定 domains 等功能層級的政策選項時,請使用資料表。此功能不會篩選網頁搜尋、應用程式、MCP 或其他託管工具的流量。features.network_proxy.allow_local_bindingbooleanfalse;指定精確本機 IP 字面值或 localhost 的允許規則,仍可允許存取特定本機目標。features.network_proxy.allow_upstream_proxybooleantrue。features.network_proxy.dangerously_allow_all_unix_socketsbooleanfalse;僅應在嚴格控管的環境中使用。features.network_proxy.dangerously_allow_non_loopback_proxybooleanfalse;啟用後,可能讓 localhost 以外的來源連線至代理伺服器的監聽器。features.network_proxy.domainsmap<string, allow | deny>allow 規則前,不允許連線至任何外部目的地。支援精確主機名稱、僅比對子網域的 *.example.com、比對根網域及子網域的 **.example.com,以及全域 * 允許規則;建議使用限定範圍的規則,因為 * 會廣泛開放對公用網路的連出存取。若要封鎖目的地,請新增 deny 規則;發生衝突時,以 deny 為準。features.network_proxy.enable_socks5booleantrue。features.network_proxy.enable_socks5_udpbooleantrue。features.network_proxy.enabledbooleanfalse;代理伺服器關閉時,不會強制執行權限設定檔的網域規則。features.network_proxy.proxy_urlstring"http://127.0.0.1:3128"。features.network_proxy.socks_urlstring"http://127.0.0.1:8081"。features.network_proxy.unix_socketsmap<string, allow | deny>allow 項目。features.personalitybooleanfeatures.prevent_idle_sleepbooleanfeatures.remote_pluginbooleanfeatures.rollout_budget.enabledbooleanfeatures.rollout_budget.limit_tokens。features.rollout_budget.limit_tokensintegerfeatures.rollout_budget.prefill_token_weightnumber1.0。features.rollout_budget.reminder_interval_tokensintegerlimit_tokens 的 10%,最少為 1 個 Token。features.rollout_budget.sampling_token_weightnumber1.0。features.shell_snapshotbooleanfeatures.shell_toolbooleanshell 工具以執行指令(穩定功能;預設啟用)。features.skill_mcp_dependency_installbooleanfeatures.unified_execbooleanfeatures.web_searchbooleanweb_search 設定。features.web_search_cachedbooleanweb_search 時,true 對應至 web_search = "cached"。features.web_search_requestbooleanweb_search 時,true 對應至 web_search = "live"。feedback.enabledboolean/feedback 提交回饋的功能(預設值:true)。file_openervscode | vscode-insiders | windsurf | cursor | nonevscode)。forced_chatgpt_workspace_idstring (uuid)forced_login_methodchatgpt | apihide_agent_reasoningbooleancodex exec 輸出中隱藏推理事件。history.max_bytesnumberhistory.persistencesave-all | nonehookstableconfig.toml 中內嵌設定的生命週期掛勾。使用與 hooks.json 相同的事件結構描述;範例與支援的事件請參閱掛勾指南。hooks.<Event>array<table>PreToolUse、PermissionRequest、PostToolUse、PreCompact、PostCompact、SessionStart、SessionEnd、SubagentStart、SubagentStop、UserPromptSubmit、Stop 或 Interrupt。hooks.<Event>[].hooksarray<table>hooks.<Event>[].hooks[].additionalContextLimitintegeradditionalContext 儲存至磁碟,並向模型提供較短的預覽。預設為 2500;設為 0 會將完整上下文直接傳給模型。請參閱大型掛勾輸出。hooks.<Event>[].hooks[].asyncbooleanhooks.<Event>[].hooks[].commandWindowsstringcommand_windows。instructionsstringmodel_instructions_file 或 AGENTS.md。log_dirstring (path)$CODEX_HOME/log。明確指定此設定也會在該目錄中啟用原本需自行選擇啟用的純文字 TUI 日誌 codex-tui.log。marketplaces.<name>.refstringmarketplaces.<name>.sourcestringmarketplaces.<name>.source_typegit | localmarketplaces.<name>.sparse_pathsarray<string>mcp_oauth_callback_portintegeroauth.callback_port 優先。如果兩者皆未設定,Codex 會繫結至作業系統選定的臨時連接埠。mcp_oauth_callback_urlstringmcp_oauth_credentials_storeauto | file | keyringmcp_optional_startup_grace_msinteger (milliseconds)1000。設為 0 則改為依各伺服器的 startup_timeout_sec 等待。mcp_servers.<id>.argsarray<string>mcp_servers.<id>.authoauth | chatgptoauth(預設)會在有已儲存的 MCP OAuth 憑證時使用該憑證。chatgpt 會針對受信任的第一方 ChatGPT 來源使用目前的 ChatGPT 工作階段,再以已儲存的 OAuth 憑證作為備援。若所有憑證來源都無法提供憑證,兩種模式都可以在未經身分驗證的情況下連線。mcp_servers.<id>.bearer_token_env_varstringmcp_servers.<id>.commandstringmcp_servers.<id>.cwdstringmcp_servers.<id>.default_tools_approval_modeauto | prompt | writes | approvemcp_servers.<id>.disabled_toolsarray<string>enabled_tools 之後套用的拒絕清單。mcp_servers.<id>.enabledbooleanmcp_servers.<id>.enabled_toolsarray<string>mcp_servers.<id>.envmap<string,string>mcp_servers.<id>.env_http_headersmap<string,string>mcp_servers.<id>.env_varsarray<string | { name = string, source = "local" | "remote" }>source = "local";只有透過執行器運作的遠端 stdio 才能使用 source = "remote"。mcp_servers.<id>.experimental_environmentlocal | remoteremote 會透過遠端執行器環境啟動 stdio 伺服器;可串流 HTTP 的遠端執行位置尚未實作。mcp_servers.<id>.http_headersmap<string,string>mcp_servers.<id>.http_headers_helperstring (command)mcp_servers.<id>.oauth_resourcestringmcp_servers.<id>.oauth.callback_portintegermcp_oauth_callback_port。若直接使用回送位址的回呼 URL 明確指定了連接埠,請將監聽連接埠設為相同值。mcp_servers.<id>.oauth.callback_urlstringmcp_servers.<id>.oauth.client_idstringmcp_servers.<id>.requiredbooleanmcp_servers.<id>.scopesarray<string>mcp_servers.<id>.startup_timeout_msnumberstartup_timeout_sec 的別名,以毫秒為單位。mcp_servers.<id>.startup_timeout_secnumbermcp_servers.<id>.tool_timeout_secnumbermcp_servers.<id>.tools.<tool>.approval_modeauto | prompt | writes | approvemcp_servers.<id>.tools.<tool>.output_token_limitinteger (positive)mcp_servers.<id>.urlstringmemories.consolidation_modelstringmemories.disable_on_external_contextbooleantrue 時,使用 MCP 工具呼叫、網頁搜尋或工具搜尋等外部上下文的對話串不會用於生成記憶。預設為 false。舊版別名:memories.no_memories_if_mcp_or_web_search。memories.extract_modelstringmemories.generate_memoriesbooleanfalse 時,新建立的對話串不會儲存為記憶生成的輸入。預設為 true。memories.max_raw_memories_for_consolidationnumber256,最高為 4096。memories.max_rollout_age_daysnumber30,數值會限制在 0-90 範圍內。memories.max_rollouts_per_startupnumber16,最高為 128。memories.max_unused_daysnumber30,數值會限制在 0-365 範圍內。memories.min_rate_limit_remaining_percentnumber25,數值會限制在 0-100 範圍內。memories.min_rollout_idle_hoursnumber6,數值會限制在 1-48 範圍內。memories.use_memoriesbooleanfalse 時,Codex 不會將現有記憶注入後續工作階段。預設為 true。modelstringgpt-5.6-sol)。model_auto_compact_token_limitnumbermodel_auto_compact_token_limit_scopetotal | body_after_prefixtotal,預設值),或僅計算沿用的壓縮視窗前綴之後新增的內容(body_after_prefix)。model_catalog_jsonstring (path)$CODEX_HOME/profile-name.config.toml 設定檔可個別覆寫此設定。model_context_windownumbermodel_instructions_filestring (path)AGENTS.md。model_providerstringmodel_providers 中的提供者 ID(預設值:openai)。model_providers.<id>tableopenai、ollama 和 lmstudio)為保留值,無法覆寫。model_providers.<id>.authtableenv_key、experimental_bearer_token 或 requires_openai_auth 同時使用。model_providers.<id>.auth.argsarray<string>model_providers.<id>.auth.commandstringmodel_providers.<id>.auth.cwdstring (path)model_providers.<id>.auth.refresh_interval_msnumber0 時,僅在身分驗證重試後更新。model_providers.<id>.auth.timeout_msnumbermodel_providers.<id>.base_urlstringmodel_providers.<id>.env_http_headersmap<string,string>model_providers.<id>.env_keystringmodel_providers.<id>.env_key_instructionsstringmodel_providers.<id>.experimental_bearer_tokenstringenv_key)。model_providers.<id>.http_headersmap<string,string>model_providers.<id>.namestringmodel_providers.<id>.query_paramsmap<string,string>model_providers.<id>.request_max_retriesnumbermodel_providers.<id>.requires_openai_authbooleanmodel_providers.<id>.stream_idle_timeout_msnumbermodel_providers.<id>.stream_max_retriesnumbermodel_providers.<id>.supports_standalone_web_searchbooleanmodel_providers.<id>.supports_websocketsbooleanmodel_providers.<id>.wire_apiresponsesresponses,省略時也會以此作為預設值。model_providers.amazon-bedrock.aws.profilestringamazon-bedrock 供應商使用的 AWS 設定檔名稱。model_providers.amazon-bedrock.aws.regionstringamazon-bedrock 供應商使用的 AWS 區域。model_reasoning_effortminimal | low | medium | high | xhighxhigh 是否可用取決於模型)。model_reasoning_summaryauto | concise | detailed | nonemodel_supports_reasoning_summariesbooleanmodel_verbositylow | medium | highnotice.hide_full_access_warningbooleannotice.hide_gpt-5.1-codex-max_migration_promptbooleannotice.hide_gpt5_1_migration_promptbooleannotice.hide_rate_limit_model_nudgebooleannotice.hide_world_writable_warningbooleannotice.model_migrationsmap<string,string>notifyarray<string>openai_base_urlstringopenai 模型提供者的基底 URL 覆寫設定。oss_providerlmstudio | ollama--oss 執行時的預設本機提供者(未設定時,預設會提示您選擇)。otel.environmentstringdev)。otel.exporternone | otlp-http | otlp-grpcotel.exporter.<id>.endpointstringotel.exporter.<id>.headersmap<string,string>otel.exporter.<id>.protocolbinary | jsonotel.exporter.<id>.tls.ca-certificatestringotel.exporter.<id>.tls.client-certificatestringotel.exporter.<id>.tls.client-private-keystringotel.log_user_promptbooleanotel.metrics_exporternone | statsig | otlp-http | otlp-grpcstatsig)。otel.trace_exporternone | otlp-http | otlp-grpcotel.trace_exporter.<id>.endpointstringotel.trace_exporter.<id>.headersmap<string,string>otel.trace_exporter.<id>.protocolbinary | jsonotel.trace_exporter.<id>.tls.ca-certificatestringotel.trace_exporter.<id>.tls.client-certificatestringotel.trace_exporter.<id>.tls.client-private-keystringpermissions.<name>.descriptionstringextends 繼承父設定檔的說明。permissions.<name>.extendsstring:read-only 或 :workspace;:danger-full-access、未定義的父設定檔及循環繼承皆不被接受。permissions.<name>.filesystemtable:minimal 或 :workspace_roots。permissions.<name>.filesystem.":workspace_roots".<subpath-or-glob>"read" | "write" | "deny""." 代表根目錄本身;"**/*.env" 等 glob 子路徑可搭配 "deny" 拒絕讀取。permissions.<name>.filesystem.<path-or-glob>"read" | "write" | "deny" | table"deny" 可拒絕讀取符合的路徑。permissions.<name>.filesystem.glob_scan_max_depthnumber1。permissions.<name>.network.allow_local_bindingbooleanfalse,仍可透過精確的本機 IP 位址字面值或 localhost 允許規則,允許存取特定本機目標。permissions.<name>.network.allow_upstream_proxybooleanpermissions.<name>.network.dangerously_allow_all_unix_socketsbooleanpermissions.<name>.network.dangerously_allow_non_loopback_proxybooleanpermissions.<name>.network.domainstablefeatures.network_proxy 或已啟用的管理員控管網路要求啟動代理伺服器時,才會強制執行。支援精確主機名稱、*.example.com、**.example.com 及全域 * 允許規則;deny 優先。不會限制網頁搜尋、應用程式或 MCP 伺服器。permissions.<name>.network.domains.<pattern>allow | deny*.example.com、**.example.com 等限定範圍的萬用字元模式。permissions.<name>.network.enable_socks5booleanpermissions.<name>.network.enable_socks5_udpbooleanpermissions.<name>.network.enabledbooleanfeatures.network_proxy,也未啟用管理員控管的網路要求,指令會直接存取網路,且不會強制執行設定檔的網域規則。permissions.<name>.network.modelimited | fullpermissions.<name>.network.proxy_urlstringpermissions.<name>.network.socks_urlstringpermissions.<name>.network.unix_socketstableallow 會加入路徑,deny 則會拒絕該路徑。permissions.<name>.network.unix_sockets.<path>allow | denyallow 將 Unix 通訊端的絕對路徑加入有效允許清單,或使用 deny 拒絕該路徑。被拒絕的項目不會納入有效允許清單。permissions.<name>.workspace_rootstable:workspace_roots 檔案系統規則。permissions.<name>.workspace_roots.<path>booleantrue 時,將路徑納入此設定檔的工作區根目錄集合。已停用的項目仍不會生效。personalitynone | friendly | pragmaticsupportsPersonality 的模型所使用的預設溝通風格;可針對個別對話串/回合覆寫,或透過 /personality 覆寫。plan_mode_reasoning_effortnone | minimal | low | medium | high | xhighplugins.<plugin>.enabledbooleanplugin-name@marketplace-name 鍵啟用或停用本機市集外掛程式。此設定會從合併後生效的組態讀取;受信任專案的設定可覆寫使用者、雲端管理及系統的預設值。即使外掛程式已停用,重新整理市集時仍可安裝或重新整理已設定的外掛程式。此設定不會覆寫由工作區管理的啟用狀態。plugins.<plugin>.mcp_servers.<server>.default_tools_approval_modeauto | prompt | writes | approveplugins.<plugin>.mcp_servers.<server>.disabled_toolsarray<string>enabled_tools 後套用的拒絕清單。plugins.<plugin>.mcp_servers.<server>.enabledbooleanplugins.<plugin>.mcp_servers.<server>.enabled_toolsarray<string>plugins.<plugin>.mcp_servers.<server>.tools.<tool>.approval_modeauto | prompt | writes | approveproject_doc_fallback_filenamesarray<string>AGENTS.md 時,嘗試讀取的其他檔案名稱。project_doc_max_bytesnumberAGENTS.md 讀取的最大位元組數。project_root_markersarray<string>projects.<path>.trust_levelstring"trusted" | "untrusted")。不受信任的專案會略過專案範圍的 .codex/ 設定層,包括專案本機組態、掛勾與規則。review_modelstring/review 使用的模型覆寫設定,選填(預設使用目前工作階段的模型)。sandbox_moderead-only | workspace-write | danger-full-accesssandbox_workspace_write.exclude_slash_tmpboolean/tmp 排除於可寫入根目錄之外。sandbox_workspace_write.exclude_tmpdir_env_varboolean$TMPDIR 排除於可寫入根目錄之外。sandbox_workspace_write.network_accessbooleansandbox_workspace_write.writable_rootsarray<string>sandbox_mode = "workspace-write" 時,額外允許寫入的根目錄。service_tierstringfast 或目前模型宣告支援的其他層級;fast 會對應至請求值 priority。shell_environment_policy.excludearray<string>shell_environment_policy.filters;請勿在同一層中併用這兩種形式。shell_environment_policy.experimental_use_profilebooleanshell_environment_policy.filtersmap<string, include | exclude>set 值會在排除作業之後套用。請勿在同一層中將篩選器與舊版 exclude 或 include_only 陣列併用。shell_environment_policy.ignore_default_excludesbooleanshell_environment_policy.include_onlyarray<string>shell_environment_policy.filters;請勿在同一層中併用這兩種形式。shell_environment_policy.inheritall | core | noneshell_environment_policy.setmap<string,string>show_raw_agent_reasoningbooleanskills.configarray<object>skills.config.<index>.enabledbooleanskills.config.<index>.pathstring (path)SKILL.md 的技能資料夾路徑。skills.max_context_tokensinteger (positive)10000 個 Token。sqlite_homestring (path)suppress_unstable_features_warningbooleantool_output_token_limitnumbertool_suggest.disabled_toolsarray<table>type = "connector" 或 "plugin",並包含 id。tool_suggest.discoverablesarray<table>type = "connector" 或 "plugin",並包含 id。tools.view_imagebooleanview_image。tools.web_searchboolean | { context_size = "low|medium|high", allowed_domains = [string], location = { country, region, city, timezone } }tuitabletui.alternate_screenauto | always | nevertui.animationsbooleantui.keymap.<context>.<action>string | array<string>global、chat、composer、editor、vim_normal、vim_operator、vim_text_object、pager、list 和 approval。部分撰寫工具動作會退回使用相符的 tui.keymap.global 繫結;若支援特定上下文的繫結,則優先使用該繫結。tui.keymap.<context>.<action> = []empty arrayctrl-a、shift-enter、page-down 或 minus。tui.model_availability_nux.<model>integertui.notification_conditionunfocused | alwaysunfocused。tui.notification_methodauto | osc9 | beltui.notificationsboolean | array<string>tui.raw_output_modeboolean/raw 或預設的 alt-r 按鍵繫結切換。tui.resume_cwdcurrent | sessiontui.show_tooltipsbooleantui.status_linearray<string> | nullnull 會停用狀態列。tui.terminal_titlearray<string> | null["spinner", "project"];null 會停用標題更新。tui.themestringtui.vim_mode_defaultboolean/vim 切換。web_searchdisabled | cached | indexed | live"cached";cached 使用 OpenAI 維護的索引,不會存取外部網頁;indexed 僅允許經搜尋索引把關的外部存取;若使用 --yolo 或其他完整存取權沙盒設定,則預設為 "live")。使用 "live" 可進行不受限制的即時擷取,使用 "disabled" 則會移除工具。windows_wsl_setup_acknowledgedbooleanwindows.sandboxunelevated | elevatedwindows.sandbox_private_desktopbooleanWinsta0\\Default 行為時,才設為 false。您可以在這裡找到 config.toml 的最新 JSON 結構描述。
若要在 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 和 ChatGPT 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 搭配使用。
當專案使用 trust_level = "untrusted" 時,Codex 會據此採用更嚴格的核准行為。
allowed_approval_policies 中的 untrusted 項目
對此行為仍然有效,但不允許明確設定
approval_policy = "untrusted"。
[models.new_thread] 資料表提供受管理的預設值,而非強制設定。
如果您使用 --model、
--config 或 --profile 明確覆寫模型或推理強度,Codex 會同時忽略 [models.new_thread] 中的 model 與
model_reasoning_effort。service_tier 則獨立處理。
瀏覽器要求涵蓋三個不同的操作介面。in_app_browser
控制使用者直接開啟及操作的瀏覽器窗格。browser_use
控制智慧體在瀏覽器中執行的工作。computer_use 則控制智慧體
在原生桌面應用程式中執行的工作。
巢狀的瀏覽器與電腦政策值本身
不會授予存取權。針對特定來源或應用程式設定的 allow,可以覆寫
同一政策來源的備援設定,但一般的功能、核准及其他政策檢查
仍然適用。當受管理的要求與 config.toml 皆適用時,任一方的 deny
都會優先。
| Key | Type / Values | Details |
|---|---|---|
allow_appshots | boolean | 設為 false 可為受管理的使用者停用應用程式快照。若省略,應用程式快照不受需求設定限制,並依一般產品規則決定是否可用。 |
allow_browser_and_computer_use | boolean | 設為 false 可同時封鎖智慧體操作的「瀏覽器」功能,以及操作原生應用程式的「電腦」功能。設為 true 或省略此設定,都不會啟用這兩項功能;其餘功能、政策和核准檢查仍然適用。 |
allow_login_shell | boolean | 強制設定 shell 工具是否可以啟動登入 shell。 |
allow_managed_hooks_only | boolean | 設為 true 時,Codex 會略過使用者、專案、工作階段和外掛程式的掛勾,但仍允許來自 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 存取權杖)限制為所列的工作區 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 | 設定單一應用程式工具的受管理核准模式。 |
browser_use | table | 智慧體操作的「瀏覽器」功能所適用的受管理需求。 |
browser_use.allow_global_persistent_approval | boolean | 設為 false 可防止「瀏覽器」功能建立或採用涵蓋所有網站的 Always allow 核准,例如允許從任何網站下載。現有的已儲存核准會被忽略,但不會遭到刪除。設為 true 或省略此設定不會建立核准。 |
browser_use.allow_history_access | boolean | 設為 false 可防止「瀏覽器」功能讀取瀏覽紀錄。設為 true 或省略此設定時,仍會套用一般的紀錄設定和可用性檢查。 |
browser_use.default_origin_policy | table | 當 browser_use.origins 下沒有相符項目定義某項「瀏覽器」設定時,該設定使用的備援值。相符的來源規則會取代該組態來源的備援值。Codex 接著會套用受管理需求與使用者組態之間較嚴格的結果。 |
browser_use.default_origin_policy.access | allow | deny | 使用 deny 可在套用備援值的來源上封鎖「瀏覽器」功能。拒絕存取某個來源也會封鎖該來源的上傳、下載、完整瀏覽器偵錯存取權及自動審查。allow 僅允許繼續進行一般核准和政策檢查。 |
browser_use.default_origin_policy.access_approval_lifetime | turn | thread | 設定非永久性網站存取核准的有效期間: turn 將其限於目前回合,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 可封鎖「瀏覽器」功能從套用備援值的來源下載。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 可防止「瀏覽器」功能儲存或採用針對套用備援值之來源的 Always allow 核准。目前回合或討論串的核准仍可適用。true 會在其他條件允許時提供 Always allow 選項,但不會建立核准。 |
browser_use.default_origin_policy.uploads | allow | deny | 使用 deny 可封鎖「瀏覽器」功能上傳至套用備援值的來源。allow 僅允許繼續進行一般核准和政策檢查。 |
browser_use.disable_auto_review | boolean | 設為 true 可略過「瀏覽器」功能的自動審查,改為要求使用者核准。設為 false 或省略此設定時,只要其他設定允許,自動審查就仍可使用。 |
browser_use.origins | map<string, table> | 個別來源的瀏覽器政策。索引鍵使用 <scheme>://<host-pattern>[:<port>] 格式,通訊協定為 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 可封鎖瀏覽器功能對相符來源的存取,也會封鎖在這些來源上的上傳、下載、完整瀏覽器偵錯存取及自動審查。allow 僅允許繼續進行正常的核准與政策檢查。 |
browser_use.origins.<pattern>.access_approval_lifetime | turn | thread | 設定相符來源的非永久性網站存取核准有效期間: turn 將其限於目前回合,thread 則使其在目前對話串的剩餘期間持續有效。persistent_approval 另行控制是否提供 Always allow。 |
browser_use.origins.<pattern>.auto_review | allow | deny | 使用 deny 可略過相符來源的自動審查,改為要求使用者核准。allow 會在其他設定允許時保留自動審查功能。 |
browser_use.origins.<pattern>.downloads | allow | deny | 使用 deny 可封鎖瀏覽器功能從相符來源下載。allow 僅允許繼續進行正常的核准與政策檢查。 |
browser_use.origins.<pattern>.full_cdp_access | allow | deny | 使用 deny 可封鎖對相符來源的完整 Chrome DevTools Protocol(CDP)存取。allow 僅允許繼續進行正常的主動啟用與核准檢查。 |
browser_use.origins.<pattern>.persistent_approval | boolean | 設為 false 可防止瀏覽器功能儲存或採用相符來源的 Always allow 核准。目前回合或對話串的核准仍可適用。true 會在其他條件允許時提供 Always allow,但不會建立核准。 |
browser_use.origins.<pattern>.uploads | allow | deny | 使用 deny 可封鎖瀏覽器功能上傳至相符來源。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 裝置上啟用鎖定時使用功能。此要求會移除啟用控制項;若鎖定時使用功能已啟用,則不會將其關閉。若省略此設定,則依產品正常的可用性決定。 |
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.macos.bundle_ids | map<string, allow | deny> | 將確切的 macOS 套件識別碼對應至 allow 或 deny。相符規則會取代同一政策來源中的 computer_use.default_app_access。受管理的要求或使用者組態只要有任一方拒絕,仍會封鎖存取。 |
computer_use.macos.bundle_ids.<bundle-id> | allow | deny | 使用 deny 可封鎖與該套件識別碼完全相符的應用程式。allow 僅覆寫此政策來源的預設值,仍須由所有其他政策來源及正常核准流程允許該應用程式。 |
computer_use.windows | table | 電腦功能適用於已封裝及未封裝 Windows 應用程式的規則。 |
computer_use.windows.aumids | map<string, allow | deny> | 將已簽署封裝應用程式的確切、已註冊應用程式使用者模型識別碼(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.windows.exes[].product_name | string | 必填,須與執行檔已簽署版本資訊中的 ProductName 完全相同。 |
computer_use.windows.exes[].publisher_name | string | 必填,須與執行檔受信任簽署憑證中的發行者名稱完全相同,格式為 Windows X.500 辨別名稱。 |
default_permissions | string | 受管理的預設權限設定檔。此設定檔必須列為 allowed_permission_profiles 允許的項目。請明確設定此值,讓行為符合預期;若省略,Codex 只有在 :workspace 和 :read-only 都明確獲准使用時,才會預設使用 :workspace。 |
enforce_residency | string | 要求 Codex 服務流量使用支援的資料駐留區域。目前接受的值為 us。 |
experimental_network | table | 由管理員管理、透過 requirements.toml 強制執行的網路要求,適用於沙盒內的本機指令。啟用後,這些要求可在未啟用 features.network_proxy 的情況下啟動指令網路代理伺服器。瀏覽器工具會另行檢查受管理的網路拒絕規則及排他性允許清單。這些要求不會將瀏覽器流量導向代理伺服器,也不會控制網頁搜尋、應用程式、MCP 伺服器、原生應用程式流量或 Codex 雲端網路。 |
experimental_network.allow_local_binding | boolean | 允許沙盒網路更廣泛地存取本機/私人網路。即使此設定維持為 false,使用確切本機 IP 字面值或 localhost 的允許規則仍可允許存取特定本機目標。 |
experimental_network.allow_upstream_proxy | boolean | 允許沙盒網路串接環境中設定的上游代理伺服器。 |
experimental_network.allowed_domains | array<string> | 受管理的網路代理伺服器啟用時,適用於沙盒內指令網路存取的管理員允許規則。這些規則不適用於網頁搜尋、應用程式或 MCP 伺服器。請勿與 experimental_network.domains 同時使用。 |
experimental_network.dangerously_allow_all_unix_sockets | boolean | 允許任意 Unix 通訊端目的地,而不僅限於允許清單中的目的地。僅應在嚴格控管的環境中使用。 |
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,以及全域 * 允許規則;建議採用範圍明確的規則,因為 * 會廣泛開放對公用網路的對外存取。發生衝突時,deny 優先。請勿與 experimental_network.allowed_domains 或 experimental_network.denied_domains 同時使用。 |
experimental_network.enabled | boolean | 啟用沙盒網路要求。如果目前使用的沙盒已關閉指令的網路功能,此設定不會授予網路存取權。 |
experimental_network.http_port | integer | [experimental_network] 要求使用的回送 HTTP 接聽連接埠。 |
experimental_network.managed_allowed_domains_only | boolean | 設為 true 時,只要沙盒網路要求處於啟用狀態,就只有管理員管理的允許規則有效;使用者新增的允許清單項目會遭忽略。即使沒有受管理的允許規則,使用者新增的網域允許規則也不會繼續生效。 |
experimental_network.socks_port | integer | [experimental_network] 要求使用的回送 SOCKS5 接聽連接埠。 |
experimental_network.unix_sockets | map<string, allow | deny> | 由管理員管理的沙盒網路 Unix 通訊端政策。 |
features | table | 固定的功能值。執行階段功能請使用 config.toml 中的標準名稱;此處也支援文件中列出的應用程式專用需求索引鍵。 |
features.<name> | boolean | 要求文件中列出的執行階段或應用程式功能保持啟用或停用。 |
features.apps | boolean | 將受管理使用者的應用程式整合功能固定為啟用或停用。 |
features.browser_use | boolean | 在 requirements.toml 中設為 false,即可停用智慧體操作的「瀏覽器」功能。 |
features.browser_use_external | boolean | 在 requirements.toml 中設為 false,即可防止 Codex 透過 ChatGPT 瀏覽器擴充功能操作支援的瀏覽器,包括現有分頁和已登入的工作階段。 |
features.browser_use_full_cdp_access | boolean | 在 requirements.toml 中設為 false,即可停用本機執行階段的完整 Chrome DevTools Protocol 存取權(包括瀏覽器開發人員模式),並防止 ChatGPT 桌面版應用程式啟用對應設定。若省略,則依一般產品規則決定是否可用。 |
features.computer_use | boolean | 在 requirements.toml 中設為 false,即可停用「電腦」、「錄製與重播」,以及相關的安裝或啟用流程。 |
features.fast_mode | boolean | 將受管理使用者的標準 fast_mode 功能固定為啟用或停用。 |
features.guardian_approval | boolean | 將受管理使用者的 Guardian 核准功能固定為啟用或停用。 |
features.in_app_browser | boolean | 在 requirements.toml 中設為 false,即可停用由使用者直接開啟及控制的內建瀏覽器窗格。 |
features.in_app_updates | boolean | 在 requirements.toml 中設為 false,即可停用應用程式內更新。若省略此需求,更新仍預設為啟用。 |
features.memories | boolean | 將受管理使用者的記憶功能固定為啟用或停用。 |
features.multi_agent | boolean | 將受管理使用者的多智慧體功能固定為啟用或停用。 |
features.plugin_sharing | boolean | 在雲端管理的 requirements.toml 中設為 false,即可停用在工作區中分享本機建置外掛程式的功能。 |
features.plugins | boolean | 將受管理使用者的外掛程式功能固定為啟用或停用。 |
features.remote_plugin | boolean | 將受管理使用者的遠端外掛程式目錄功能固定為啟用或停用。 |
features.workspace_dependencies | boolean | 將受管理使用者可使用的隨附工作區相依套件執行階段固定為啟用或停用。 |
feedback | table | 受管理的意見回饋設定。 |
feedback.enabled | boolean | 強制設定使用者是否可以透過各個 Codex 用戶端提交意見回饋。 |
guardian_policy_config | string | 用於自動審查的受管理 Markdown 政策指示。此設定優先於本機的 [auto_review].policy。空白值會被忽略。 |
hooks | table | 由管理員強制執行的受管理生命週期掛勾。需要受管理的掛勾目錄,並使用與 config.toml 中內嵌 [hooks] 相同的事件結構描述。 |
hooks.<Event> | array<table> | 掛勾事件的比對器群組,例如 PreToolUse、PermissionRequest、PostToolUse、PreCompact、PostCompact、SessionStart、SessionEnd、SubagentStart、SubagentStop、UserPromptSubmit 或 Stop。 |
hooks.<Event>[].hooks | array<table> | 比對器群組的掛勾處理常式。支援指令與 MCP 工具掛勾;提示詞與智慧體掛勾處理常式則會被剖析,但略過執行。 |
hooks.<Event>[].hooks[].additionalContextLimit | integer | |
hooks.<Event>[].hooks[].async | boolean | |
hooks.<Event>[].hooks[].commandWindows | string | 指令掛勾僅在 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 | 內建瀏覽器窗格的需求。這些設定不控制智慧體操作的「瀏覽器」功能。 |
in_app_browser.allow_external_browser_settings_import | boolean | 設為 false 可防止使用者將外部瀏覽器的設定或瀏覽資料匯入內建瀏覽器。設為 true 或省略此設定時,只要其他產品檢查允許,匯入功能就仍可使用。此設定僅供管理用途,無法透過 config.toml 覆寫。 |
log_dir | string (path) | 強制指定 Codex 寫入本機記錄檔的目錄。 |
marketplaces | table | 管理員對外掛程式市集來源的要求。當 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 指定單一程式碼庫、使用 host_pattern 透過正規表示式比對 Git 主機,或使用 local 指定單一目錄。 |
marketplaces.allowed_sources.<name>.url | string | 當 source = "git" 時必填的 Git 程式碼庫 URL。Codex 會先將設定的 URL 與允許的 URL 正規化,再要求程式碼庫完全相符。 |
marketplaces.restrict_to_allowed_sources | boolean | 當設為 true 時,新增市集、安裝外掛程式、重新整理及執行階段載入作業都要求設定的市集來源符合 allowed_sources。OpenAI 精選的 Git 目錄(包括 API 金鑰目錄)也必須符合允許清單。隨附的工作區外掛程式及遠端安裝的工作區外掛程式不屬於此精選 Git 來源政策的範圍。 |
mcp_servers | table | 可啟用的 MCP 伺服器允許清單。伺服器名稱( <id>)與身分都必須相符,才能啟用 MCP 伺服器。任何已設定但未列於允許清單中(或身分不符)的 MCP 伺服器都會停用。 |
mcp_servers.<id>.identity | table | 單一 MCP 伺服器的身分規則。請設定 command(stdio)或 url(可串流 HTTP)其中之一。 |
mcp_servers.<id>.identity.command | string | table | 透過完全相符的指令字串允許 MCP stdio 伺服器,或使用比對器表格,要求執行檔完全相符且引數依序符合比對器。字串形式不會檢查引數、 cwd、env 或 env_vars。 |
mcp_servers.<id>.identity.command.args | array<table> | stdio 伺服器依序排列的引數比對器。所設定的引數清單長度必須與比對器清單相同,且每個位置都必須相符。指令比對器不會檢查 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 伺服器所設定的 command 必須與其完全相符。 |
mcp_servers.<id>.identity.url | string | table | 透過完全相符的 URL 字串允許 MCP 可串流 HTTP 伺服器,或使用 exact、prefix 或 regex 值比對器表格。 |
mcp_servers.<id>.identity.url.expression | string | regex URL 比對器使用的規則運算式。運算式必須有效,且須比對完整的 URL 值。 |
mcp_servers.<id>.identity.url.match | exact | prefix | regex | 所設定的 MCP 伺服器 URL 使用的比對操作。 |
mcp_servers.<id>.identity.url.value | string | exact 或 prefix URL 比對器使用的值。 |
model_catalog_json | string (path) | 強制指定 Codex 啟動時使用的 JSON 模型目錄。 |
models | table | 包含 [models.new_thread] 資料表。 |
models.new_thread | table | 啟動新的本機討論串時套用的選用預設值。這些值優先於使用者和專案的預設值,但仍可由明確指定的值覆寫。 |
models.new_thread.model | string | 新討論串的預設模型。只要明確覆寫模型或推理強度其中一項,這兩個欄位就都會被忽略。 |
models.new_thread.model_reasoning_effort | string | 新討論串的預設推理強度。只要明確覆寫模型或推理強度其中一項,這兩個欄位就都會被忽略。 |
models.new_thread.service_tier | string | 新討論串的預設服務層級。若明確覆寫服務層級,此欄位就會被忽略。 |
permissions | table | 由管理員定義的權限設定檔,以設定檔名稱為索引鍵。使用與 config.toml 相同的設定檔欄位。 |
permissions.<name> | table | 由管理員定義的權限設定檔。名稱不得以 : 開頭、使用保留名稱 filesystem,或與已載入組態中的設定檔同名。使用與 config.toml 相同的設定檔欄位;完整的設定檔結構描述請參閱權限指南。 |
permissions.filesystem.deny_read | array<string> | 由管理員強制執行的檔案系統讀取拒絕規則。項目可以是路徑或 glob 模式,使用者無法透過本機組態放寬這些限制。 |
plugins | table | 各外掛程式專屬的 MCP 伺服器允許清單,以外掛程式識別碼為索引鍵。存在此表格時,外掛程式內附的伺服器若沒有相符的外掛程式與伺服器項目,就會停用。 |
plugins.<plugin>.mcp_servers | table | 單一外掛程式內附 MCP 伺服器的允許清單。外掛程式伺服器要求使用與最上層 mcp_servers 要求相同的確切身分與比對器形式。 |
plugins.<plugin>.mcp_servers.<server>.identity | table | 單一外掛程式內附 MCP 伺服器的身分規則。請設定 command(stdio)或 url(可串流 HTTP)其中之一。 |
plugins.<plugin>.mcp_servers.<server>.identity.command | string | table | 透過完全相符的指令字串允許外掛程式的 stdio MCP 伺服器,或使用比對器表格,要求執行檔完全相符且引數依序符合比對器。 |
plugins.<plugin>.mcp_servers.<server>.identity.command.args | array<table> | 外掛程式隨附的 stdio 伺服器所使用的引數比對器,依序排列。設定的引數清單長度必須與比對器清單相同,且每個位置都必須相符。 |
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 | 指定執行檔;外掛程式內附 stdio 伺服器所設定的指令必須與其完全相符。 |
plugins.<plugin>.mcp_servers.<server>.identity.url | string | table | 使用完全相符的 URL 字串來允許外掛程式的可串流 HTTP MCP 伺服器,或使用 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 | 外掛程式隨附的 MCP 伺服器 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.sandbox 允許使用的原生 Windows 沙盒實作(elevated 和 unelevated)。清單不得為空。若兩者皆獲准使用且未選取模式,Codex 會優先使用 elevated。 |
windows.sandbox_private_desktop | boolean | 強制設定原生 Windows 沙盒是否在私人桌面上啟動子程序。 |
allow_appshotsbooleanfalse 可為受管理的使用者停用應用程式快照。若省略,應用程式快照不受需求設定限制,並依一般產品規則決定是否可用。allow_browser_and_computer_usebooleanfalse 可同時封鎖智慧體操作的「瀏覽器」功能,以及操作原生應用程式的「電腦」功能。設為 true 或省略此設定,都不會啟用這兩項功能;其餘功能、政策和核准檢查仍然適用。allow_login_shellbooleanallow_managed_hooks_onlybooleantrue 時,Codex 會略過使用者、專案、工作階段和外掛程式的掛勾,但仍允許來自 requirements.toml 和其他受管理組態層的受管理掛勾。allow_remote_controlbooleanfalse 可為受管理的使用者停用裝置遠端控制。若省略,裝置遠端控制不受需求設定限制,並依一般產品規則決定是否可用。allowed_approval_policiesarray<string>on-request、never 和 granular。加入 untrusted 即可允許因不受信任專案而衍生的更嚴格政策;無法透過 approval_policy 直接選取此政策。allowed_approvals_reviewersarray<string>approvals_reviewer 允許的值,例如 user 和 auto_review。allowed_chatgpt_workspacesarray<string>allowed_login_methodsarray<string>chatgpt、api 或兩者。若省略此設定,則不限制登入方式。若有設定,清單必須至少包含一種方式。api 允許 API 身分驗證,包括 Amazon Bedrock。請透過本機系統需求檔案或 macOS MDM 設定;雲端管理的值會被忽略。allowed_permission_profilestable<boolean>true 的設定檔可供使用。省略或設為 false 的設定檔一律禁止使用,包括未來版本新增的設定檔。合併需求來源時,會依設定檔名稱比對項目。allowed_permission_profiles.<name>booleanfalse 停用先前較低優先順序來源所允許的設定檔。allowed_sandbox_modesarray<string>sandbox_mode 允許的值。allowed_web_search_modesarray<string>web_search 允許的值(disabled、cached、indexed、live)。disabled 一律允許使用;空白清單實際上代表僅允許 disabled。appstableapps.<id>.enabledbooleanfalse 可停用應用程式。合併多個要求來源時,停用要求仍會維持其限制效力。apps.<id>.tools.<tool>.approval_modeauto | prompt | writes | approvebrowser_usetablebrowser_use.allow_global_persistent_approvalbooleanfalse 可防止「瀏覽器」功能建立或採用涵蓋所有網站的 Always allow 核准,例如允許從任何網站下載。現有的已儲存核准會被忽略,但不會遭到刪除。設為 true 或省略此設定不會建立核准。browser_use.allow_history_accessbooleanfalse 可防止「瀏覽器」功能讀取瀏覽紀錄。設為 true 或省略此設定時,仍會套用一般的紀錄設定和可用性檢查。browser_use.default_origin_policytablebrowser_use.origins 下沒有相符項目定義某項「瀏覽器」設定時,該設定使用的備援值。相符的來源規則會取代該組態來源的備援值。Codex 接著會套用受管理需求與使用者組態之間較嚴格的結果。browser_use.default_origin_policy.accessallow | denydeny 可在套用備援值的來源上封鎖「瀏覽器」功能。拒絕存取某個來源也會封鎖該來源的上傳、下載、完整瀏覽器偵錯存取權及自動審查。allow 僅允許繼續進行一般核准和政策檢查。browser_use.default_origin_policy.access_approval_lifetimeturn | threadturn 將其限於目前回合,thread 則使其在目前對話串的剩餘期間持續有效。persistent_approval 另行控制是否提供 Always allow。產品預設值為 thread。browser_use.default_origin_policy.auto_reviewallow | denydeny 可略過套用備援值之來源的自動審查,改為要求使用者核准。使用 allow 時,只要其他設定允許,自動審查就仍可使用。browser_use.default_origin_policy.downloadsallow | denydeny 可封鎖「瀏覽器」功能從套用備援值的來源下載。allow 僅允許繼續進行一般核准和政策檢查。browser_use.default_origin_policy.full_cdp_accessallow | denydeny 可封鎖對套用備援值之來源的完整 Chrome DevTools Protocol(CDP)存取權。allow 僅允許繼續進行一般的主動啟用和核准檢查。browser_use.default_origin_policy.persistent_approvalbooleanfalse 可防止「瀏覽器」功能儲存或採用針對套用備援值之來源的 Always allow 核准。目前回合或討論串的核准仍可適用。true 會在其他條件允許時提供 Always allow 選項,但不會建立核准。browser_use.default_origin_policy.uploadsallow | denydeny 可封鎖「瀏覽器」功能上傳至套用備援值的來源。allow 僅允許繼續進行一般核准和政策檢查。browser_use.disable_auto_reviewbooleantrue 可略過「瀏覽器」功能的自動審查,改為要求使用者核准。設為 false 或省略此設定時,只要其他設定允許,自動審查就仍可使用。browser_use.originsmap<string, table><scheme>://<host-pattern>[:<port>] 格式,通訊協定為 http 或 https。可使用確切主機名稱、僅比對子網域的 *.example.com,或比對根網域及其子網域的 **.example.com。其他 * 萬用字元可跨越句點,因此 region*.example.com 也會比對到 region.api.example.com;主機部分為 * 時,會比對該通訊協定的所有主機。通訊協定與非預設連接埠會影響比對;明確指定的預設連接埠會在正規化時移除。不允許路徑、查詢、內嵌的使用者名稱或密碼,以及含有萬用字元的通訊協定或連接埠。在 TOML 中,請以引號括住模式,例如 [browser_use.origins."https://**.example.com"]。browser_use.origins.<pattern>tabledeny 優先於 allow、false 優先於 true,且 turn 優先於 thread。browser_use.origins.<pattern>.accessallow | denydeny 可封鎖瀏覽器功能對相符來源的存取,也會封鎖在這些來源上的上傳、下載、完整瀏覽器偵錯存取及自動審查。allow 僅允許繼續進行正常的核准與政策檢查。browser_use.origins.<pattern>.access_approval_lifetimeturn | threadturn 將其限於目前回合,thread 則使其在目前對話串的剩餘期間持續有效。persistent_approval 另行控制是否提供 Always allow。browser_use.origins.<pattern>.auto_reviewallow | denydeny 可略過相符來源的自動審查,改為要求使用者核准。allow 會在其他設定允許時保留自動審查功能。browser_use.origins.<pattern>.downloadsallow | denydeny 可封鎖瀏覽器功能從相符來源下載。allow 僅允許繼續進行正常的核准與政策檢查。browser_use.origins.<pattern>.full_cdp_accessallow | denydeny 可封鎖對相符來源的完整 Chrome DevTools Protocol(CDP)存取。allow 僅允許繼續進行正常的主動啟用與核准檢查。browser_use.origins.<pattern>.persistent_approvalbooleanfalse 可防止瀏覽器功能儲存或採用相符來源的 Always allow 核准。目前回合或對話串的核准仍可適用。true 會在其他條件允許時提供 Always allow,但不會建立核准。browser_use.origins.<pattern>.uploadsallow | denydeny 可封鎖瀏覽器功能上傳至相符來源。allow 僅允許繼續進行正常的核准與政策檢查。chatgpt_base_urlstringcheck_for_update_on_startupbooleancli_auth_credentials_storefile | keyring | auto | ephemeralfile 使用 CODEX_HOME/auth.json;keyring 要求使用作業系統的認證存放區;auto 會在認證存放區無法使用時改用檔案;ephemeral 將認證保留在目前程序的記憶體中。請透過本機系統需求檔案或 macOS MDM 設定;雲端管理的值會被忽略。computer_usetableconfig.toml 應用程式規則都會強制執行;每個政策來源都必須允許該應用程式。computer_use.allow_locked_computer_usebooleanfalse 可防止使用者在受管理的 macOS 裝置上啟用鎖定時使用功能。此要求會移除啟用控制項;若鎖定時使用功能已啟用,則不會將其關閉。若省略此設定,則依產品正常的可用性決定。computer_use.allow_persistent_approvalbooleanfalse 可移除跨工作階段儲存應用程式核准的選項。目前工作階段的核准仍可使用。設為 true 或省略此設定,都不會核准任何應用程式。computer_use.default_app_accessallow | denydeny 會封鎖存取。allow 僅允許繼續進行正常的核准與政策檢查。產品預設值為 allow。computer_use.macostablecomputer_use.macos.bundle_idsmap<string, allow | deny>allow 或 deny。相符規則會取代同一政策來源中的 computer_use.default_app_access。受管理的要求或使用者組態只要有任一方拒絕,仍會封鎖存取。computer_use.macos.bundle_ids.<bundle-id>allow | denydeny 可封鎖與該套件識別碼完全相符的應用程式。allow 僅覆寫此政策來源的預設值,仍須由所有其他政策來源及正常核准流程允許該應用程式。computer_use.windowstablecomputer_use.windows.aumidsmap<string, allow | deny>allow 或 deny。相符規則會取代同一政策來源中的 computer_use.default_app_access。computer_use.windows.aumids.<aumid>allow | denydeny 可封鎖與該封裝應用程式身分完全相符的應用程式。allow 僅覆寫此政策來源的預設值,仍須由所有其他政策來源及正常核准流程允許該應用程式。computer_use.windows.exesarray<table>computer_use.default_app_access;若無法明確驗證執行檔的簽署身分,則會封鎖該執行檔。computer_use.windows.exes[].accessallow | denydeny 會封鎖存取。allow 僅覆寫此政策來源的預設值,仍須由所有其他政策來源及正常核准流程允許該應用程式。computer_use.windows.exes[].binary_namestringOriginalFilename。比對不區分大小寫。如果相符的發行者與產品規則要求此值,但執行檔未提供,電腦功能便會封鎖該執行檔。computer_use.windows.exes[].product_namestringProductName 完全相同。computer_use.windows.exes[].publisher_namestringdefault_permissionsstringallowed_permission_profiles 允許的項目。請明確設定此值,讓行為符合預期;若省略,Codex 只有在 :workspace 和 :read-only 都明確獲准使用時,才會預設使用 :workspace。enforce_residencystringus。experimental_networktablerequirements.toml 強制執行的網路要求,適用於沙盒內的本機指令。啟用後,這些要求可在未啟用 features.network_proxy 的情況下啟動指令網路代理伺服器。瀏覽器工具會另行檢查受管理的網路拒絕規則及排他性允許清單。這些要求不會將瀏覽器流量導向代理伺服器,也不會控制網頁搜尋、應用程式、MCP 伺服器、原生應用程式流量或 Codex 雲端網路。experimental_network.allow_local_bindingbooleanfalse,使用確切本機 IP 字面值或 localhost 的允許規則仍可允許存取特定本機目標。experimental_network.allow_upstream_proxybooleanexperimental_network.allowed_domainsarray<string>experimental_network.domains 同時使用。experimental_network.dangerously_allow_all_unix_socketsbooleanexperimental_network.dangerously_allow_non_loopback_proxyboolean[experimental_network] 要求使用非回送接聽位址。啟用後,可能會讓 localhost 以外的來源存取接聽程式。experimental_network.denied_domainsarray<string>experimental_network.domains 同時使用。experimental_network.domainsmap<string, allow | deny>*.example.com、比對根網域及子網域的 **.example.com,以及全域 * 允許規則;建議採用範圍明確的規則,因為 * 會廣泛開放對公用網路的對外存取。發生衝突時,deny 優先。請勿與 experimental_network.allowed_domains 或 experimental_network.denied_domains 同時使用。experimental_network.enabledbooleanexperimental_network.http_portinteger[experimental_network] 要求使用的回送 HTTP 接聽連接埠。experimental_network.managed_allowed_domains_onlybooleantrue 時,只要沙盒網路要求處於啟用狀態,就只有管理員管理的允許規則有效;使用者新增的允許清單項目會遭忽略。即使沒有受管理的允許規則,使用者新增的網域允許規則也不會繼續生效。experimental_network.socks_portinteger[experimental_network] 要求使用的回送 SOCKS5 接聽連接埠。experimental_network.unix_socketsmap<string, allow | deny>featurestableconfig.toml 中的標準名稱;此處也支援文件中列出的應用程式專用需求索引鍵。features.<name>booleanfeatures.appsbooleanfeatures.browser_usebooleanrequirements.toml 中設為 false,即可停用智慧體操作的「瀏覽器」功能。features.browser_use_externalbooleanrequirements.toml 中設為 false,即可防止 Codex 透過 ChatGPT 瀏覽器擴充功能操作支援的瀏覽器,包括現有分頁和已登入的工作階段。features.browser_use_full_cdp_accessbooleanrequirements.toml 中設為 false,即可停用本機執行階段的完整 Chrome DevTools Protocol 存取權(包括瀏覽器開發人員模式),並防止 ChatGPT 桌面版應用程式啟用對應設定。若省略,則依一般產品規則決定是否可用。features.computer_usebooleanrequirements.toml 中設為 false,即可停用「電腦」、「錄製與重播」,以及相關的安裝或啟用流程。features.fast_modebooleanfast_mode 功能固定為啟用或停用。features.guardian_approvalbooleanfeatures.in_app_browserbooleanrequirements.toml 中設為 false,即可停用由使用者直接開啟及控制的內建瀏覽器窗格。features.in_app_updatesbooleanrequirements.toml 中設為 false,即可停用應用程式內更新。若省略此需求,更新仍預設為啟用。features.memoriesbooleanfeatures.multi_agentbooleanfeatures.plugin_sharingbooleanrequirements.toml 中設為 false,即可停用在工作區中分享本機建置外掛程式的功能。features.pluginsbooleanfeatures.remote_pluginbooleanfeatures.workspace_dependenciesbooleanfeedbacktablefeedback.enabledbooleanguardian_policy_configstring[auto_review].policy。空白值會被忽略。hookstableconfig.toml 中內嵌 [hooks] 相同的事件結構描述。hooks.<Event>array<table>PreToolUse、PermissionRequest、PostToolUse、PreCompact、PostCompact、SessionStart、SessionEnd、SubagentStart、SubagentStop、UserPromptSubmit 或 Stop。hooks.<Event>[].hooksarray<table>hooks.<Event>[].hooks[].additionalContextLimitintegerhooks.<Event>[].hooks[].asyncbooleanhooks.<Event>[].hooks[].commandWindowsstringcommand_windows。hooks.managed_dirstring (absolute path)hooks.windows_managed_dirstring (absolute path)in_app_browsertablein_app_browser.allow_external_browser_settings_importbooleanfalse 可防止使用者將外部瀏覽器的設定或瀏覽資料匯入內建瀏覽器。設為 true 或省略此設定時,只要其他產品檢查允許,匯入功能就仍可使用。此設定僅供管理用途,無法透過 config.toml 覆寫。log_dirstring (path)marketplacestablerestrict_to_allowed_sources 為 true 時,規則會生效。marketplaces.allowed_sourcestablemarketplaces.allowed_sources.<name>tablesource 值會決定 Codex 解讀哪些同層欄位。marketplaces.allowed_sources.<name>.host_patternstringsource = "host_pattern" 時必填的正規表示式。Codex 會從 HTTPS、SSH 或 SCP 格式的 Git 來源解析出小寫主機名稱,再用此表示式比對。使用 ^ 和 $ 可要求完整主機名稱相符。marketplaces.allowed_sources.<name>.pathstring (absolute path)source = "local" 時必填的本機市集目錄。Codex 要求使用絕對路徑,並在正規化後比較路徑。marketplaces.allowed_sources.<name>.refstringgit 規則可選填的精確 Git ref。省略時,此規則允許相符程式碼庫的任何 ref。marketplaces.allowed_sources.<name>.sourcegit | host_pattern | localgit 指定單一程式碼庫、使用 host_pattern 透過正規表示式比對 Git 主機,或使用 local 指定單一目錄。marketplaces.allowed_sources.<name>.urlstringsource = "git" 時必填的 Git 程式碼庫 URL。Codex 會先將設定的 URL 與允許的 URL 正規化,再要求程式碼庫完全相符。marketplaces.restrict_to_allowed_sourcesbooleantrue 時,新增市集、安裝外掛程式、重新整理及執行階段載入作業都要求設定的市集來源符合 allowed_sources。OpenAI 精選的 Git 目錄(包括 API 金鑰目錄)也必須符合允許清單。隨附的工作區外掛程式及遠端安裝的工作區外掛程式不屬於此精選 Git 來源政策的範圍。mcp_serverstable<id>)與身分都必須相符,才能啟用 MCP 伺服器。任何已設定但未列於允許清單中(或身分不符)的 MCP 伺服器都會停用。mcp_servers.<id>.identitytablecommand(stdio)或 url(可串流 HTTP)其中之一。mcp_servers.<id>.identity.commandstring | tablecwd、env 或 env_vars。mcp_servers.<id>.identity.command.argsarray<table>cwd、env 或 env_vars。mcp_servers.<id>.identity.command.args[].expressionstringregex 引數比對器使用的規則運算式。運算式必須有效,且須比對完整的引數值。mcp_servers.<id>.identity.command.args[].matchexact | prefix | regexmcp_servers.<id>.identity.command.args[].valuestringexact 或 prefix 引數比對器使用的值。mcp_servers.<id>.identity.command.executablestringcommand 必須與其完全相符。mcp_servers.<id>.identity.urlstring | tableexact、prefix 或 regex 值比對器表格。mcp_servers.<id>.identity.url.expressionstringregex URL 比對器使用的規則運算式。運算式必須有效,且須比對完整的 URL 值。mcp_servers.<id>.identity.url.matchexact | prefix | regexmcp_servers.<id>.identity.url.valuestringexact 或 prefix URL 比對器使用的值。model_catalog_jsonstring (path)modelstable[models.new_thread] 資料表。models.new_threadtablemodels.new_thread.modelstringmodels.new_thread.model_reasoning_effortstringmodels.new_thread.service_tierstringpermissionstableconfig.toml 相同的設定檔欄位。permissions.<name>table: 開頭、使用保留名稱 filesystem,或與已載入組態中的設定檔同名。使用與 config.toml 相同的設定檔欄位;完整的設定檔結構描述請參閱權限指南。permissions.filesystem.deny_readarray<string>pluginstableplugins.<plugin>.mcp_serverstablemcp_servers 要求相同的確切身分與比對器形式。plugins.<plugin>.mcp_servers.<server>.identitytablecommand(stdio)或 url(可串流 HTTP)其中之一。plugins.<plugin>.mcp_servers.<server>.identity.commandstring | tableplugins.<plugin>.mcp_servers.<server>.identity.command.argsarray<table>plugins.<plugin>.mcp_servers.<server>.identity.command.args[].expressionstringregex 引數比對器使用的正規表示式。此表示式必須與完整的引數值相符。plugins.<plugin>.mcp_servers.<server>.identity.command.args[].matchexact | prefix | regexplugins.<plugin>.mcp_servers.<server>.identity.command.args[].valuestringexact 或 prefix 引數比對器使用的值。plugins.<plugin>.mcp_servers.<server>.identity.command.executablestringplugins.<plugin>.mcp_servers.<server>.identity.urlstring | tableexact、prefix 或 regex 值比對器資料表。plugins.<plugin>.mcp_servers.<server>.identity.url.expressionstringregex URL 比對器使用的正規表示式。此表示式必須與完整的 URL 值相符。plugins.<plugin>.mcp_servers.<server>.identity.url.matchexact | prefix | regexplugins.<plugin>.mcp_servers.<server>.identity.url.valuestringexact 或 prefix URL 比對器使用的值。remote_sandbox_configarray<table>hostname_patterns 與解析出的主機名稱相符的項目,會覆寫該需求來源的頂層 allowed_sandbox_modes。特定主機的項目目前僅能覆寫沙盒模式。remote_sandbox_config[].allowed_sandbox_modesarray<string>remote_sandbox_config[].hostname_patternsarray<string>* 代表任意字元序列,以 ? 代表單一字元。rulestable.rules 檔案合併的指令規則。要求中的規則必須具有限制性。rules.prefix_rulesarray<table>pattern 和 decision。rules.prefix_rules[].decisionprompt | forbiddenrules.prefix_rules[].justificationstringrules.prefix_rules[].patternarray<table>token 或 any_of 其中之一。rules.prefix_rules[].pattern[].any_ofarray<string>rules.prefix_rules[].pattern[].tokenstringsqlite_homestring (path)windowstablewindows.allowed_sandbox_implementationsarray<string>windows.sandbox 允許使用的原生 Windows 沙盒實作(elevated 和 unelevated)。清單不得為空。若兩者皆獲准使用且未選取模式,Codex 會優先使用 elevated。windows.sandbox_private_desktopboolean