# guardrails-ai/guardrails

Adding guardrails to large language models.

Repository: https://github.com/guardrails-ai/guardrails
Canonical: https://ross.abutalabs.com/products/guardrails
Homepage: https://www.guardrailsai.com/docs
Language: Python
License: Apache-2.0
License Family: permissive
Topics: ai, foundation-model, gpt-3, llm, openai
Last push: 2026-08-26T19:53:54+00:00

## Health v2 (maintenance only)
Score: 97/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 98, longevity 93
- inputs: {"age_days": 1312, "days_push": 7, "days_rel": 19, "gap_med": 13, "n_releases_24m": 32}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7321, forks 679 (observed 2026-08-28T04:09:58.215180+00:00)

## What it is
Guardrails is a Python framework for building reliable LLM applications by running Input/Output Guards that detect and mitigate risks, and by generating validated structured data from LLM outputs. It supports 100+ LLMs via LiteLLM, integrates with LangChain, and offers a Guardrails Server for production deployments.

## Use cases
- validate llm outputs for toxic language
- generate structured  from gpt-4o
- add guardrails to my chatbot
- enforce pydantic schema on llm responses
- detect pii in llm inputs
- retry llm calls when validation fails
- serve llm validation as an api
- integrate output checks into langchain chains

## When to choose
- you need reusable validators to check or fix LLM outputs
- you want structured data generation with automatic re-asking
- you need risk mitigation (toxicity, competitors, gibberish) around LLM calls in Python

## When to avoid
- you work outside the Python ecosystem without using the Guardrails Server
- you need a lightweight one-off check and don't want a framework dependency
- you rely on Guardrails' hosted remote inferencing, which is being discontinued

## Facets
- artifact type: framework
- maturity: active
- function: llm-inference, prompt-engineering, middleware, serialization, security, chatbot
- domain: large-language-models, artificial-intelligence, developer-tools
- platform: python, cross-platform, self-hosted
- tags: llm-guardrails, output-validation, structured-output, input-guards, validators, litellm, langchain-integration, pydantic, ai-agents, natural-language-processing

## Member repositories
- guardrails-ai/guardrails (main) score 97

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:58.215180+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:38:39.563760+00:00, confidence not recorded.
  - readme: https://github.com/guardrails-ai/guardrails (fetched 2026-08-28T04:09:58.215180+00:00, sha ee53c2fee496)
  - homepage: https://www.guardrailsai.com/docs (fetched 2026-08-29T08:34:09.737855+00:00, sha 20eda4192382)
  - site_page: https://guardrailsai.com/guardrails/docs/concepts/guard (fetched 2026-08-29T08:34:09.746705+00:00, sha e59a2df00e65)
  - site_page: https://guardrailsai.com/guardrails/docs/how-to-guides/using_llms (fetched 2026-08-29T08:34:09.748397+00:00, sha 13a669a3d717)
  - site_page: https://guardrailsai.com/guardrails/docs/integrations/langchain (fetched 2026-08-29T08:34:09.750330+00:00, sha 2fbc3854bc1a)
  - site_page: https://guardrailsai.com/guardrails/docs/api_reference_markdown/actions (fetched 2026-08-29T08:34:09.752521+00:00, sha c1a5caafdb07)
  - site_page: https://guardrailsai.com/guardrails/docs/why-use-guardrails (fetched 2026-08-29T08:34:09.754235+00:00, sha e5c1693725da)
  - site_page: https://guardrailsai.com/guardrails/docs/quickstart/guardrails_server (fetched 2026-08-29T08:34:09.756178+00:00, sha eb7f6bee4ab5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
