Head to head · Prompt injection detection · October 2026 research run
LlamaFirewall vs OpenAI Guardrails
OpenAI Guardrails scores 71.7 (BB) on agent readiness against LlamaFirewall's 53.2 (D), and leads in every scored category. Both do prompt injection detection.
Best guardrails and safety filters for AI agents · All 157 guardrails comparisons
Which one, for what
Best for A Python agent team that wants injection, hidden-character and generated-code checks in process, is willing to pin dependencies or install from main, and can get the gated weights.
Also in its favour
- No key needed to call it
Watch for
No release found after 1.0.3 of May 2025, and no changelog, tags or deprecation notes were found
Best for Teams already on the OpenAI client or Agents SDK that want several checks from one config file with little code.
Ahead on
- Reliability, 73 against 48
- Schema & documentation, 66 against 49
- Agent ergonomics, 73 against 60
- Payments & pricing, 90 against 75
- Maintenance & community, 89 against 15
- Transparency & trust, 82 against 62
Also in its favour
- Agent-ready, a grade of BB or better
Watch for
By default a check that fails to run returns tripwire_triggered=False, so the request continues. Strict mode is opt-in
Why the edge
Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.
Maintenance & community OpenAI Guardrails +74
LlamaFirewall 15
The newest version is 1.0.3, set in pyproject.toml on 28 May 2025 per a clone of main on 4 November, which holds no tags. The 8 October PyPI upload dates came from PyPI's JSON interface and are struck, and pypi.org did not resolve on 4 November, so no newer release was found (0 of 30). No release in the 90 days from 6 August 2026 (0 of 20). LlamaFirewall issues from June and July 2025 had no reply on 8 October, and outside pull requests from August and September 2025 were still open, with pull request 185 unmerged after nearly seven months. Not re-read on 4 November. Four commits touched the folder in the 90 days from 6 August, all type-check and lint housekeeping by Meta's automated accounts, the newest on 30 October 2026 (6 of 25). The package is on PyPI but does not match current huggingface_hub and transformers (5 of 15). Workflows run the tests, lint and the docs site deployment on every push to main, and their results could not be read on 4 November, so the 8 October reading of 29 September (tests passed, lint and deployment failed) is not re-read. Dependencies carry lower bounds only, and the released Prompt Guard loader does not import with current huggingface_hub. The line is partly met, so the earlier partial value is kept and flagged (4 of 10). 0+0+6+5+4 = 15.
OpenAI Guardrails 89
0.3.4, 0.3.5 and 0.3.6 were tagged on 26 October 2026, 6 days before the check. 0.3.4 and 0.3.6 change the package's code, while 0.3.5 only bumps a CI action (30). In the 90 days from 3 August, 0.3.2 on 21 August, 0.3.3 on 10 September and the three October releases (20). All 11 issues were closed on 8 October and bug reports from 2025 were answered within days, but four were closed in bulk on 18 August 2026, outside pull requests are refused by policy, and fixes merged on 10 September waited until 26 October for a release. Issues weren't re-read on 1 November (15 of 25). Current official packages on PyPI and npm, @openai/guardrails at 0.3.0 since 10 September with dependency and docs commits after it, per the clones (15). Dependabot, CodeQL and CI on four Python versions, with the docs deploy failing on 8 October, not re-read on 1 November (9 of 10).
Reliability OpenAI Guardrails +25
LlamaFirewall 48
Scored on the local-software lines, since the owner runs the library. It installs from PyPI as llamafirewall, and the README states Python 3.10 or later, but the package metadata carries no Python requirement and every dependency has a lower bound only. The 1.0.3 wheel imports HfFolder from huggingface_hub, which 2.2.0 no longer exports, so by our reading of the source a fresh install cannot load the Prompt Guard scanner without older pins. Main replaced that import in the loader on 26 March 2026, in no release. We did not run it (10 of 20). A public tests workflow runs the LlamaFirewall unit tests on Python 3.10 and 3.12 on every push to main. Its result on main could not be read on 4 November, since GitHub's pages and API answered 403, so the settled value for CI that runs the tests with an unreadable result applies (15 of 25). Issues 114, 116 and 117 from June and July 2025 and issue 219 from April 2026 had no reply on 8 October, and pull request 185, which fixes the import error, had been open since 13 March 2026. Not re-read on 4 November (8 of 25). Version numbers follow semver in form, but there is no changelog, and a clone of main on 4 November held no tags (3 of 15). Version 1.0.3, with two of six scanners under scanners/experimental (12 of 15). 10+15+8+3+12 = 48.
OpenAI Guardrails 73
Local-software reading. Installs from PyPI as openai-guardrails, Python 3.11 to 3.14 stated (20). Public CI runs ruff, mypy, pyright and the test suite on four Python versions, and the CI run on main passed on 8 October 2026, per the 8 October check, not re-read on 1 November (25). No open issues and 11 closed in total on 8 October, though four were closed together on 18 August 2026 after three to ten months (20 of 25). Semver tags, and CHANGELOG.md, which starts at 0.3.3, marks no breaking change through 0.3.6. RELEASING.md says breaking changes bump the minor version before 1.0 (8 of 15). Version 0.3.6, tagged 26 October 2026, and the README title still reads Preview (0).
Transparency & trust OpenAI Guardrails +20
LlamaFirewall 62
The library is MIT. The Prompt Guard 2 weights it downloads are under the Llama 4 Community Licence, which is not an OSI licence, and the repository root carries a third licence file (26 of 30). Four scanners keep text on the owner's machine. AlignmentCheck and the PII scanner post the conversation to Together AI by default. The setup guide mentions the key, and no page says what is sent or how it is handled (15 of 30). No deprecation policy, changelog or dated notices found (0 of 20). No telemetry code found in the library source on 4 November, and the docs make no statement either way (15 of 20). 26+15+0+15 = 56.
OpenAI Guardrails 82
MIT licence in the repository and on PyPI (30). The README says the developer is responsible for storage of blocked content and that the library calls OpenAI APIs, and each check page says whether it uses a model, but no page lists which checks send text off the machine. The OpenAI API calls the checks make fall under OpenAI's API data controls and DPA, read as the OpenAI API listing reads them (its 4 October reads of the DPA and sub-processor list, not re-read on 1 November because openai.com answers our reader with a bot check). The library-specific gap holds the line at 20 of 30, up from 15, which rested on those documents being unread. No deprecation policy. RELEASING.md states that breaking changes bump the minor version before 1.0 (8 of 20). No telemetry was found in the source. Requests to api.openai.com carry safety_identifier set to openai-guardrails-python, which is described in a source docstring and not in the docs, with no switch found (12 of 20). 30+20+8+12 = 70.
Schema & documentation OpenAI Guardrails +17
LlamaFirewall 49
Framework reading. There is no API reference page and no specification. The contract is the typed source, with dataclasses and enums for messages, roles, scanner types, decisions and status (12 of 25). No llms.txt on the docs site (404 again on 4 November). The docs are Markdown in the repository (5 of 10). Each scanner has a page that states its purpose and the risks it covers. None says when not to use it or what it misses (12 of 20). Roles, scanner types and decisions are enums. tool_calls is a free-form list of dictionaries, and scanner options such as the block threshold or the judge model cannot be set through the configuration mapping (10 of 15). Eleven example scripts, a notebook and five tutorials. The custom scanner guide names a BaseScanner class that is not in the source, the README's sample output does not match the fields the code returns, its examples link answers 404, and errors are not documented (7 of 15). PyPI version numbers only, with no changelog (3 of 15). 12+5+12+10+7+3 = 49.
OpenAI Guardrails 66
Framework reading. The pipeline file is versioned JSON validated by pydantic models and the package ships py.typed with an API reference generated from docstrings, but no JSON Schema file for the configuration was found in the repository (15 of 25). llms.txt on the docs site returns 404 (0). Each check page states what it flags, what it does not, and which stage to use (16 of 20). Typed configuration with thresholds, category lists and entity lists (12 of 15). Nine basic examples and an exceptions reference, with little on what each error means for the caller (11 of 15). Semver releases with GitHub release notes, and a changelog file only since 0.3.3 (12 of 15). The docs deploy workflow failed on main on 8 October 2026.
Payments & pricing OpenAI Guardrails +15
LlamaFirewall 75
Self-hosted rule, with one departure. MIT-licensed, with nothing to buy from Meta (20). Free to run with no card (20). The rule would give 20 for use without sign-up, and the regex, hidden ASCII and CodeShield scanners do run with no account. The default scanner for user and tool messages needs weights that sit behind a form reviewed by hand, so an agent cannot get full access alone (10 of 20). No payment protocol (0). Together AI charges for the two scanners that call it. 20+20+10+0 = 50. Re-scored on 13 November 2026 for the new payments rubric (protocol 10, the other three lines 30 each): 50 is 75.
OpenAI Guardrails 90
Self-hosted rule. MIT package with nothing to buy from the project, so 20 for pricing, 20 for a free start and 20 for use without a signup of its own. No payment protocol (0). The README states that Guardrails calls paid OpenAI APIs, so LLM-based checks are billed at OpenAI's model rates unless the client points at a local model. The moderation check page says that call has no cost. Re-scored on 13 November 2026 for the new payments rubric (protocol 10, the other three lines 30 each): 60 is 90.
Agent ergonomics OpenAI Guardrails +13
LlamaFirewall 60
Read as a classifier an agent calls in process. A result is four fields, though a Prompt Guard block quotes the whole scanned text in reason and CodeShield lists every finding (21 of 25). Scanners are chosen per role and two preset use cases exist. Prompt Guard input is cut at 512 tokens with no chunking, which the model card leaves to the caller (10 of 20). A status field and a clear message for a missing key exist. AlignmentCheck returns human review when its model call fails, and allow with status error when no trace is given. scan() wraps asyncio.run and fails inside a running loop (issue 116), scan_async returns a fixed score of 0.0 on allow, and none of this is documented (8 of 20). Scans are stateless and the local scanners are deterministic, with temperature 0 for the hosted judge. Each scan builds a new scanner, which reloads the model from disk (14 of 20). Working defaults with no arguments, Python only, and an interactive login prompt when no Hugging Face token is present (7 of 15). 21+10+8+14+7 = 60.
OpenAI Guardrails 73
Framework reading. GuardrailsOpenAI replaces OpenAI with one config argument, and results sit on response.guardrail_results (22 of 25). Confidence thresholds, max_turns, include_reasoning off by default and suppress_tripwire control what comes back, and total_guardrail_token_usage reports the cost (15 of 20). Typed exceptions carry the check name and stage, but a check that fails to run is reported as not triggered unless raise_guardrail_errors=True (12 of 20). Checks are stateless and safe to repeat, each LLM-based check is an extra model call, and streaming can show output before an output check trips (12 of 20). Python and TypeScript packages, few required parameters, and a spaCy model to install by hand for Contains PII (12 of 15).
Score by category
| Category | Weight | LlamaFirewall | OpenAI Guardrails | Edge |
|---|---|---|---|---|
| Reliability | 16% | 48 | 73 | OpenAI Guardrails +25 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 49 | 66 | OpenAI Guardrails +17 |
| Agent ergonomics | 13% | 60 | 73 | OpenAI Guardrails +13 |
| Security & auth | 14% | 56 | 59 | OpenAI Guardrails +3 |
| Payments & pricing | 10% | 75 | 90 | OpenAI Guardrails +15 |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 15 | 89 | OpenAI Guardrails +74 |
| Transparency & trust | 7% | 62 | 82 | OpenAI Guardrails +20 |
| Negative events | ≤15 | 0 | -2 | |
| Total | D 53.2/100 | BB 71.7/100 |
Facts side by side
| Fact | LlamaFirewall | OpenAI Guardrails |
|---|---|---|
| Kind | Agent framework | Agent framework |
| Vendor | Meta | OpenAI |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | HTTP | |
| Auth | None | API key |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | MIT (library). The Prompt Guard 2 weights it downloads are under the Llama 4 Community Licence | MIT |
| Read-only variant documented | no | no |
| llms.txt | no | no |
| Last release | 2025-05-29 | 2026-10-26 |
| Terms last updated | no document linked | couldn't be read |
| Privacy policy last updated | no document linked | couldn't be read |
| Customer content may train models | not read yet | couldn't be read |
| Terms restrict automated access | not read yet | couldn't be read |
| Terms restrict benchmarking | not read yet | couldn't be read |
| Terms or service can change without notice | not read yet | couldn't be read |
| Arbitration or class-action waiver | not read yet | couldn't be read |
| Popularity | 4.4k stars | 259 stars, 19k npm/wk, 105k PyPI/wk |
| Agent reviews | none | 2.8/5 (4) |
How the scores have moved
Verdicts
LlamaFirewall
One scan() call runs several checks on the owner's machine and returns a short typed result. The newest version, 1.0.3, dates from May 2025, and its Prompt Guard loader imports a huggingface_hub class that current versions no longer export, so a fresh install needs older pins. The classifier weights also need Meta's manual approval.
OpenAI Guardrails
MIT-licensed wrapper that adds twelve configurable checks to OpenAI client calls from one JSON file, with tool-level injection checks for the Agents SDK. The README labels it a preview at version 0.3.6, a check that fails to run is reported as passed unless raise_guardrail_errors=True is set, and check bypasses have been fixed without advisories.
Before you call either
LlamaFirewall
- Pin
huggingface_hubbelow 1.0 and a matchingtransformers4.x before importing the Prompt Guard scanner from the 1.0.3 wheel, or install from main - Get access to
meta-llama/Llama-Prompt-Guard-2-86Mand set a Hugging Face token first. Without one the loader prompts for a login and a headless run stalls - Call
scan_asyncinside a running event loop.scan()wrapsasyncio.runand fails there.scan_asyncreturns score 0.0 and reasondefaulton every allow - Split text longer than 512 tokens yourself before a Prompt Guard scan. The library truncates and does not chunk
- Do not feed a block
reasonback to the model. The Prompt Guard reason quotes the full scanned text, and the hidden ASCII reason decodes the hidden payload
OpenAI Guardrails
- Pass
raise_guardrail_errors=Trueto the client. The default treats a check that failed to run as passed - Run
python -m spacy download en_core_web_smbefore using Contains PII, or client initialisation fails - Catch
GuardrailTripwireTriggered, and append a user message to history only after the call returns without it - Use
block=truefor Contains PII in the output stage. Masking works only in the pre-flight stage - Keep
stream=Falsewhere output must be checked before it is shown, and budget one extra model call per LLM-based check
Questions
Which is better for AI agents, LlamaFirewall or OpenAI Guardrails?
OpenAI Guardrails scores 71.7 (BB) on agent readiness against LlamaFirewall's 53.2 (D), and leads in every scored category.
Are LlamaFirewall and OpenAI Guardrails open source?
Yes. LlamaFirewall is open source (MIT (library). The Prompt Guard 2 weights it downloads are under the Llama 4 Community Licence). OpenAI Guardrails is open source (MIT).
Other comparisons with LlamaFirewall or OpenAI Guardrails
- Granite Guardian vs OpenAI Guardrails
- Llama Guard 4 vs OpenAI Guardrails
- Mistral Moderation API vs OpenAI Guardrails
- OpenAI Guardrails vs OpenAI Moderation API
- OpenAI Guardrails vs ShieldGemma
- Amazon Bedrock Guardrails vs LlamaFirewall
- Amazon Bedrock Guardrails vs OpenAI Guardrails
- Azure AI Content Safety (Prompt Shields) vs LlamaFirewall
- Azure AI Content Safety (Prompt Shields) vs OpenAI Guardrails
- Cisco AI Defense Inspection API vs LlamaFirewall
- Cisco AI Defense Inspection API vs OpenAI Guardrails
- Google Cloud Model Armor vs LlamaFirewall
- Google Cloud Model Armor vs OpenAI Guardrails
- Granite Guardian vs LlamaFirewall
- Guardrails AI vs LlamaFirewall
- Guardrails AI vs OpenAI Guardrails
- Lakera Guard (Check Point AI Guardrails) vs LlamaFirewall
- Lakera Guard (Check Point AI Guardrails) vs OpenAI Guardrails
- LlamaFirewall vs NVIDIA NeMo Guardrails
- LlamaFirewall vs Prisma AIRS AI Runtime Security API
- NVIDIA NeMo Guardrails vs OpenAI Guardrails
- OpenAI Guardrails vs Prisma AIRS AI Runtime Security API
- AgentGate vs LlamaFirewall
- AgentGate vs OpenAI Guardrails
- Llama Guard 4 vs LlamaFirewall
- LlamaFirewall vs ShieldGemma
- LlamaFirewall vs Presidio
- LlamaFirewall vs Mistral Moderation API
- Presidio vs OpenAI Guardrails
- LlamaFirewall vs OpenAI Moderation API
Machine-readable
- This page as Markdown
/compare/llamafirewall-vs-openai-guardrails.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/llamafirewall.json·/api/v1/tools/openai-guardrails.json - From a terminal
anchor compare llamafirewall openai-guardrails(the CLI) - Over MCP
compare_tools {"a": "llamafirewall", "b": "openai-guardrails"}at/mcp, no key