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

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

Agent Plan & Coding Plan

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

Seedance 2.5

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

繁體中文

Bedrock GovCloud 設定

設定 AWS GovCloud 中使用 Amazon Bedrock 的本機 Codex 工作流程

本指南介紹如何設定 Codex,通過 GovCloud 中的 Amazon Bedrock 執行推理。內容涵蓋 AWS 存取權限、受管裝置設定和網路控制。

Codex 設定參考

共同責任

請查閱 AWS 責任共擔模型及所選服務的文件,瞭解 AWS 提供哪些控制措施。你所在機構負責核准使用這些服務。

在受支援的部署中,Codex 使用 AWS 身份驗證向設定的 Bedrock 端點傳送推理請求。你的組織負責保障執行 Codex 的裝置安全,包括憑證、程式碼儲存庫、本機記錄以及已啟用的第三方服務。使用 GovCloud 進行推理並不意味著整個工作流程滿足你所在機構的要求。

驗證清單 · 功能設定

開始之前

請使用 26.1002.51308 或更高版本 的桌面應用,版本號可在 關於 中檢視。

準備事項 所需條件
AWS 存取權限 一個 AWS GovCloud 帳戶,具有存取將要使用的 Bedrock 模型的權限。
設定 經過稽核的 requirements.toml、獲批的網路目標地址和回滾說明。
裝置管理 系統設定或 MDM 存取權限,以及應用、裝置和智能體命令的網路策略。

1. 部署裝置要求

在啟動應用之前,通過系統設定或 MDM 部署 requirements.toml。有關檔案位置和 MDM 分發方式,請參閱託管設定。保護託管策略,並在第 3 步中,在執行 Codex 的電腦上驗證其設定。

建議的 requirements.toml

下面的預設 requirements.toml 有意採用嚴格限制。如果管理員接受額外功能帶來的風險,可以啟用這些功能。請參閱功能文件和網路控制文件。

requirements.toml

# Disable ChatGPT sign-in.
allowed_login_methods = ["api"]

# https://learn.chatgpt.com/docs/agent-approvals-security#common-sandbox-and-approval-combinations
allowed_sandbox_modes = ["read-only", "workspace-write"]

# Approval prompts are reviewed by the user.
allowed_approvals_reviewers = ["user"]
allowed_approval_policies = [
  { granular = { sandbox_approval = false, rules = true, mcp_elicitations = false, request_permissions = false, skill_approval = true } },
]

# Allow cached search only if your AWS GovCloud Region supports web search.
allowed_web_search_modes = ["disabled", "cached"]

# Block agent browser use and native-app control.
allow_browser_and_computer_use = false

# Appshots: https://learn.chatgpt.com/docs/appshots
allow_appshots = false

# Remote control: https://learn.chatgpt.com/docs/remote-connections#pick-up-work-from-another-device
allow_remote_control = false

# Managed hooks: https://learn.chatgpt.com/docs/enterprise/managed-configuration#enforce-managed-hooks-from-requirements
allow_managed_hooks_only = true

check_for_update_on_startup = false

# MCP servers, apps, and plugins are disabled by default.
# Admins can enable supported integrations after accepting the risks
# for their use case and configuring access and network controls.
# https://learn.chatgpt.com/docs/enterprise/managed-configuration
mcp_servers = {}

[features]
apps = false
enable_mcp_apps = false
plugins = false

# Enable the network proxy for sandboxed commands.
# https://learn.chatgpt.com/docs/agent-approvals-security#network-isolation
network_proxy = true

in_app_dictation = false
realtime_conversation = false

# Browser controls: https://learn.chatgpt.com/docs/enterprise/managed-configuration#disable-codex-feature-surfaces
# Note that both browser use and computer use are up to your organization's risk appetite.
# An agent using your browser or computer may navigate to any websites or applications that the
# computer has access to. OpenAI does not currently provide additional protections restricting
# the network paths that browser use and computer use may exercise.
in_app_browser = false
browser_use = false
browser_use_external = false
browser_use_full_cdp_access = false

