Learning resourcesReviewed · Anthropic

Claude apps gateway configuration

Claude apps gateway configuration is a reference for administrators managing company access to Claude, but implementing it requires gateway infrastructure and coordinated server and client settings. It explains gateway.yaml options for company sign-in, PostgreSQL, model providers, access policies, spend enforcement and telemetry.

Researched 15 Nov 2026

In short.

Claude apps gateway configuration is a YAML reference for platform and IT teams centralizing Claude access, but a working deployment also needs PostgreSQL, an identity provider and separately configured developer machines. Its most useful detail concerns behavior that configuration names alone do not explain: provider failover, policy inheritance, client enforcement, database outages and telemetry loss. It documents extensive version requirements and examples, but does not establish total operating cost, production performance or independently verified security outcomes.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is the complete selected page at https://code.claude.com/docs/en/claude-apps-gateway-config.md. The report addresses its required configuration blocks, optional administration and policy controls, provider routing, guardrail and proxy warnings, Desktop behavior, telemetry, HTTP tuning, load-test mode, complete example and client-side settings. Linked pages, the documentation index, software binaries and provider documentation are excluded. Examples are treated as documentation rather than proven deployments. No execution, independent compatibility verification, benchmark or production journey supports the findings; licensing and total cost remain unknown.

The overview

Identity

