$npx skillfedfor your agent

openai-guardrails

OpenAI Guardrails: A framework for building safe and reliable AI systems.

With conditionsPyPI Python ModulesReleased Jul 2026315.2K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — openai_guardrails-0.3.0-py3-none-any.whl
v0.3.0 · released 2026-07-21 · Python >=3.11 · 5 runtime deps: openai-agents, openai, presidio-analyzer, pydantic, thinc

Yes, if you need to add safety and compliance checks to an OpenAI-based LLM application. The package is actively maintained, has low install friction, uses a permissive MIT license, and offers a drop-in integration pattern that minimizes code changes. It is still in preview (version 0.3.0), so expect potential API changes; verify stability for production use cases before committing to it.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.11+.
  • If using the Contains PII guardrail, the spaCy model en_core_web_sm must be downloaded separately before client initialization.
  • Low install friction with a pure-Python wheel.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and open-source projects. No copyleft obligations.

last release 2026-07-21 (24 days) · last repo commit 2026-07-21 · 229 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 315,200 downloads/mo, #7,689 on PyPI

Verify before relying

pip install openai-guardrails

from pathlib import Path
from guardrails import GuardrailsOpenAI

client = GuardrailsOpenAI(config=Path("guardrail_config.json"))
chat = client.chat.completions.create(
    model="gpt-5",
    messages=[{"role": "user", "content": "Hello world"}],
)
print(chat.choices[0].message.content)
  • Whether the package's evaluation framework (guardrail_evals) is production-ready or still in preview like the main package.
  • Performance overhead of guardrail checks on typical LLM request latency.
  • Whether custom guardrails beyond the built-in set can be easily defined by users.
Same gist for agents: .md · .json

What it is and what it does

OpenAI Guardrails is a Python wrapper around OpenAI's client that intercepts and validates LLM requests and responses against configurable safety rules. It provides a drop-in replacement for the standard OpenAI client, letting you add guardrails without rewriting your application code. The package includes built-in checks for content moderation, PII detection, jailbreak attempts, hallucination detection, NSFW content, off-topic prompts, and URL filtering, all configured via JSON.

The package depends on openai, openai-agents, presidio-analyzer, pydantic, and thinc. It integrates with OpenAI's Agents SDK via GuardrailAgent for agent-based workflows and includes an evaluation framework to benchmark guardrail performance on labeled datasets. When a guardrail is triggered, it raises GuardrailTripwireTriggered, allowing you to handle violations gracefully. The spaCy model for PII detection is an optional but documented prerequisite if that guardrail is enabled.

Use it for

  • Protect customer-facing chatbots from jailbreak attempts and inappropriate content without modifying core chat logic.
  • Detect and mask personally identifiable information in LLM inputs and outputs to meet data privacy compliance.
  • Evaluate guardrail effectiveness on labeled datasets and benchmark different model configurations for safety performance.
  • Integrate safety checks into OpenAI Agents SDK workflows to ensure agent outputs meet compliance requirements.
  • Filter hallucinated or off-topic responses to keep LLM outputs within business scope and factual accuracy.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to add safety and compliance checks to an OpenAI-based LLM application.

The package is actively maintained, has low install friction, uses a permissive MIT license, and offers a drop-in integration pattern that minimizes code changes. It is still in preview (version 0.3.0), so expect potential API changes; verify stability for production use cases before committing to it.

Install

openai-guardrails on PyPI

Before you install

Low install friction with a pure-Python wheel. Active maintenance (last commit 2026-07-21, 24 days old). Requires Python 3.11 or later. The spaCy model for PII detection must be downloaded separately if that guardrail is enabled, which is documented as a prerequisite during client initialization.

Requires Python 3.11+. If using the Contains PII guardrail, the spaCy model en_core_web_sm must be downloaded separately before client initialization.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and open-source projects. No copyleft obligations.

Quickstart

pip install openai-guardrails

from pathlib import Path
from guardrails import GuardrailsOpenAI

client = GuardrailsOpenAI(config=Path("guardrail_config.json"))
chat = client.chat.completions.create(
    model="gpt-5",
    messages=[{"role": "user", "content": "Hello world"}],
)
print(chat.choices[0].message.content)

Verify before relying

  • Whether the package's evaluation framework (guardrail_evals) is production-ready or still in preview like the main package.
  • Performance overhead of guardrail checks on typical LLM request latency.
  • Whether custom guardrails beyond the built-in set can be easily defined by users.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.11
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
openai-agentsopenaipresidio-analyzerpydanticthinc
MaintenanceActively maintained 24 days since the last release
Last repo commit
First released
Downloads315,200 / month, #7,689 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Evidence: openai_guardrails-0.3.0-py3-none-any.whl

Tags

Capabilities
llm safety guardrailsopenai content moderationpii detection pythonjailbreak detectionllm input output validationai compliance frameworkhallucination detection
Topics
llm-safetycontent-moderationcompliance

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “openai content moderation”

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also guardrails-ai · pydantic-ai-shields · nemoguardrails · guardrails-hub-types · openai-agents · codeshield · guardrails-ai-types · llm-openai-plugin · openlit · deepteam

Further reading