Configure the ChatGPT desktop app with Amazon Bedrock in AWS GovCloud (US)
A step‑by‑step guide shows how to configure the ChatGPT desktop app to use Amazon Bedrock in AWS GovCloud (US) with secure IAM, profile‑based authentication, and restricted config files.

Configuring the ChatGPT Desktop App with Amazon Bedrock in AWS GovCloud (US)
The ChatGPT desktop application now supports Amazon Bedrock in the AWS GovCloud (US) regions, enabling organizations with strict data‑residency and security requirements to run OpenAI models—such as the general‑purpose Work model and the Codex coding agent—without leaving the GovCloud network. This guide walks you through the three core steps needed to set up a controlled, policy‑driven deployment that leverages IAM, AWS SSO, and local configuration files.
---
1. Prepare Authentication and IAM Access
- Select an approved GovCloud account – Use an AWS account that resides in `us-gov-west-1` (or the equivalent GovCloud region). The account must be part of your organization’s security baseline.
- Create or identify an IAM identity – Grant the identity the `bedrock:InvokeModel` permission for the specific model ARN you intend to use (e.g., `arn:aws:bedrock:us-gov-west-1::foundation-model/...`). Include any additional permissions required for logging or monitoring.
- Choose an authentication method:
API‑key – Generate a Bedrock API key in the console and store it securely. AWS SDK credential chain – Preferred for GovCloud because it integrates with IAM Identity Center (SSO) and supports temporary credentials.
- Configure a named profile – For example, add the following to `~/.aws/config`:
``` [profile codex-gov] region = us-gov-west-1 ssostarturl = https://my-sso.awsapps.com/start ssoregion = us-gov-west-1 ssoaccountid = 123456789012 ssorole_name = BedrockUser ``` The corresponding SSO session will be cached automatically; no long‑lived keys are written to disk.
- Set the environment variable (optional) – If you prefer a bearer token, place it in `~/.codex/.env` (Linux/macOS) or `%USERPROFILE%\.codex\.env` (Windows) as `AWSBEARERTOKEN_BEDROCK=…`. The desktop app will prioritize this token over the profile.
---
2. Create the Required Configuration Files
The ChatGPT desktop app reads two TOML files before launch:
| File | Typical location (per OS) | Purpose | |------|---------------------------|---------| | `config.toml` | `~/.codex/config.toml` (Linux/macOS) or `%USERPROFILE%\.codex\config.toml` (Windows) | User‑level settings such as model selection, UI preferences, and optional logging. | | `requirements.toml` | `/etc/codex/requirements.toml` (Linux/macOS) or `%ProgramData%\OpenAI\Codex\requirements.toml` (Windows) | Administrator‑controlled policy file that locks down allowed features, network access, and sandbox modes. |
Sample `requirements.toml` for GovCloud
```toml [windows] allowedloginmethods = ["api"] allowedsandboxmodes = ["read-only", "workspace-write"] allowedapprovalsreviewers = ["user"] allowedapprovalpolicies = [{ granular = { sandboxapproval = false, rules = true, mcpelicitations = false, requestpermissions = false, skillapproval = true } }] allowedwebsearchmodes = ["disabled", "cached"] allowbrowserandcomputeruse = false allowappshots = false allowremotecontrol = false allowloginshell = false allowmanagedhooksonly = true checkforupdateonstartup = false mcpservers = {}
[feedback] enabled = false ``` Key points:
- `allowedloginmethods = ["api"]` forces the app to use Bedrock’s API rather than any proprietary OpenAI endpoint.
- Sandbox modes are limited to read‑only or workspace‑write, preventing arbitrary code execution on the host.
- Web search is disabled, ensuring no external data leaves the GovCloud network.
- Remote control and browser use are turned off to meet typical agency policies.
The `config.toml` file can reference the named profile and model ARN: ```toml [bedrock] profile = "codex-gov" region = "us-gov-west-1" modelarn = "arn:aws:bedrock:us-gov-west-1::foundation-model/anthropic.claude-v2" usezdr = true # Zero Data Retention ``` Setting `use_zdr = true` tells Bedrock to process prompts in memory only, without persisting them to durable storage.
---
3. Launch, Initialize, and Verify the Deployment
- Start the desktop app – Run the executable (or `codex-cli start`). The app reads `requirements.toml` first; if any policy is violated, it aborts with a clear error message.
- Authenticate – The app will look for `AWSBEARERTOKEN_BEDROCK`. If absent, it falls back to the SDK chain and loads the `codex-gov` profile.
- Test a simple request – In the Work pane, ask a non‑sensitive question such as “What is the current UTC time?” Verify that the response appears and that the request URL in your VPC flow logs points to `bedrock.us-gov-west-1.amazonaws.com`.
- Validate network restrictions – Use a packet capture or VPC flow log to confirm that outbound traffic is limited to the Bedrock endpoint and that no connections to public OpenAI domains exist.
- Document the outcome – Capture the app version, profile name, model ARN, and a screenshot of the successful request. Include the `requirements.toml` hash to prove that the policy file has not been altered.
---
Closing Thoughts
By routing ChatGPT desktop traffic through Amazon Bedrock Mantle in AWS GovCloud (US), organizations can leverage powerful generative AI while keeping data within a FedRAMP‑authorized environment. The key to a compliant deployment is strict IAM scoping, profile‑based authentication, and a locked‑down `requirements.toml` that enforces sandbox and network constraints. Once the baseline configuration is verified, security teams can safely expand usage—adding additional models or integrating IDE plugins—while maintaining the same governance controls.
Source
Read original sourceWhy we picked this
Core AI infrastructure guide for deploying ChatGPT via Amazon Bedrock.