Skip to main content
Validate and constrain agent inputs and outputs. Guardrails protect your Agents by validating inputs and outputs. Block harmful content, enforce response formats, and ensure Agent behavior stays within bounds. For guarding a single tool’s arguments or results, see Per-Tool Guardrails.

Quick Start

1

Simple Usage

2

With Configuration

See the sections below for advanced options.

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

Failure Modes

Per-Tool Guardrails

Guard a single tool’s arguments and results

Workflows

Pipelines with validation

Evaluation

Test Agent quality

Observability

Monitor guardrail triggers