AI Gateway → Guardrails is where you control what the gateway is allowed to do beyond plain LLM inference: which content/intent rules it enforces on every request, and which on-gateway SLM (small language model) classifiers run as additional guards.The page has eight tabs: Rules, Garden, Playground, Monitor, SLM Guardrails, Adversarial, Findings, and Anomalies. This page covers Rules, SLM Guardrails, and Anomalies. MCP servers have their own page: see MCP.
Rule-based content controls, on the Rules tab, applied to every request that flows through the gateway. Use these to redact PII, block prompt injection patterns, enforce keyword filters, or just log policy hits.
Block — reject the request, Warn — Allow but flag, Redact — replace matched content, Log — Record only.
Description
Free-form notes.
Apply to MCP
Toggle. When on, the rule also runs against MCP traffic on this gateway.
Keywords to block
One per line — for keyword-style categories.
Regex patterns (optional)
One per line — e.g. \b\d{3}-\d{2}-\d{4}\b.
Ignore case
Toggle for keyword/regex matches.
Rules are listed with Name, Category, Type (input / output / both), Action, Priority, Triggers, and Enabled. A built-in Test dialog lets you paste sample text and see which rules fire.
On-gateway small language models that classify, score, detect, or rewrite content. Use these when keyword/regex rules aren’t expressive enough — toxicity classifiers, jailbreak detectors, intent scorers.
The Anomalies tab surfaces when one API key’s usage on one gateway drifts from the baseline Guardway learned for it — an early signal of a stolen or misused key. It’s a detection surface, not a rule you author.