Guardrails Rule Sets
What Is Guardrails?
Guardrails is a collection of security policies (Rule Set) that can be applied to an API Key. It is used to: control spending limits, restrict the scope of model / provider access. Once created, it is displayed as a card.
Creating a Rule Set (5 Steps)
Creating a rule set involves, in order: entering a name and description, selecting the API Keys to apply, setting the budget and limits, configuring the access policy, and confirming creation.
- Name & Description: enter a name (required) and description
- Select API Keys: select the API Keys to which this rule set applies
- Budget & Limits: set the spending budget cap, reset period, and expiration
- Access Policy: set allow / block policies for models / providers
- Review & Create: review the configuration and create the rule set
Budget Rules (Budget Limit)
You can set a spending cap (USD) and a reset period (Never/Daily/Weekly/Monthly).
Budgets are tracked independently at the member level and the key level; the effective budget = min(member remaining, key remaining). If either is exceeded, the request is rejected. Different levels can have different reset periods and are calculated independently.
Model / Provider Access Policies
Access Policy offers two modes:
- allow-except (allow all, exclude specified): all providers / models are available, and the selected ones will be blocked.
- block-except (only allow specified, block others): only the selected providers / models are available; everything else is blocked.
How Rules Combine
- Allowlist takes intersection: stricter — all rules must be satisfied.
- Blocklist takes union: stricter — all blocked items take effect.
- Budget checked independently: budgets at each level are tracked separately; the effective budget follows whichever budget is exhausted first.