Reasons for Integrating Codex and Bedrock
As developers increasingly use OpenAI Codex to navigate unfamiliar codebases, perform modifications, and handle repetitive engineering tasks, platform teams are facing new challenges. The key issue is how to integrate tools like Codex into the enterprise environment without creating "a second model access, identity, or operational stack."
The post titled "OpenAI Codex on Amazon Bedrock" published on the AWS Machine Learning Blog provides a concrete architecture and operational guide to address this issue. Codex itself continues to run on developer workstations, and the main design choices revolve around how model requests reach Amazon Bedrock and where to apply policy and operational controls.
"Codex continues to run on developer workstations. The main design choices depend on how model requests reach Amazon Bedrock and where the organization applies policy and operational controls."
Comparison of Three Rollout Paths
The article defines three approaches that organizations can choose from based on their control requirements. Each has different placements for identity, routing, policy, telemetry, and operational ownership.
| Path | Applicability | Key Features | Operational Overhead |
|---|---|---|---|
| Native AWS Access | Sufficient pilot with AWS identity and IAM control | Most intuitive starting point, no separate gateway needed | Low |
| AgentCore Gateway | AWS managed gateway infrastructure, routing, Guardrails needed | Provided as a feature of the Amazon Bedrock AgentCore platform | Medium |
| LLM Gateway | Organizations wanting to enforce control in the request path, operating existing gateways | Platform teams can enforce policies in the request path | High |
The article emphasizes that "if the most intuitive path meets current requirements, it usually has the lowest operational overhead." Building a custom gateway is an advanced version of the LLM Gateway pattern and is not a quick start.
Detailed Procedure for Native AWS Access Pilot
A specific procedure for starting a least privilege pilot with the recommended default, Native AWS Access, is included in the open-source repository "Guidance for Codex on AWS." The pilot consists of three validation stages.
Step 1: Log in with Workforce Identity Provider
Employees log in through the identity provider they are already using. In the example, Okta handles authentication via SAML and provisions users and groups to IAM Identity Center through SCIM (System for Cross-domain Identity Management). IAM Identity Center issues temporary AWS credentials used by Codex.
- The identity provider is not configured for Codex
- Create a pilot user-only group in the workforce identity system and provision it to IAM Identity Center
- Assignments are limited to the pilot scope
Step 2: Direct Validation of Amazon Bedrock Runtime
Before configuring Codex, log in with the IAM Identity Center profile for AWS CLI and directly invoke Amazon Bedrock Runtime. This step is to separate AWS access issues from Codex configuration issues.
```bash # Example: Validate model invocation after creating a session with the profile aws sts get-caller-identity --profile codex-pilot aws bedrock-runtime invoke-model ... ```
If it fails, first resolve profile, region, model or inference profile access permissions, and IAM permissions.
Step 3: Configure Codex Provider and Execute Safe Operations
- Model Value: Use Codex model ID (e.g., GPT-5.6 Sol)
- Profile: Select AWS IAM Identity Center session
- Region: Specify the AWS region Codex will use
- Settings are stored at the user level or managed configuration to prevent the repository from changing the provider
Finally, execute read-only safe operations in a non-production repository to verify the Codex configuration.
- workforce IdP login
- obtain IAM Identity Center session
- directly invoke Bedrock Runtime validation
- configure Codex provider
- execute safe operations in non-production repository
- collect evidence and validate rollback
Identity Isolation Validation and Observability
Before adding pilot users, two user identity isolation checks are mandatory. A single user cannot verify isolation. The validation items are as follows.
- Identity: `aws sts get-caller-identity` returns the expected IAM Identity Center assumed role session
- Model Access: The pilot profile approves model invocation through the selected API and region for testing
- Codex Access: The user completes safe read-only operations in the non-production repository, securing evidence of the expected request path
- Evidence and Rollback: Confirm the existence of identity, invocation, audit, and optional telemetry records, then remove configuration or IAM Identity Center assignments, handle active sessions (follow procedures or wait for expiration), and confirm denial of new invocations
Observability Stack
The article presents AWS Distro for OpenTelemetry (ADOT) and Amazon CloudWatch as the basic configuration for observability. Related settings are included in the quick start repository. This allows for the collection of evidence of the request path, allocation of usage, tracking of costs, and integration of audit logs.
Gateway Options for Operational Control
As organizations expand beyond the pilot stage, there may be control requirements that Native AWS Access cannot meet. Two gateway options address this.
AgentCore Gateway
Amazon Bedrock AgentCore is a platform for building, connecting, and optimizing large-scale agents across all frameworks and models. Within it, AgentCore Gateway is suitable for teams that want:
- Routing with AWS managed gateway infrastructure
- Application of Amazon Bedrock Guardrails
- Integration of relevant control features
LLM Gateway / Custom Gateway
Suitable for organizations already operating a gateway or wanting to enforce control directly in the request path. Platform teams can enforce authentication, routing, policy, telemetry, cost allocation, and MCP (Model Context Protocol) server allowlisting in the request path. Custom integration is an advanced version of this pattern.
Considerations and Next Steps for Practical Application
The article summarizes six key questions that must be decided before rollout.
- Who can use the service?
- Which models and regions are approved?
- Where does the configuration reside?
- What telemetry will be collected?
- How will usage be allocated?
- What technologies or MCP servers are allowed?
Answers to these questions will lead to the selection of the approach path. The "Guidance for Codex on AWS" repository includes quick starts for architecture such as Native AWS Access, AgentCore Gateway, LiteLLM on ECS, Portkey, ADOT, and CloudWatch settings, allowing for immediate pilot initiation.
Availability of supported models (Sol, Terra, Luna) by region should be pre-verified in the "Supported models by AWS Region in Amazon Bedrock" document. The requirement for inference profiles also varies by model and API.
The pilot validation video visually demonstrates the entire sequence (workforce login → Bedrock Runtime validation → Codex provider configuration → safe pilot operations) and the evidence to be collected. This can help align the checklist order and evidence collection criteria.