OpenAI Guardrails
OpenAI Guardrails is an open-source Python library that wraps the OpenAI client and runs configurable checks on model inputs and outputs.
- None for the library
- Free (open source)
- Open source (MIT)
- Only option
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
Each value was read from the vendor's own page on the date shown. How listings are checked
| 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 ↗ |
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.
Alternatives to OpenAI Guardrails
-
Amazon Bedrock GuardrailsAmazon Bedrock Guardrails is a managed AWS service that filters prompts and model responses against content, topic and sensitive-data policies.$0.10 per 1k text units Compare
-
Arthur Evals EngineArthur Evals Engine is an open-source service you host that applies guardrail rules to LLM prompts and responses and collects traces for evaluation.$60 a month Compare
-
Google Model ArmorModel Armor is a Google Cloud service that screens LLM prompts and responses for prompt injection, harmful content, sensitive data and malicious URLs.$0.10 per 1M tokens Compare
-
Lakera GuardLakera Guard is an API that screens prompts, tool calls and model outputs for prompt attacks, data leakage and unwanted content.Quote only Compare
-
NVIDIA NeMo GuardrailsNVIDIA NeMo Guardrails is an open-source Python library for adding programmable input, dialog, retrieval and output checks to LLM applications.None for the library Compare
-
SignalVault Built by this site's editorSignalVault is a hosted proxy that logs requests to OpenAI and Anthropic models and blocks or redacts sensitive data in them.$49 a month Compare