Skip to main content
Guardrail Rules define conditions under which evaluators are applied to requests passing through the AI Router. A guardrail is only triggered when its rule conditions are matched, not on every request.
Guardrail Rules are an Enterprise-only feature. Guardrail Rules cannot be invoked directly in code. They are enforced automatically when a matching request is detected.

Visibility

  • Global rules: visible to workspace administrators only.
  • Project rules: visible to all members of the scoped project.

Creating a guardrail rule

From the Guardrails list, click Add New Rule. A panel opens on the right with the following fields.
Create Guardrail Rule

General

FieldDescription
Rule NameA display name for the guardrail rule.
DescriptionOptional context for administrators.
Enable RuleToggle to activate or deactivate the rule. When enabled, the rule is active and applied to matching requests.
ProjectScope of the rule. Global (all projects) applies the rule workspace-wide. Selecting a specific project restricts it to requests within that project only.

Evaluators

Select the Evaluators to run when this rule is triggered. Click Add Evaluator to attach one or more evaluators from the scoped project.

Rule Builder

The Rule Builder constructs the match conditions that determine when the guardrail is triggered. Clicking Add opens a dropdown with the following condition types:
ConditionDescription
HeaderMatch on a request header name and value.
ModelMatch on the model being called.
IdentityMatch on the identity making the request.
MetadataMatch on metadata attached to the request.
ProjectMatch on the project scope of the request.
You can also click Add group to nest conditions into a logical group. Multiple conditions within a group are joined with and. Groups themselves can be joined with either and or or. Select the operator between groups to control how they combine. Each condition can be removed with . The builder generates a CEL (Common Expression Language) expression shown read-only in the CEL Expression Preview below. The guardrail is only triggered when the expression evaluates to true.