# Computer Use: https://learn.chatgpt.com/docs/computer-use
# Enable after accepting the risks and configuring app and network access.
computer_use = false

# Set to true to let users update through the app.
# App-store, package-manager, and MDM updates are controlled separately.
# https://learn.chatgpt.com/docs/enterprise/manage-app-updates#turn-off-in-app-updates
in_app_updates = false

image_generation = false

# Memories: https://learn.chatgpt.com/docs/customization/memories
memories = false

# Computer History: https://learn.chatgpt.com/docs/customization/computer-history
chronicle = false

external_agent_memory_import = false

# We recommend that users review approval requests themselves.
# Admins can enable automatic review after accepting the risks for their use case.
# https://learn.chatgpt.com/docs/agent-approvals-security#automatic-approval-reviews
guardian_approval = false
guardianv2 = false

# Disable background skill-search experiments.
skill_search = false

# Hooks: https://learn.chatgpt.com/docs/hooks
hooks = false

# If you enable web search, use cached search through Bedrock Mantle
# where supported by your AWS GovCloud Region.
standalone_web_search = false

# Disable feedback submissions to OpenAI.
[feedback]
enabled = false

# Network controls for agent commands:
# https://learn.chatgpt.com/docs/enterprise/managed-configuration#configure-network-access-requirements
[experimental_network]
enabled = true
managed_allowed_domains_only = true

# No domains allowed by default. Add destinations approved for your use case.
domains = {}

# Add approved Unix socket paths here.
unix_sockets = {}

# Set to true when using an organization-approved upstream proxy.
allow_upstream_proxy = false

# Keep the command proxy bound to localhost.
dangerously_allow_non_loopback_proxy = false
dangerously_allow_all_unix_sockets = false

# Local/private networking: https://learn.chatgpt.com/docs/agent-approvals-security#local-and-private-destinations
allow_local_binding = false

# App network controls: https://learn.chatgpt.com/docs/enterprise/managed-configuration#control-desktop-app-network-destinations
[application.network]
enabled = true

# Example: Bedrock Mantle in us-gov-west-1.
# Replace this hostname with the Bedrock endpoint configured in config.toml.
[application.network.domains]
"bedrock-mantle.us-gov-west-1.api.aws" = "allow"

# OpenAI and ChatGPT endpoints.
# We recommend denying these endpoints to avoid any risk that user data is sent to commercial OpenAI infrastructure.
"api.openai.com" = "deny"
"chat.openai.com" = "deny"
"chatgpt.com" = "deny"
"ab.chatgpt.com" = "deny"
"platform.openai.com" = "deny"
"auth.openai.com" = "deny"
"gov.api.openai.com" = "deny"
"gov.chatgpt.com" = "deny"
"sdfedpreastus2.oaiusercontent.com" = "deny"
"o33249.ingest.us.sentry.io" = "deny"
"persistent.oaistatic.com" = "deny"
"oaisidekickupdates.blob.core.windows.net" = "deny"

# Windows only: https://learn.chatgpt.com/docs/config-file/config-reference#requirementstoml
[windows]
allowed_sandbox_implementations = ["elevated"]

2. 設定供應商路由和網路控制

在 config.toml 或託管預設設定中設定供應商、模型、區域和端點。使用者可以在 requirements.toml 設定的限制範圍內更改這些預設設定。

建議的 config.toml

以下範例使用 us-gov-west-1 區域中的 Mantle。請將模型 ID 和 AWS 設定檔替換為你的部署所用的值。如果使用其他受支援的區域或端點,請同時更新 URL、區域和網路策略。

此範例關閉了可選的診斷和資料共享功能。請勿將 AWS 憑證存放在 TOML 檔案中。請將 AWS 設定檔、憑證和憑證輔助指令碼存放在 Codex 無法修改的資料夾中。

config.toml

