Chapter 05 · Section I · 12 min read
5.1 IAM: API, Bedrock, Vertex, managed credentials
Three authentication paths for enterprise Claude Code — direct Anthropic API, AWS Bedrock, and Google Vertex — and the credential-management story that goes with each.
At the individual level, Claude Code auth is one API key. At the enterprise level, three things change: the auth method options widen (Bedrock, Vertex), credential storage moves off developer laptops, and policies are enforced centrally rather than per-user.
The three auth methods
1. Direct Anthropic API.
The default. Configured with ANTHROPIC_API_KEY. Simplest; single provider; cost billed directly to your Anthropic account. Works everywhere Claude Code runs.
2. Amazon Bedrock.
For teams already on AWS. Auth is standard AWS credentials (IAM roles, STS, whatever your org already uses). Cost billed via AWS. Enable with:
{
"provider": "bedrock",
"aws": {
"region": "us-east-1",
"profile": "engineering"
}
}
Uses the AWS SDK’s credential chain — IAM role on EC2, ~/.aws/credentials on a laptop, AWS_ACCESS_KEY_ID in an env var, whatever.
3. Google Vertex.
For teams on GCP. Auth is standard GCP credentials — service accounts, Workload Identity, ADC.
{
"provider": "vertex",
"vertex": {
"project": "my-gcp-project",
"location": "us-central1"
}
}
When each is right
- Direct API — small teams, individual developers, or anyone who values setup simplicity over org-wide billing.
- Bedrock — orgs whose procurement and cost centres already flow through AWS; teams that need SOC / compliance guarantees inherited from AWS’s shared responsibility model.
- Vertex — same story for GCP.
Bedrock and Vertex are functionally equivalent for Claude Code purposes; the choice is about which cloud your org already lives in.
Managed credentials on laptops
For a company running Claude Code across dozens or hundreds of developers, do not distribute API keys by hand. Two patterns work:
SSO + short-lived tokens.
Wire Claude Code to an SSO provider that mints short-lived tokens for the underlying provider (Bedrock STS, Vertex Workload Identity Federation). Tokens refresh automatically; users authenticate once via SSO.
Vault-integrated auth.
For companies on HashiCorp Vault or similar: a small init script fetches the credential from Vault on session start. No key sits on the laptop.
Policy enforcement
Beyond auth, enterprise deployments typically want central policies:
- Model allowlist — only these models can be called.
- Cost ceiling per user / per session.
- Region restrictions — data must stay in a specific geography.
Bedrock and Vertex give you the underlying provider knobs. Claude Code additionally supports a managed settings file (/etc/claude-code/managed-settings.json on Linux, equivalent paths on macOS/Windows) that admins can lock down.
Check your understanding
Quick check
—