Guardrails AI is a Python framework for building what it calls reliable AI applications, and its README states its purpose as two functions rather than one. The first is running Input and Output Guards inside an application: measures that detect, quantify and mitigate specific types of risk in what goes into and comes out of a model. The second is generating structured data from LLMs — constraining a model’s output to a shape the application declared in advance.

It is installed as guardrails-ai from PyPI and is Apache-2.0 licensed. It is one concrete implementation of the broader idea covered under Guardrails.

Capabilities

A validator is the unit of measurement — a pre-built check for one specific kind of risk. Validators are combined into a Guard, which intercepts an LLM’s inputs and outputs; the README’s worked examples build a Guard from a regex match, and another from a competitor check and a toxic language check together, each configured with an on_fail action such as raising an exception. Guardrails Hub is the collection those validators are drawn from, documented at guardrailsai.com/hub, and a guardrails CLI configures the project and creates guard configurations.

For structured output, a Guard is built from a Pydantic BaseModel describing the shape wanted — Guard.for_pydantic(output_class=..., prompt=...) — and the framework then obtains that shape by one of two routes depending on the model: function calling where the LLM supports it, and otherwise prompt optimization, appending the expected output schema to the prompt so the model can produce structured data itself.

Guardrails can also run as a standalone service rather than a library: guardrails start serves it with Flask behind a REST API, which the project presents as simplifying development and deployment of Guardrails-powered applications.

Adoption & Ecosystem

The project’s own news entries in the repository record two changes worth noting for anyone reading older material about it. In February 2025 it launched Guardrails Index, which it describes as the first benchmark of its kind comparing the performance and latency of 24 guardrails across six common categories. In July 2026 it announced that validators are moving to standard PyPI packages installed directly with pip — the README’s examples already use that form, pip install guardrails-ai-regex-match rather than a hub URL — and that its hosted remote inferencing is being discontinued, with a planned cutoff of August 25, 2026.

Guardrails, NVIDIA NeMo Guardrails