Guardrails AI
Wrap LLM calls with composable input and output guards built from validators that detect, quantify, and mitigate specific risks.
Description
Guardrails AI is a Python framework that runs validators around LLM calls. Validators compose into Input and Output Guards that intercept the inputs and outputs of LLMs. The guards detect, quantify, and mitigate risks such as policy violations, hallucinations, and data leakage before output reaches users. Validators are distributed through the Guardrails Hub, and the framework is released under the Apache 2.0 license.
Solution
Inputs pass through an Input Guard composed of validators before reaching the model, and the model's output passes through an Output Guard before reaching the user; each guard detects, quantifies, and mitigates the configured risks, blocking or correcting violations.
Primary use cases
- validating LLM inputs and outputs against risk checks
- composing validators into reusable guards
- generating structured data from LLMs
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.