LangChain’s Beta LLM Gateway Blocks Models Outside Access Policies
Organizations can set provider and model limits by organization, workspace, user, or API key. But a narrower rule replaces a broader catalog instead of adding to it.
Loading page…
Organizations can set provider and model limits by organization, workspace, user, or API key. But a narrower rule replaces a broader catalog instead of adding to it.
Listen to this story
LangChain’s beta LLM Gateway adds administrative enforcement for approved AI-provider and model catalogs. Policies can target an organization, workspace, user, or API key, with the most specific matching scope replacing broader permissions; overlapping rules at the same scope become more restrictive. Unauthorized requests receive HTTP 403 responses, and policy changes apply immediately. Administrators need organization:manage permission, and enabling a policy also blocks provider/model configuration routes.
API-key policies override organization, workspace, and user policies instead of inheriting or adding to them.
When multiple policies match at the same scope, a model must be allowed by every policy.
If no policy applies, all providers and models remain available through the gateway.
LangChain’s beta LLM Gateway supports model access policies that let organizations decide which AI providers and models can be called through the service. A request for a provider or model outside an applicable policy is blocked rather than sent onward.
A policy can allow every model offered by a provider or name only selected models. It can govern an entire organization, a workspace, an individual user, or one API key. That gives administrators a choice between setting a common approved catalog and assigning a different catalog to a particular person or credential.
LangChain ranks policy specificity from API key to user, workspace, then organization, and applies only the most specific matching tier. A key permitted to use OpenAI and Gemini, for example, would not also inherit Anthropic access from an organization policy that permits OpenAI and Anthropic.
The same-tier behavior runs the other way: when multiple policies match at one tier, a model must be permitted by all of them to remain available. That makes overlapping rules more restrictive, while a more-specific scope creates a distinct replacement catalog.
The gateway returns a 403 response for requests outside a policy. If no policy applies, all providers and models remain available. While a policy is active, the gateway also blocks its provider- and model-configuration routes.
The beta capability does not support custom model providers. Creating or managing a policy requires the organization:manage permission, and saved changes take effect immediately. The design therefore offers quick control over approved provider access, but not over unusual custom-provider setups.
Loading discussion...
Join the conversation
Explain whether replacement rules improve control or create risk.
Be the first to share a perspective or an experience.
Reader comments
Newest comments first. Replies stay oldest first.