This is the Claude documentation reference for gateway.yaml, the server configuration file for Claude apps gateway. It is a learning resource for operating a gateway, rather than a downloadable gateway package or an assistant skill. The source address is [https://code.claude.com/docs/en/claude-apps-gateway-config.md].

The page covers the required listener, identity, session, database and inference-provider settings, followed by optional administration, policies, telemetry and HTTP controls. It also supplies a complete reference configuration and explains the separate settings needed on developer machines.

Assessment

The reference is particularly useful when a team needs predictable behavior across company sign-in, multiple model providers and centrally delivered settings. It explains consequential defaults, including first-match policy selection, unrestricted client addresses unless constrained, and spend enforcement that fails open during a database outage.

Its breadth makes it better suited to configuring or troubleshooting a deployment than learning the basics of hosting services. The complete example needs adaptation: it is not evidence that a particular deployment is secure or ready for production. Runtime reliability, capacity and configuration correctness remain unverified.

Users

The main audience is platform engineers, IT administrators and developers responsible for shared Claude access. Identity administrators will need the OIDC claim and refresh-token details; finance and operations teams will find spend controls, attribution and telemetry configuration relevant.

Organizations routing different teams to separate cloud accounts or projects have a clear use case. Individual developers using a single provider have less need for this infrastructure, although the client-side settings explain how managed gateway sign-in affects their sessions. Beginners will need familiarity with YAML, company single sign-on and service hosting to implement the reference confidently.

Capabilities

The gateway can authenticate developers through OpenID Connect, restrict admission by email domain or group, and issue its own session tokens. Inference upstreams include the Anthropic API, Amazon Bedrock, Bedrock Mantle, Claude Platform on AWS, Google Cloud Agent Platform and Microsoft Foundry. Model mappings translate client-facing IDs into provider-specific IDs or deployment names.

Optional controls include ordered provider failover, group-based upstream routing, cross-account AWS roles, per-developer AWS attribution, spend limits and contracted-rate estimates. Managed policies deliver model restrictions, tool permissions, environment variables, hooks and remote MCP server definitions. Some settings are enforced by the gateway; others depend on clients.

The page also documents Claude Desktop configuration, OTLP telemetry forwarding, network access controls, request limits and a canned-response load-test mode. Bedrock guardrail configuration is supported, with important exclusions for other providers and some request content.

Using it

Requirements

A deployment needs Claude Code providing the gateway command, a PostgreSQL database, an OIDC application registration and credentials or workload identity for at least one inference provider. The database role needs permission to create and alter tables because the gateway applies migrations at startup and on upgrade. Session signing requires a secret with at least 32 bytes of entropy.

A non-loopback listener requires listen.public_url, even when a reverse proxy terminates TLS. Developer machines need separate managed settings to locate the gateway. Provider-specific requirements include cloud permissions, model access and, for Microsoft Foundry, mappings to administrator-chosen deployment names.

Versions must match the chosen features. Examples include upstream group routing from gateway v2.1.314, layered policies from v2.1.316, and login notices from v2.1.319. Applying code policies in Claude Desktop's Code tab also requires Desktop 2.9939.2 or later, machine-level gateway settings and private-network HTTPS access. The page does not specify one minimum version covering every deployment.

Mechanism

The gateway reads configuration and expands secret references once at startup. Environment references use ${VAR}; file references use ${file:/absolute/path} and must occupy the entire field value. Configuration is validated at boot, although validation of managed settings occurs after the database connection and migrations.

Requests try eligible upstreams in order. Failover covers 5xx, 429, 401, 403, 404, missing-endpoint 501 responses and timeouts; other 4xx responses do not trigger it. A notable exception preserves a proxy's per-user 429 when forward_user_identity is enabled and the request carried the developer's email. Built-in model mappings can change the ID sent upstream without excluding that upstream; custom model IDs can restrict routing to their explicit mappings.

Managed policies normally select the first matching role policy and merge it with a catch-all base. Layered mode combines matching policies, but allowlists still come from the first matching policy that sets them; deny lists accumulate. Model restrictions are checked server-side, while tool permissions and hooks depend on Claude Code. Group changes propagate through refreshed session tokens rather than a gateway-maintained user directory.

Setup

Start with the five required blocks: listen, oidc, session, store and upstreams. Supply the actual identity-provider registration, database and provider access, and load secrets through environment variables or mounted files. The documented launch command is claude gateway --config /path/to/gateway.yaml. File changes require a restart to take effect.

Configure the server's network boundary as well as its listener. The page recommends keeping the gateway and its frontends unreachable from the public internet. trusted_proxies should name only frontends that reliably append the connection address; public_url defines the gateway's origin and does not establish client-IP trust.

On developer machines, configure forceLoginMethod and forceLoginGatewayUrl in the applicable managed source. The page includes parentSettingsBehavior set to merge for embedded Desktop sessions. To require gateway-only sessions, allowedProviders can contain gateway, but that setting must stay off the gateway host because it prevents claude gateway from running there. Desktop additionally needs bootstrapUrl and a matching server policy with a desktop key.

Example

A hypothetical organization could route its payments and search groups to separate Bedrock accounts by giving each named upstream an exact IdP group list and its own assumed role. A shared upstream placed last would provide fallback for both groups and serve developers outside them. This illustrates the page's documented routing rules; it was not executed.

That shared fallback also weakens account isolation: a 403 from a team's upstream can move its request to another eligible upstream. For strict separation, the page describes non-overlapping group access and custom model IDs mapped only to the intended upstream.

The complete configuration's contractor policy illustrates another distinction. permissions.allow containing Read and Grep auto-approves those tools; it does not block every other tool. Actual restrictions require deny rules. A restricted model policy also needs an allowed starting model, using enforceAvailableModels and, for custom IDs, an explicit model setting.

Assessment & evidence

Limitations

Several defaults require deliberate decisions. An authenticated user matching no policy receives every catalog model and no managed settings. Spend checks run only with admin configured and fail open on PostgreSQL errors by default; fail_closed_on_error blocks everyone when the store is unreachable. Sign-in rate limits do not limit inference traffic.

Failover does not remember unhealthy upstreams, so each new request can incur the same failure delay. Non-Anthropic providers can wait up to one hour for a response to start; an explicit shorter timeout applies to their streaming requests from gateway v2.1.295, while non-streaming model requests can still wait an hour.

Bedrock guardrails do not extend to other providers, and Mantle cannot coexist with a configured Bedrock guardrail. Input tags leave some content uncovered, including tool definitions, tool-call inputs, images and PDFs; the page reports that tool results were not evaluated in Anthropic's word-filter testing. Proxy-only egress also transfers address-checking responsibility to the proxy.

Telemetry forwarding has no durable buffer or delivery retry, and clients receive success even when delivery fails. Logs and traces can contain commands, tool inputs and file paths. Canned load-test mode excludes provider capacity and network behavior, and returns filler instead of model output.

Reasoning

The documented architecture is a good fit when central identity, provider credentials, model controls and usage attribution justify operating a shared service. This assessment follows from the configuration's combined controls; it is not a measured comparison with direct provider access.

Security depends on distinguishing server enforcement from client behavior. Server-side model checks can reject unauthorized model requests, but tool rules need compatible clients. Network-delivered hooks and certain environment settings trigger approval dialogs in interactive Claude Code sessions; non-interactive sessions cannot show that dialog and apply the settings for that run.

Default first-match policies can omit a second group's restrictions, while layered policies can combine settings into unexpectedly permissive results. Desktop introduces further version and connectivity conditions, including cases where code settings do not apply. These details make explicit policy outcomes more useful than assuming that a successfully started gateway enforces every intended restriction.

Alternatives

The page points to direct Claude Code configurations for Bedrock, Claude Platform on AWS, Google Cloud and Microsoft Foundry. Direct access may suit teams that do not need a central gateway, but those linked guides are outside the supplied evidence, so their implementation and tradeoffs are not assessed.

For device policy delivery, the page also discusses MDM, operating-system policies and local managed-settings files. These are alternative policy sources rather than substitutes for provider routing or spend enforcement, and their precedence has exceptions.

For initial installation or hosting guidance, the reference directs readers to the gateway quickstart and deployment guide. It points to a separate spend-limits guide for setting caps through the Admin API. Those linked resources are not included here, and no comparative evaluation of third-party gateways is available.

Evidence

The evidence is the complete selected configuration page at [https://code.claude.com/docs/en/claude-apps-gateway-config.md], captured on 15 November 2026 at 00:01:31.987 UTC. Its recorded source revision is sha256:464a654cfffc0cbba6edeca61faeb10cdf9c1b202fd32d36d710c58d588e76c8.

The page supports the described configuration fields, defaults, examples, version requirements and failure behavior. Linked deployment, provider, security and settings pages were not supplied. Statements attributed to Anthropic's testing remain source-reported results, not independently reproduced findings.

No command, configuration, sign-in flow, provider request or load test was executed. Actual compatibility, enforcement, performance and operating costs are unverified.

Access & freshness

Costs

Total operating cost is unknown. The page does not establish gateway licensing charges, hosting costs, database costs, observability charges or a complete set of applicable inference prices. Its configuration rates do not constitute a price quote, and the complete example explicitly labels its rates as placeholders.

The pricing block changes USD estimates used for internal metering and, where configured, client cost displays. A multiplier changes the meter rather than the provider's bill. Overrides specify input, output, cache-read and cache-write rates per million tokens. Client displays may omit rates specific to failover upstreams or group-restricted routes, so they need not match gateway accounting.

One-hour cache writes cost more than five-minute writes; metering that higher rate requires gateway v2.1.286 or later. Per-developer AWS attribution adds an STS call per active developer per hour per gateway replica. Without Bedrock CountTokens permission, counting an abandoned request can fall back to a one-token inference request. The resulting deployment-specific charges are unknown.

Rights

The supplied page does not state a documentation reuse license, software license or redistribution grant. Rights to redistribute the captured documentation or gateway software are therefore unknown from this evidence.

The page explicitly warns that failover between cloud providers, or to the direct Anthropic API, changes the agreement, geography and other terms governing a request. It does not establish the applicable contracts, provider retention terms or residency guarantees for a particular deployment.

Freshness

The capture date is known, but the supplied page gives no publication date or last-updated date. It documents feature thresholds through gateway v2.1.321, including acceptance of new subkeys in Desktop settings. These thresholds do not establish the latest available release.

Version sensitivity is substantial: unsupported keys often prevent startup, while older clients can ignore particular settings. The page repeatedly requires upgrading every replica before introducing new keys and removing incompatible keys before rollback. Static keys, session secrets and client certificates are read at startup, whereas supported cloud credential chains and federation flows refresh credentials automatically.

Actions

Before implementation, identify the required clients, identity claims, provider accounts and isolation boundaries. Match every chosen field to its documented gateway and client requirements. Decide whether database failure should preserve inference availability or stop all requests, and whether failover may cross accounts, providers or geographies.

Validate policies against a throwaway PostgreSQL database before deployment, because an unavailable database prevents the gateway from reaching managed-policy validation. Check expected outcomes for users in multiple groups, users in no policy, missing refresh-time group claims and sessions starting on restricted models. For Desktop, verify that the intended Code tab settings actually apply.

If evaluating capacity, use a separate empty database for canned load-test mode and keep it off gateways used by developers. Follow with a limited real-provider pilot, as the page recommends, to assess the provider path. Verify telemetry delivery at its destination because client success does not confirm receipt. These are suggested validation steps; no results are available.

Evidence for this report

selected-page.txtselected · checked 2026-11-15