Overview
LLM Gateway includes enterprise-grade guardrails to protect your applications from harmful content, data leaks, and policy violations. Available on Enterprise plans.Guardrails require an Enterprise plan. Contact us at [email protected] to upgrade.
System Rules
Built-in detection for common security threats:apps/api/src/routes/guardrails.ts
Actions
Guardrails can take four actions:- block - Reject the request completely
- redact - Remove sensitive content and continue
- warn - Log violation but allow request
- allow - Bypass the rule
Configuration
Configure guardrails via the API:Get Current Configuration
Update Configuration
Custom Rules
Create organization-specific rules:apps/api/src/routes/guardrails.ts
Blocked Terms
Block specific words or phrases:Custom Regex
Match patterns with regular expressions:Topic Restrictions
Restrict conversations to specific topics:Guardrail Execution
Guardrails run before requests reach the LLM:packages/guardrails/src/index.ts
Redaction
Sensitive content is automatically redacted:packages/guardrails/src/redact.ts
Request Flow with Guardrails
Violation Logging
All violations are logged:apps/gateway/src/chat/chat.ts
Query Violations
Violation Statistics
Test Content
Test content against your guardrails without making a real request:Reset to Defaults
Permissions
Only owners and admins can manage guardrails:apps/api/src/routes/guardrails.ts
Best Practices
Start with System Rules
Enable all system rules before adding custom ones
Test Before Deploying
Use the test endpoint to validate rules
Monitor Violations
Review violation logs regularly
Use Warn First
Start with “warn” to understand impact before blocking