Favicon of Guardrails AI

Guardrails AI

Open-source Python framework for checking LLM inputs and outputs, generating structured data, and running guards in your app or a self-hosted service.

Screenshot of Guardrails AI website

Guardrails AI is an open-source Python framework for developers who need to check what goes into an LLM and what comes back. It runs within your application or as a self-hosted service. The framework uses the Apache 2.0 license and helps address risks such as policy violations, hallucinations, and data leakage before outputs reach users.

Guardrails Hub supplies prebuilt validators for specific risks. You can combine them into input and output guards, so an application can apply several checks to the same request or response. The guards detect, measure, and mitigate risks, with runtime controls that can block problematic outputs.

The framework also helps generate structured data from LLMs. It works with Pydantic models to describe the output an application expects, which matters when software needs defined fields rather than free-form text. For teams that want validation separate from their application, a Flask-based server exposes guards through a REST API.

The broader platform covers testing and training data as well as runtime checks. It generates realistic synthetic datasets for fine-tuning, distillation, and prompt optimization. Its agent evaluations generate scenarios aimed at edge cases and risky outcomes, then quantify where an agent fails. The platform supports work across LLMs and deployment environments; the Python framework provides the application-level guards and standalone validation service.

Similar to Guardrails AI