All posts
AI / ML

Running Claude Code and Codex Through Your Own AWS Account: A Team Setup Guide

By

October 25, 2026

8 min read

Claude Code talks to Amazon Bedrock with one setting, and Codex has been on Bedrock since June 2026. How to set either up for a whole team (SSO, pinned models, prompt caching, guardrails, per-team costs) and the mistakes that make the bill or the security review go badly.

Claude Code
Codex
Amazon Bedrock
Coding agents
IAM Identity Center

Why route coding agents through Bedrock

A coding agent reads your source, runs commands and sends large chunks of code to a model. Through a vendor subscription, that traffic goes to the vendor's API under accounts you manage separately. Through Bedrock, it goes to a model endpoint in your AWS account: IAM decides who may call which models, CloudTrail records every call, Guardrails can filter content, and the spend lands on the bill you already reconcile. For many companies that turns a three-month security review into a configuration change.

Claude Code on Bedrock, the short version

  1. In a dedicated AWS account — Anthropic's documentation recommends one, for cost tracking and access control — submit the Anthropic use-case form once. With AWS Organizations, the management account can do it for every child account through the PutUseCaseForModelAccess API.

  2. Give engineers short-lived credentials through IAM Identity Center: aws sso login, then AWS_PROFILE. Claude Code's awsAuthRefresh setting can run the login for them when credentials expire.

  3. Set CLAUDE_CODE_USE_BEDROCK=1 and AWS_REGION. Engineers can also use the /setup-bedrock wizard, which writes the settings for them.

  4. Grant a narrow IAM policy: bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream, bedrock:ListInferenceProfiles and bedrock:GetInferenceProfile on your inference profiles and foundation models.

  5. Pin model versions in managed settings — ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL — so the whole team moves to a new model when you decide, not when a default changes.

Want a second opinion on this for your system?

Book a free 30-minute call. You'll leave knowing what we'd do first and roughly what it costs, whether or not you hire us.

The settings that pay for themselves

  • Application inference profiles per team, mapped with modelOverrides, so the cost dashboard shows who spends what. Budgets with alerts on each.

  • ENABLE_PROMPT_CACHING_1H for long sessions on large repositories — the 1-hour cache costs more to write than the 5-minute default, and saves far more when the same context is read all afternoon.

  • Guardrails, attached with the X-Amzn-Bedrock-GuardrailIdentifier and GuardrailVersion headers through ANTHROPIC_CUSTOM_HEADERS, where your policy requires content filtering.

  • ANTHROPIC_BEDROCK_SERVICE_TIER, where the model supports it — flex for unattended batch work, priority for interactive use under load.

  • availableModels with enforceAvailableModels in managed settings, so nobody routes around your choices.

Codex on Bedrock

AWS made Codex generally available on Bedrock on June 1, 2026 — the Codex app, CLI and IDE integrations, with all inference routed through Bedrock and billed per token, with no seat licences or per-developer commitments. The same account, Identity Center sign-in and cost tracking work for both, so teams can use whichever agent suits their work without a second procurement.

What the policy has to say

  • Which repositories agents may work in, and whether production credentials may ever be present in their environment (the answer should be no).

  • Which commands run without approval — tests, linters, builds — and which need a human: anything that deploys, deletes or touches infrastructure.

  • That agent-written code goes through the same review as anyone else's, and who is accountable for it (the engineer who merged it).

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of October 25, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.