# Replace with your approved Bedrock model ID.
model = "openai.gpt-5.6-terra"
model_provider = "amazon-bedrock"
approval_policy = { granular = { sandbox_approval = false, rules = true, mcp_elicitations = false, request_permissions = false, skill_approval = true } }
sandbox_mode = "workspace-write"

# Set to "cached" only when supported by your model and GovCloud Region
# and approved for your deployment.
# https://docs.aws.amazon.com/bedrock/latest/userguide/web-search.html
web_search = "disabled"

# Example: Bedrock Mantle in us-gov-west-1.
[model_providers.amazon-bedrock]
base_url = "https://bedrock-mantle.us-gov-west-1.api.aws/openai/v1"
wire_api = "responses"
requires_openai_auth = false

[model_providers.amazon-bedrock.aws]
region = "us-gov-west-1"

# Replace with your AWS profile name.
profile = "codex-govcloud"

[sandbox_workspace_write]
# Command destinations are controlled by requirements.toml.
network_access = true

# Disable sending Codex usage analytics to OpenAI.
[analytics]
enabled = false

# OpenTelemetry exports are off by default.
# Admins can configure an approved collector for logs, traces, and metrics.
# https://learn.chatgpt.com/docs/config-file/config-advanced#observability-and-telemetry
[otel]
exporter = "none"
trace_exporter = "none"
metrics_exporter = "none"
log_user_prompt = false

此範例使用 AWS 憑證存取 Bedrock Mantle。如果使用 Bedrock Runtime 或閘道器,請按照供應商設定說明操作。

應用網路控制

將獲批的應用目標地址(包括 Bedrock)新增到 application.network.domains。將獲批的命令目標地址新增到 experimental_network.domains。

Codex 的網路設定不能替代裝置防火牆。

3. 驗證部署

  1. 確認策略已生效,且 Codex 正在使用預期的 AWS 憑證和 Bedrock 設定。
  2. 使用範例資料執行獲批的工作流程。
  3. 確認使用者設定無法覆蓋託管限制。
  4. 測試憑證無效或過期以及路由失敗的情況。確認內容不會傳送到未經核准的目標地址。

常見問題排查

問題 檢查內容
不支援的端點 向 OpenAI 確認已安裝的桌面應用和 app-server 版本是否支援該端點和模型。
AWS 帳戶或角色錯誤 檢查當前生效的憑證和所選的 AWS 設定檔。Bedrock API key 的優先順序可能高於設定檔。
限制未生效 確認執行 Codex 的電腦已載入預期的 requirements.toml。
功能仍不可用 檢視功能文件,瞭解所需設定和 Bedrock 支援情況,然後檢查網路控制。

功能設定

使用者無法覆蓋由 requirements.toml 強制實施的功能設定。

下表彙總了上述設定。開啟 表示在受支援的情況下允許使用;其他權限和網路控制仍然適用。

有關供應商支援情況,請參閱 Bedrock 功能可用性。

功能 預設狀態 備註
本機編碼、檔案、Git 和子智能體 開啟 —
本機定時任務 開啟 —
瀏覽器 關閉 包括內建瀏覽器、已連線的瀏覽器、智能體瀏覽器控制和開發者模式。
電腦使用和 Appshots 關閉 —
記憶和電腦歷史記錄 關閉 —
影像生成 關閉 不會阻止影像輸入或讀取現有影像檔案。
網路搜尋 關閉 快取搜尋需要模型和 GovCloud 區域支援。命令網路規則不會限制託管搜尋。
應用和外掛 關閉 —
已設定的 MCP 伺服器 關閉 管理員接受其使用場景的相關風險並設定存取和網路控制後,可以啟用獲批的伺服器。
互動式 MCP 應用 關閉 —
聽寫 關閉 —
自動審批稽核 關閉 —
遠端控制 關閉 SSH 連線單獨管理。
應用更新 關閉 —

啟用智能體瀏覽器使用或電腦使用功能還需要設定 allow_browser_and_computer_use = true。