Claude Code's Gateway Problem: How Enterprises Are Taking Control (and Why It Matters)
Anthropic shipped the Claude apps gateway in early July 2026, giving enterprises a way to control who uses Claude Code, what models they access, and how much they spend, all from a single control plane. The gateway runs as a self-hosted container backed by a PostgreSQL database, listens on port 8080, and issues short-lived sign-in tokens that expire in one hour by default, eliminating the need for long-lived API keys sitting on developer laptops.
Before the gateway existed, rolling Claude Code out to a team meant handing each engineer a cloud credential and pushing configuration files to every machine manually. At scale, this approach falls apart: there's no way to see who's using what, no easy way to cap spending, and offboarding becomes a manual credential-rotation nightmare. The cost pressure is real. Claude Sonnet 5 runs at $2 per million input tokens and $10 per million output tokens through August 31, 2026, then rises to $3 and $15, while Claude Opus 4.8 costs $5 and $25 respectively, so an uncapped fleet of coding agents can build a bill quickly.
What Does the Claude Apps Gateway Actually Control?
The gateway handles five core responsibilities that replace tasks platform teams would otherwise script and maintain themselves:
- Identity Management: Acts as an OpenID Connect (OIDC) relying party against Google Workspace, Microsoft Entra ID, Okta, or any standards-compliant identity provider, issuing short-lived session tokens instead of static keys.
- Policy Enforcement: Enforces central managed settings by identity group, including allowed models, tool permissions, and environment variables, re-checked on every API call so local edits on a laptop change nothing.
- Telemetry and Attribution: Stamps usage metrics with verified email and group information from the signed session token, then ships data over OpenTelemetry Protocol (OTLP) to collectors like CloudWatch, Prometheus, Cloud Monitoring, Grafana, or Datadog.
- Routing and Failover: Holds upstream credentials and forwards inference to Amazon Bedrock, Claude Platform on AWS, Google Vertex, or Microsoft Foundry, with optional failover across regions or accounts.
- Spend Caps: Sets daily, weekly, and monthly limits per organization, group, or user, returning a 429 error once a cap is hit, metering tokens at list price.
The policy and telemetry controls are enforced server-side, not on the client, which makes them trustworthy rather than cosmetic. Editing the local managed-settings.json file on a developer's laptop changes nothing because the gateway re-checks the allowed-model list on every call. Rule updates reach the entire fleet within the hour.
How Does the Gateway Simplify Onboarding and Offboarding?
The gateway replaces manual credential management with identity-provider-based access control. Onboarding a developer becomes adding them to an IdP group; offboarding becomes removing them, after which their session fails at the next refresh. Nothing sensitive lands on the laptop: no service-account keys, no API keys, no project IDs.
On AWS, the gateway runs as a stateless container on Amazon ECS, Amazon EKS, or Amazon EC2, sits behind an internal Application Load Balancer with a TLS certificate from AWS Certificate Manager, and uses Amazon RDS for PostgreSQL to store short-lived sign-in state. Developers reach it over a private network, and the gateway calls the upstream with its IAM task role. On Google Cloud, the same binary runs as a stateless container on Cloud Run or Google Kubernetes Engine, with Cloud SQL for PostgreSQL holding device-code sign-in state and the spend ledger.
What Are the Limitations of Spend Caps?
The gateway's spend caps meter tokens at list price, which means committed-use discounts and negotiated rates do not show up in the gateway's numbers. The engineers who wrote the Vertex deployment guide are blunt about this limitation: treat the cap as a runaway-usage guardrail, not a substitute for bill reconciliation. If an organization already models coding-agent spend, the gateway works best paired with detailed cost analysis rather than relied upon as the sole cost-control mechanism.
How to Deploy the Claude Apps Gateway
Deployment varies by cloud provider but follows a similar pattern. Here are the key steps for each platform:
- AWS Deployment: The gateway reads a single gateway.yaml file at startup with secrets kept in environment variables. The Bedrock upstream uses the container's IAM role, so there are no static credentials to manage. To route through Claude Platform on AWS instead of Bedrock, swap the upstreams block in the configuration file.
- Google Cloud Deployment: Enable the Agent Platform, Cloud SQL, and Secret Manager APIs, then create a claude-gateway service account with roles/aiplatform.user. Write gateway.yaml, deploy to Cloud Run, and onboard developers through managed settings. The setup is four steps total.
- Upstream Options: The gateway supports four upstreams: Amazon Bedrock, Claude Platform on AWS, Google Vertex through the Gemini Enterprise Agent Platform, and Microsoft Foundry. Model IDs remain the same strings used on the Claude API, such as claude-sonnet-5 and claude-opus-4-8, with no Bedrock ARNs or inference profiles to wire up.
The gateway is delivered inside the same Claude Code CLI binary developers already run, so there's no separate agent to install. The /login flow is gateway-aware: the client picks up managed settings at sign-in and the gateway enforces policy on every request.
Why Is This Different From Older Approaches?
Before the gateway, enterprises had limited options for controlling Claude Code at scale. Developers either configured their own local settings or received pushed managed-settings.json files via device management. On Google Cloud, this meant setting CLAUDE_CODE_USE_VERTEX=1, pointing at a project, and granting roles/aiplatform.user per person. This works for a handful of engineers but falls apart at scale because there is no per-developer usage attribution and no easy way to cap spend.
The gateway closes that gap by centralizing identity, policy, telemetry, routing, and spend control in one place. Developers no longer need cloud credentials on their laptops, and platform teams no longer need to push settings to every machine manually. The result is a cleaner security posture, better visibility into who's using what, and the ability to enforce policy and spending limits across the entire fleet.