Repository navigation
Description
Summary
Allow organization administrators to define model-provider allow and deny rules in organization-level guardrails.
These rules must apply automatically during provider routing. Developers must not need to modify requests, use presets, or select dedicated API keys.
Current limitation
Guardrails currently restrict models and providers independently. This cannot represent a conditional rule for one model-provider combination.
For example, an organization cannot express all three requirements in one organization-level guardrail:
- Claude + Amazon Bedrock: allowed
- Kimi + Amazon Bedrock: blocked
- Kimi + other providers: allowed
Blocking Amazon Bedrock at the provider level also blocks Claude on Bedrock. Blocking Kimi at the model level also blocks Kimi on every provider.
Proposed solution
Add model-provider pair rules to organization-level guardrails. Each rule would identify:
- One or more model slugs or model-family patterns
- One or more provider slugs
- An allow or deny action
The routing layer would evaluate these rules before it selects an endpoint or fallback provider.
Conceptual example:
{
"model_provider_rules": [
{
"models": ["anthropic/claude-*"],
"providers": ["amazon-bedrock"],
"action": "allow"
},
{
"models": ["moonshotai/kimi-*"],
"providers": ["amazon-bedrock"],
"action": "deny"
}
]
}The exact schema can differ. The key requirement is enforcement for the model-provider pair, rather than independent model and provider lists.
Expected behavior
- An administrator configures the policy once at the organization level.
- Every applicable request inherits the policy.
- Routing removes denied model-provider endpoints before endpoint selection and fallback.
- Other valid providers remain available for the same model.
- A request cannot override or weaken the organization-level policy.
- Routing returns a clear error when no eligible endpoint remains.
Why this matters
- It prevents accidental use of disallowed model-provider combinations.
- It supports provider-specific commercial, compliance, and data-governance requirements.
- It keeps policy enforcement out of application code.
- It avoids separate API keys or presets for each model family.
- It allows organizations to keep using the same provider for approved models.
Related documentation
- Guardrails: https://openrouter.ai/docs/guides/features/guardrails
- Provider routing: https://openrouter.ai/docs/guides/routing/provider-selection
Filed from Slack by Wedge
Activity