Guardrails AI
Python framework for LLM input/output guards and validated structured output — composable validators installed as PyPI packages
Guardrails AI is an open-source (Apache 2.0) Python framework that does two jobs. It runs Input/Output Guards that detect, quantify and mitigate specific risks in LLM traffic, and it helps generate structured data from LLMs using Pydantic models or RAIL specs, automatically re-asking the model when output fails validation. Guards are built from validators — such as regex match, competitor mentions, toxic language, PII detection (Presidio-based) and jailbreak detection — browsable in the Guardrails Hub catalog. Since August 2026 each validator installs as a standalone PyPI package (guardrails-ai-): the old hub install command, the private registry and the free hosted remote-inference endpoints were shut down, so model-based validators now run locally or on your own endpoint. Guards run in-process or behind Guardrails Server (Flask, with OpenAI-compatible endpoints) and work with OpenAI, Anthropic, LiteLLM-supported models, LangChain and LlamaIndex. Status note: in September 2026 Harvey acquired Guardrails AI, and the announcement made no public commitment about the open-source roadmap, so check recent repository activity before adopting it. Best for: Python teams that need typed, validated LLM output and lightweight, composable input/output checks. Works well with: LiteLLM · NeMo Guardrails · Presidio · LlamaIndex
When to use
- Enforcing a Pydantic schema on LLM output, with automatic re-ask when validation fails
- Composing input/output checks (PII, toxicity, competitor mentions, jailbreak) from ready-made validators
- Serving guards as an OpenAI-compatible endpoint through Guardrails Server
When not to use
- Dialog flow and topic control for multi-turn chatbots (NeMo Guardrails fits better)
- LLM vulnerability scanning and red-teaming (use garak)
- You need a vendor-backed long-term roadmap — the company was acquired by Harvey in 2026 and open-source maintenance is not publicly committed
At a glance
- Pricing
- Free
- Deployment
- Self-hosted
- Difficulty
- Beginner
- License
- Apache-2.0
- Languages
- python
- Use cases
- output validation, structured data extraction, risk mitigation, llm reliability
- Last verified
- 2026-10-30 (official documentation)
Works well with
Alternatives in this category
See all 4 tools in Security & Guardrails – Protecting AI Applications →