How policies apply
- Every matching restriction must pass
- Rules within a policy are unordered
- All matching policies compose
- Policies are traversed by ID for deterministic evaluation
- The first matching fallback policy in that order supplies the fallback plan
- Exact duplicate rules are invalid
- Editing one policy cannot change another policy
Configure a policy
Choose a target
Workspace
Apply the policy to all current and future inference keys and playground sessions in the workspace:User
Target a human user or service account to apply the policy to all inference keys associated with them, current and future:Inference keys
Target specific keys. Keys created later are not included:Choose requests to match
Match all requests:tools, reasoning, and structured_output. Matching uses the original request, including when a fallback model handles it.
Choose actions
Add one action to each rule. A policy can contain multiple rules, and matching restrictions from all policies apply.Allowed models
Limit matching requests and fallbacks to the listed catalog models:Allowed providers
Limit primary and fallback routes to the listed providers:Credential access
Allow credentials from the listed scopes. Matching credential rules intersect.airmux chooses the most specific populated allowed scope in workspace, organization, instance order:
Strict parameter support
Reject a route ifairmux would otherwise remove an unsupported caller-supplied parameter:
Model price limit
Set maximum catalog prices in USD per million tokens. Both input and output prices must meet the limits:Request limits
Reject a request that explicitly asks for more output tokens than the limit. If it omits the limit,airmux does not invent one:
Budget
Limit matching usage to a USD amount per UTC calendar day or month. Useshared to combine spend across the target or per_key to track each inference key separately:
Deny requests
Reject matching requests with403 policy_denied and the configured message:
Model fallbacks
Try backup models for rate limits, upstream errors, or timeouts:max_attempts is 2–5 and includes the primary call. timeout_ms is 100–120,000. Invalid requests, policy denials, and authentication failures do not trigger model fallback. An upstream authentication failure may try another credential in the selected scope.
Create a policy
Use either the CLI or the management API. This example creates a workspace-wide output limit. The CLI uses your active organization and workspace context; the API path names both explicitly. Save this aspolicy.json:
- CLI
- cURL
{"data": ...}. The webapp can also create and edit policies with the same target, match, and action options.