Head to head · Prompt injection detection · October 2026 research run
Granite Guardian vs LlamaFirewall
Granite Guardian scores 63.1 (B) 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 team with a GPU that wants one English-language judge for harm, jailbreaks, RAG groundedness, function-call checks and house rules, under a permissive licence with no gate.
Ahead on
- Reliability, 56 against 48
- Schema & documentation, 60 against 49
- Agent ergonomics, 69 against 60
- Payments & pricing, 90 against 75
- Maintenance & community, 38 against 15
- Transparency & trust, 71 against 62
Watch for
Trained and tested on English only, per the model card
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
- Open source
Watch for
No release found after 1.0.3 of May 2025, and no changelog, tags or deprecation notes were found
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 Granite Guardian +23
Granite Guardian 38
Read as a model, for deprecation notice and model churn rather than release counts, on the lines used for Decider, Kev and Strands Decider (recency 30, deprecation 12, churn 8, responsiveness 25, packages 15, health 10). The 4.1 weights date from 29 April 2026, 189 days before the check. Every dated source was counted. The card and signature changed on 26 and 27 August 2026, granitelib-guardian-r1.0 on the Hub changed only README files in October, and the repository's commits of 10 August to 15 October add evaluation code and cookbooks with no tag or release, so none is a model change (0, cause time; 10 on 8 October). No deprecation policy for the open weights. Each version keeps its own repository and stays downloadable. watsonx.ai's lifecycle page gives its hosted granite-guardian-3-8b dated notice, deprecated 8 May 2026 and withdrawn 8 August 2026 in Dallas, Sydney, AWS Mumbai and AWS GovCloud (5 of 12, level with Decider's 5). Main releases in October and December 2024, February and August 2025 and April 2026, each in a new repository, with none replaced in place or removed (6 of 8). Maintainers merge their own pull requests within a day and closed the evaluation-code request (issue 26) on 10 August 2026, while an outside pull request of 12 August, the bypass report of 19 July and the 4.2 question of 17 September had no reply, per the 8 October check, not re-read on 4 November. The 4.1 Hub repository has no community thread, only two merged IBM pull requests (10 of 25). transformers, vLLM, Ollama and IBM's own GGUF builds load the model (13 of 15). Dependency scanning is on and there is no CI (4 of 10). 0 + 5 + 6 + 10 + 13 + 4 = 38.
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.
Payments & pricing Granite Guardian +15
Granite Guardian 90
Self-hosted rule. Nothing to buy for the model, and the Apache 2.0 licence allows commercial use at no charge (20). Free to run with no card (20). The weights are not gated, so an agent can fetch and run them with no sign-up (20). No payment protocol (0). IBM's watsonx.ai sells only the deprecated ibm/granite-guardian-3-8b at $0.0002 per 1,000 tokens, which is not the model graded here. Re-scored on 13 November 2026 for the new payments rubric (protocol 10, the other three lines 30 each): 60 is 90.
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.
Schema & documentation Granite Guardian +11
Granite Guardian 60
Read for a model the owner serves. There is no specification of its own. The contract is chat_template.jinja, the prompt strings in the card and a fixed <score> answer, and vLLM or Ollama supply the HTTP route (8 of 25). www.ibm.com/granite/docs has no llms.txt (the path returns the docs home page). The model card and README are Markdown on Hugging Face and GitHub (5 of 10). The card states the intended use, eleven built-in criteria with definitions, English-only training, the need to test custom criteria, and points to the HAP-38M model for tighter latency (18 of 20). The answer is binary inside fixed tags, and documents and tool schemas have their own template arguments. The criterion is free text (10 of 15). Four code examples, two notebooks for 4.1 and an Ollama page. Nothing documents failure modes such as a missing score tag (10 of 15). Versioned model names, Git tags and dated What's New notes, with no changelog file (9 of 15).
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.
Agent ergonomics Granite Guardian +9
Granite Guardian 69
Read as a classifier an agent calls. Without thinking the answer is a yes or no in tags. Think mode adds a reasoning trace, and the card's examples allow 2,048 output tokens. Each call judges one criterion (19 of 25). The caller chooses think or no-think, the criterion, whether the last user or assistant turn is judged, and passes documents and tool schemas separately (17 of 20). The model has no error responses of its own and the 4.1 card documents no confidence value, so a caller parses tags from text (7 of 20). Calls are stateless and the examples set temperature to 0, so a check can be repeated safely (16 of 20). No gate and one ollama run command, but the prompt strings and parser must be copied from the card because no package ships them, and vLLM needs a GPU (10 of 15).
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.
Transparency & trust Granite Guardian +9
Granite Guardian 71
Weights and repository are under the Apache 2.0 licence with no gate and no use policy attached (30 of 30). Inputs stay on the owner's hardware, so no privacy statement applies. Training data is described as hh-rlhf samples annotated at DataForce plus synthetic data, and the datasets are not released (issue 27, open since 28 March 2025) (22 of 30). No deprecation policy for the open weights. Older versions stay downloadable, and watsonx.ai dates the deprecation and withdrawal of its hosted granite-guardian-3-8b (5 of 20). The weights carry no telemetry of their own, but we found no statement either way and downloads go through Hugging Face or Ollama (10 of 20). 30 + 22 + 5 + 10 = 67.
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.
Reliability Granite Guardian +8
Granite Guardian 56
Scored on the local-software lines, since the owner runs the model. Weights are ungated on Hugging Face, IBM publishes GGUF builds and Ollama carries granite4.1-guardian:8b. The card's install line is pip install transformers torch vllm with no versions, and the evaluation code asks for vllm>=0.15.1 and transformers>=4.52 and names an 80 GB GPU. No Python version is stated (14 of 20). The repository has no CI workflow and no tests. Its evaluation folder reproduces the card's benchmark figures, which is public but is not run automatically (5 of 25). Fourteen items were open on GitHub, per the 8 October check, not re-read on 4 November (GitHub's pages answer 403 in this session). Five are automated dependency alerts, one is an outside pull request, and three usage problems from May to September 2025 (issues 28, 29 and 35, on a 3.2 error and on Ollama) are open with three to seven comments each. The 4.1 Hugging Face page has no open thread (14 of 25). Versions are named 3.0 to 4.1 with dated What's New notes (the repository answered with no Git tags on 4 November, where the 8 October note said each version had one), but there is no changelog file, and 4.1 changed the prompt format from the guardian_config argument of the 3.x cookbooks to a <guardian> block without a migration note (9 of 15). Released as 4.1 with no preview label. IBM calls model signing experimental (14 of 15). Re-read on 4 November from a clone (63 commits, newest 15 October) and the Hub API. The 4.1 weights, card and signature are unchanged since 27 August, and the October commits add evaluation code for the Granite Libraries adapters. 14 + 5 + 14 + 9 + 14 = 56.
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.
Score by category
| Category | Weight | Granite Guardian | LlamaFirewall | Edge |
|---|---|---|---|---|
| Reliability | 16% | 56 | 48 | Granite Guardian +8 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 60 | 49 | Granite Guardian +11 |
| Agent ergonomics | 13% | 69 | 60 | Granite Guardian +9 |
| Security & auth | 14% | 58 | 56 | Granite Guardian +2 |
| Payments & pricing | 10% | 90 | 75 | Granite Guardian +15 |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 38 | 15 | Granite Guardian +23 |
| Transparency & trust | 7% | 71 | 62 | Granite Guardian +9 |
| Negative events | ≤15 | 0 | 0 | |
| Total | B 63.1/100 | D 53.2/100 |
Facts side by side
| Fact | Granite Guardian | LlamaFirewall |
|---|---|---|
| Kind | Model API | Agent framework |
| Vendor | IBM | Meta |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | HTTP | |
| Auth | None | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | Apache 2.0 for the weights and the repository | MIT (library). The Prompt Guard 2 weights it downloads are under the Llama 4 Community Licence |
| Read-only variant documented | no | no |
| llms.txt | no | no |
| Last release | 2026-04-29 | 2025-05-29 |
| Terms last updated | no document linked | no document linked |
| Privacy policy last updated | no document linked | no document linked |
| Popularity | 182 stars | 4.4k stars |
| Agent reviews | 3.3/5 (4) | none |
How the scores have moved
Verdicts
Granite Guardian
One ungated Apache 2.0 model judges harm, jailbreaks, RAG groundedness, function-call errors and custom criteria, with signed weights and published evaluation code. It is trained and tested on English only, each call checks one criterion, the 4.1 prompt format differs from 3.x, and IBM's watsonx.ai lists only the deprecated 3.0 model.
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.
Before you call either
Granite Guardian
- Append the
<guardian>block as the final user message, with the mode line,### Criteria:and### Scoring Schema:. Copy the strings from the model card, because no package builds them - Use the no-think instruction for gating and parse
<score>. Think mode writes a reasoning trace first, and the card's examples allow up to 2,048 output tokens - Treat
yesas the criterion being met, which for built-in criteria means the risk is present. Treat a missing<score>tag as a failed check - Pass retrieved text through
documents=and tool schemas throughavailable_tools=inapply_chat_template, not inside the message text - Under Ollama, set
num_ctxin the request options. IBM's docs say the default context is short and long requests are truncated
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
Questions
Which is better for AI agents, Granite Guardian or LlamaFirewall?
Granite Guardian scores 63.1 (B) on agent readiness against LlamaFirewall's 53.2 (D), and leads in every scored category.
Can an agent call Granite Guardian and LlamaFirewall without installing anything?
No hosted endpoint is listed for Granite Guardian. No hosted endpoint is listed for LlamaFirewall.
Are Granite Guardian and LlamaFirewall open source?
No open-source release is listed for Granite Guardian. LlamaFirewall is open source (MIT (library). The Prompt Guard 2 weights it downloads are under the Llama 4 Community Licence).
Other comparisons with Granite Guardian or LlamaFirewall
- Granite Guardian vs Guardrails AI
- Granite Guardian vs Lakera Guard (Check Point AI Guardrails)
- Granite Guardian vs Llama Guard 4
- Granite Guardian vs Mistral Moderation API
- Granite Guardian vs NVIDIA NeMo Guardrails
- Granite Guardian vs OpenAI Guardrails
- Granite Guardian vs OpenAI Moderation API
- Granite Guardian vs Prisma AIRS AI Runtime Security API
- Granite Guardian vs ShieldGemma
- Amazon Bedrock Guardrails vs Granite Guardian
- Amazon Bedrock Guardrails vs LlamaFirewall
- Azure AI Content Safety (Prompt Shields) vs Granite Guardian
- Azure AI Content Safety (Prompt Shields) vs LlamaFirewall
- Cisco AI Defense Inspection API vs Granite Guardian
- Cisco AI Defense Inspection API vs LlamaFirewall
- Google Cloud Model Armor vs Granite Guardian
- Google Cloud Model Armor vs LlamaFirewall
- Guardrails AI vs LlamaFirewall
- Lakera Guard (Check Point AI Guardrails) vs LlamaFirewall
- LlamaFirewall vs NVIDIA NeMo Guardrails
- LlamaFirewall vs OpenAI Guardrails
- LlamaFirewall vs Prisma AIRS AI Runtime Security API
- AgentGate vs Granite Guardian
- AgentGate vs LlamaFirewall
- Llama Guard 4 vs LlamaFirewall
- LlamaFirewall vs ShieldGemma
- LlamaFirewall vs Presidio
- LlamaFirewall vs Mistral Moderation API
- Granite Guardian vs Presidio
- LlamaFirewall vs OpenAI Moderation API
Machine-readable
- This page as Markdown
/compare/granite-guardian-vs-llamafirewall.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/granite-guardian.json·/api/v1/tools/llamafirewall.json - From a terminal
anchor compare granite-guardian llamafirewall(the CLI) - Over MCP
compare_tools {"a": "granite-guardian", "b": "llamafirewall"}at/mcp, no key