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.
Listen to this story
The audio brief
Story brief
3 key pointsLangChain’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...
- 01
API-key policies override organization, workspace, and user policies instead of inheriting or adding to them.
- 02
When multiple policies match at the same scope, a model must be allowed by every policy.
- 03
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 shared catalog or a tailored exception
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.
Four places a policy can apply
- Organization: all users and workspaces in the organization.
- Workspace: all users in one workspace.
- User: one individual user.
- API key: one specific credential.
Overrides are replacements, not additions
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.
A gate with clear limits
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.
Sources
- docs.langchain.comModel access policies - Docs by LangChain
Loading discussion...
Reader comments
Newest comments first. Replies stay oldest first.