Overview
Guardrails provide content safety and compliance validation for agent interactions. Agent Kernel supports both input and output guardrails to ensure agent requests and responses meet your safety and policy requirements.
Introduction
Guardrails act as protective layers that validate content before and after agent processing:
-
Input Guardrails: Validate user requests before they reach your agents
- Block harmful prompts, jailbreak attempts, and off-topic requests
- Detect and prevent PII leakage in user inputs
- Ensure content adheres to safety policies
-
Output Guardrails: Validate agent responses before they're returned to users
- Filter inappropriate or unsafe content from responses
- Redact sensitive information (PII) in agent outputs
- Ensure responses meet compliance requirements
Supported Providers
| Provider | Status | Documentation |
|---|---|---|
| OpenAI Guardrails | ✅ Available Now | OpenAI Guardrails → |
| AWS Bedrock Guardrails | ✅ Available Now | Bedrock Guardrails → |
How Guardrails Work
When guardrails are enabled:
- Input validation occurs before the request reaches your agent
- If validation fails, a safe error message is returned immediately
- Output validation occurs after the agent generates a response
- If output validation fails, the response is replaced with a safe message
Key Features
Multi-Layer Protection
Guardrails provide defense in depth:
- Pre-flight Checks: Fast API-based validation (PII, Moderation)
- LLM-based Validation: Intelligent content analysis (Jailbreak, Off-topic)
- Custom Rules: Flexible validation logic for specific use cases