December 4, 2026 · Cloudflare
Action needed
AI Gateway - Control spend and model access with AI Gateway policies
What changed
AI Gateway policies: Control model access and per-user or team spend using Cloudflare Access identity; replaces spend limits.
You can now control who can use which models and providers on your gateway, and how much each user or team can spend, with AI Gateway policies. Policies use the verified identity of the caller from Cloudflare Access, such as the user's email or identity provider (IdP) groups, or values you pass in custom metadata.
With policies, you can:
- Give a team or an email domain a shared monthly budget.
- Cap spend for each individual user, including inside a shared team budget.
- Block an IdP group from expensive models, or allow it to use only specific models.
Each policy targets an identity and a set of models or providers, then allows, blocks, or caps matching requests. Spend caps reset hourly, daily, weekly, or monthly on UTC boundaries. Use Test policies in the dashboard to check how your policies handle a request before it reaches real traffic.
The following policy blocks members of the contractors IdP group from all Claude Opus models:
{
"name": "Block contractors from Claude Opus",
"actor": "company:all",
"resource": { "models": ["anthropic/claude-opus-*"] },
"condition": "\"contractors\" in cf.user.groups",
"action": { "type": "block" }
}
Policies replace spend limits, which are now deprecated. Existing spend limit rules continue to work. To move them to policies, refer to Migrate from spend limits.
For more details, refer to the Policies documentation.
Free. Unsubscribe any time.