Quick Start
Agent with Input/Output Guardrails
Agent with Custom Safety Guardrail
Agent with PII Protection
Prevent Agents from leaking sensitive information:LLM-Based Guardrail
Use another Agent to validate content:Agent with Format Validation
Ensure Agent outputs valid JSON:Multi-Agent with Shared Guardrails
Apply same guardrails to multiple Agents:Guardrail with External API
Use external moderation services:Built-in Guardrails
| Guardrail | Description |
|---|---|
maxLength(n) | Block content over n characters |
minLength(n) | Block content under n characters |
blockedWords([...]) | Block specific words |
requiredWords([...]) | Require specific words |
pattern(regex, match) | Match or block regex patterns |
validJson() | Ensure valid JSON output |
Failure Modes
| Mode | Behavior |
|---|---|
block | Stop execution, throw error |
warn | Log warning, continue |
modify | Transform content, continue |
Related
Workflows
Pipelines with validation
Evaluation
Test Agent quality
Observability
Monitor guardrail triggers

