OpenAI Guardrails
OpenAI Guardrails is an open-source Python library that wraps the OpenAI client and runs configurable checks on model inputs and outputs.
What OpenAI Guardrails does
OpenAI Guardrails replaces the OpenAI client class in an application with a wrapped one. Every Chat Completions or Responses call then passes through a pipeline of checks at three stages, which the docs call pre-flight, input and output, and a failed check raises an exception the application handles. The pipeline is a JSON file, written by hand or exported from a web-based wizard.
Twelve checks are listed: keyword filter, competitor mentions, moderation through OpenAI's moderation API, URL filter, secret keys, personal data, hallucination detection against reference material in vector stores, jailbreak, prompt injection in tool calls and tool outputs, workplace-inappropriate text, off-topic prompts and a custom prompt check. Several of them work by calling a language model that you name in the configuration. The library also provides an agent class for the OpenAI Agents SDK, a client for Azure OpenAI, and an evaluation tool that measures a configuration against a labeled dataset.
OpenAI Guardrails: owner, license, hosting and price
| Fact | Value | Source and date checked |
|---|---|---|
| Owner | OpenAI. | SOURCE ↗ |
| License | MIT. | SOURCE ↗ |
| Self-hosting | Yes, it only runs inside your own application, installed as a Python package. Python 3.11 or later. | SOURCE ↗ |
| Hosted regions | No hosted service. Checks that use a model call the OpenAI API, Azure OpenAI or another OpenAI-compatible endpoint that you configure. | SOURCE ↗ |
| Free tier | The library is free to use under the MIT license. The Moderation check needs an OpenAI API key, at no cost according to the docs. | SOURCE ↗ |
| Pricing model | No charge for the library. Checks that call a language model consume tokens, billed by whichever model provider you configure. | SOURCE ↗ |
| Lowest paid plan | None for the library. The docs state no price for the model calls its checks make. | SOURCE ↗ |
Each value was read from the vendor's own page on the date shown. How listings are checked
OpenAI Guardrails pricing history
OpenAI Guardrails has no public pricing page for this site to watch.
Where OpenAI Guardrails fits
Teams whose code already uses the OpenAI Python client or the OpenAI Agents SDK: the change is one class name and a configuration file. The docs say it works with any OpenAI-compatible API, with a local Ollama model as the example, and the bundled evaluation tool measures a configuration against your own labeled data.
Limits of OpenAI Guardrails
The readme labels it a preview. It needs Python 3.11 or later, and the personal data check needs a spaCy model installed at build time. Checks that call a language model, such as jailbreak and the custom prompt check, consume tokens on every request. Pull requests are accepted from repository collaborators only.
Other guardrails and audit tools
-
Amazon Bedrock Guardrails
Amazon Bedrock Guardrails is a managed AWS service that filters prompts and model responses against content, topic and sensitive-data policies.
-
Presidio
Presidio is an open-source Python framework that detects and anonymizes personal data in text, images and structured data.