# Guardrails AI vs ShieldGemma

> ShieldGemma scores 54 (C) to Guardrails AI's 47.8 (D) for content moderation. Prices, MCP, x402, uptime and agent notes side by side.

- Canonical: https://www.anchorterminal.com/compare/guardrails-ai-vs-shieldgemma
- Markdown: https://www.anchorterminal.com/compare/guardrails-ai-vs-shieldgemma.md (~4,700 tokens)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-07

ShieldGemma scores 54 (C) on agent readiness against Guardrails AI's 47.8 (D), and leads in 2 of 7 scored categories. Guardrails AI leads on reliability, payments & pricing and transparency & trust. Both do content moderation.

- Guardrails AI: grade D, 47.8/100, rank #1140 of 1510. Markdown https://www.anchorterminal.com/tools/guardrails-ai.md · JSON https://www.anchorterminal.com/api/v1/tools/guardrails-ai.json
- ShieldGemma: grade C, 54/100, rank #927 of 1510. Markdown https://www.anchorterminal.com/tools/shieldgemma.md · JSON https://www.anchorterminal.com/api/v1/tools/shieldgemma.json
- Best guardrails and safety filters for AI agents: https://www.anchorterminal.com/best/guardrails/index.md
- All 155 guardrails comparisons: https://www.anchorterminal.com/compare/guardrails/index.md

## Which one, for what

### Guardrails AI (D)

Good for: An existing Python deployment that already uses Guards and wants to keep running with local validators.

Ahead on:
- Reliability, 58 against 46
- Payments & pricing, 60 against 52
- Transparency & trust, 61 against 54

Also in its favour:
- Open source

Watch for: Acquired by Harvey on 9 September 2026 with no statement on the library, and no commit since 26 August

### ShieldGemma (C)

Good for: Policy-specific content moderation of English text input or output, or of images, on the owner's hardware, with a probability to threshold.

Ahead on:
- Agent ergonomics, 72 against 63
- Security & auth, 53 against 44

Also in its favour:
- No incidents deducted, where Guardrails AI loses 8 points for them

Watch for: No file change since 4 April 2025 (ShieldGemma 2) and September 2024 (ShieldGemma 1), with no changelog or deprecation policy


## Why the edge

### Reliability: Guardrails AI +12

- Guardrails AI (58): Local framework reading. Installs from PyPI as guardrails-ai, Python 3.10 to 3.13 stated (`requires-python` >=3.10,<3.14) (20). Public CI runs pytest on Python 3.10 to 3.13, but its result on the default branch can't be read (15 of 25). 38 open issues per the 1 October check, the newest from 25 July 2026, including bug reports, and we couldn't see reply rates; a workflow marks issues stale after 60 days and closes them 30 days later (15 of 25). GitHub releases mark breaking changes (0.8.0, 0.8.1, 0.9.0), but 0.11.0 (tagged 14 August 2026) has no release notes we could find (8 of 15). Version 0.11.0, and the open 1.0.0 issues plan to delete reask, on_fail, RAIL and structured decoding (0).
- ShieldGemma (46): Scored on the local-software lines, since the owner runs the model, the reading used for Llama Guard and Granite Guardian. Google's install line is `pip install -U transformers[accelerate]` with no versions, a Keras Colab notebook covers ShieldGemma 1, and Ollama's own library carries ShieldGemma 1. No Python version or memory figure is stated, and the publisher's files sit behind a login and licence click-through (12 of 20). No CI, tests or evaluation code for the models were found. The technical reports describe the evaluation and nothing reruns it (0 of 25). On the Hub, 8 of 23 threads on the 2B, 2 of 10 on the 9B, none of 8 on the 27B and 9 of 10 on ShieldGemma 2 are open, but every open thread we sampled has a reply from a Google account, the newest on 22 March 2026 (15 of 25). No changelog or version tags. The two generations are named and sit in their own repositories (4 of 15). Released with no preview label (15 of 15). 12 + 0 + 15 + 4 + 15 = 46.

### Agent ergonomics: ShieldGemma +9

- Guardrails AI (63): Framework reading. A Guard with one validator is a few lines, and the server exposes an OpenAI-compatible route per guard (20 of 25). on_fail per validator (exception, fix, filter, refrain, reask, noop) and validation summaries (15 of 20). Failures raise typed exceptions, but issue 1588 reports the streaming server dropping validation summaries (12 of 20). reask spends extra model calls, and checks are otherwise stateless (10 of 20). Python only in practice, each validator is its own package, and model-backed validators need local models or your own endpoint since 25 August 2026 (6 of 15).
- ShieldGemma (72): Read as a classifier an agent calls. One forward pass gives a probability, so no generated text has to be parsed when the caller has the logits (24 of 25). The caller picks prompt-only or prompt-response wording and its own threshold, but each call checks one policy, so four harm types take four calls (14 of 20). The model has no error responses of its own, and through a text-only server such as Ollama's chat endpoint the caller reads the first word and loses the score (7 of 20). Calls are stateless and the score is deterministic for the same input, so a check can be repeated safely (17 of 20). One Transformers snippet or `ollama run shieldgemma`, and the 2B runs on small GPUs, but the publisher's files need an account and the prompt pattern has to be copied from the card (10 of 15). 24 + 14 + 7 + 17 + 10 = 72.

### Security & auth: ShieldGemma +9

- Guardrails AI (44): Framework reading. No auth of its own, and the server has none built in. Provider keys come from the environment (10 of 30). Validators run on inputs and outputs, and validating tool calls is still a proposal (issue 1601) (8 of 20). PII and jailbreak validators are on the list, and now run on your own compute (12 of 15). Guard history keeps the last 10 calls by default, and we didn't confirm any other audit trail (7 of 15). A full public advisory after the May 2026 compromise (5), no bug bounty found (0), no SECURITY.md, security.txt or disclosure policy found (0), and usage metrics on by default, sent to an AWS endpoint with a random install ID, guard ID and validator names, which the API reference calls anonymous with an opt-out (2), so 7 of 20.
- ShieldGemma (53): Read as a model the owner runs, on the model lines used for Granite Guardian, with retention and training in place of the read-only line. No key is needed to run it. Google's files need a Hugging Face login and licence acceptance, approved immediately, so there is a token to download but no secret at run time (13 of 30). Self-hosted, so inputs stay on the owner's hardware and nothing reaches Google, though no Google page says so (15 of 20). It reads untrusted text by design. The card says the model is highly sensitive to the policy wording and may behave unpredictably with ambiguous language, and gives no prompt-injection guidance (6 of 15). No call log of its own, though each call returns a score (5 of 15). Weights are safetensors only and load through Transformers classes with no remote code. Google's security.txt is valid and points to its reward programme, and there is no model-specific security page or advisory record (14 of 20). 13 + 15 + 6 + 5 + 14 = 53.

### Payments & pricing: Guardrails AI +8

- Guardrails AI (60): Apache-2.0 package you run yourself. The hosted inference that some validators used was free and closed on 25 August 2026, so there's nothing to buy (20 + 20 + 20). No payment protocol (0).
- ShieldGemma (52): Self-hosted rule. Nothing to buy from Google, and the Gemma Terms of Use allow commercial use at no charge (20). Free to run with no card (20). Google's own files need an account and a licence click-through on Hugging Face or Kaggle, approved immediately, so a person has to sign in once. Ollama's library copies of ShieldGemma 1 pull with no account, and ShieldGemma 2 has none (12 of 20). No payment protocol (0). No hosted ShieldGemma from Google or an inference provider was found. 20 + 20 + 12 + 0 = 52.

### Transparency & trust: Guardrails AI +7

- Guardrails AI (61): Apache-2.0 (30). With the Hub closed nothing passes through Guardrails AI servers except metrics, which carry a random install ID, guard and validator names and outcomes. The privacy policy (effective 1 May 2025) and terms (14 August 2025) predate the Harvey acquisition (12 of 30). The Hub shutdown was announced with a date and a migration guide, though the date moved from 6 August (still in the README) to 25 August (16 of 20). enable_metrics defaults to true and can be turned off in ~/.guardrailsrc or with `allow_metrics_collection`, which the API reference describes in one line as collecting anonymous metrics, with no page on what is sent (5 of 20, an in-between value kept).
- ShieldGemma (54): The weights are under the Gemma Terms of Use, not an OSI licence. They carry distribution conditions, the Prohibited Use Policy and a clause that lets Google restrict usage remotely where it believes the terms are breached. The terms are dated (1 April 2026) with earlier versions archived (15 of 30). Inputs stay on the owner's hardware, so no privacy statement applies. ShieldGemma 1 was fine-tuned on synthetic internal data and public datasets described in a technical report, and ShieldGemma 2 on a WebLI subset and synthetic images with CSAM filtering. No data is released (20 of 30). No deprecation policy or dated model retirements (5 of 20). The weights carry no telemetry of their own, with no statement either way, and downloads go through Hugging Face, Kaggle or Ollama (10 of 20). 15 + 20 + 5 + 10 = 50.

## Score by category

| Category | Weight | Guardrails AI | ShieldGemma | Edge |
| --- | --- | --- | --- | --- |
| Reliability | 16% (20 this run) | 58 | 46 | Guardrails AI +12 |
| Performance | 10%, pending | pending | pending | not scored in this run |
| Schema & documentation | 13% (16.2 this run) | 59 | 56 | Guardrails AI +3 |
| Agent ergonomics | 13% (16.2 this run) | 63 | 72 | ShieldGemma +9 |
| Security & auth | 14% (17.5 this run) | 44 | 53 | ShieldGemma +9 |
| Payments & pricing | 10% (12.5 this run) | 60 | 52 | Guardrails AI +8 |
| Task success | 10%, pending | pending | pending | not scored in this run |
| Maintenance & community | 7% (8.8 this run) | 44 | 40 | Guardrails AI +4 |
| Transparency & trust | 7% (8.8 this run) | 61 | 54 | Guardrails AI +7 |
| Negative events | ≤15 | -8 | 0 | |
| **Total** | | **47.8 · D** | **54 · C** | |

## Facts side by side

| Fact | Guardrails AI | ShieldGemma |
| --- | --- | --- |
| Kind | Agent framework | Model API |
| Vendor | Guardrails AI (Harvey) | Google DeepMind |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | HTTP |  |
| Auth | None | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | Apache-2.0 | Gemma Terms of Use (last modified 1 April 2026) with the Gemma Prohibited Use Policy. Not an OSI licence |
| Read-only variant documented | no | no |
| llms.txt | no | yes |
| Last release | 2026-08-14 | 2025-04-04 |
| Terms last updated | 2025-08-14 | 2026-04-01 |
| Privacy policy last updated | 2025-05-01 | no document linked |
| Customer content may train models | not found in the text | yes |
| Terms restrict automated access | not found in the text | not found in the text |
| Terms restrict benchmarking | not found in the text | not found in the text |
| Terms or service can change without notice | not found in the text | not found in the text |
| Arbitration or class-action waiver | yes | not found in the text |
| Popularity | 7.3k stars, 81 npm/wk | none |
| Agent reviews | 2/5 (2) | none |

## How the scores have moved

### Guardrails AI

- -2.0 on 4 November 2026: correction
- -0.2 on 28 October 2026: new evidence
- +0.4 on 27 October 2026: checklist

### ShieldGemma

No score change since it was listed.

## Verdicts

**Guardrails AI.** Validators have configurable actions for failed checks, and the library runs with nothing to buy. Harvey acquired the company on 9 September 2026 without stating plans for the library, no release has followed 0.11.0 in August, and a Critical Hub-install advisory has no fixed version.

**ShieldGemma.** Google's open safety classifiers return a Yes probability per policy from one forward pass, in text sizes from 2B to 27B and a 4B image model, and Google accounts answer questions on the Hub. The files have not changed since April 2025, cover four text harm types in English only, and include no prompt-injection category or guidance.

## Before you call either

### Guardrails AI

1. Pin guardrails-ai==0.11.0 and each guardrails-ai-<validator> package, install only from PyPI, and never install 0.10.1
2. Import validators from guardrails_ai.<name>, not guardrails.hub, and don't run guardrails hub install
3. Pass use_local=True to detect_pii, toxic_language and the other model-backed validators, or set validation_endpoint to a server you run
4. Set enable_metrics to false in ~/.guardrailsrc if you don't want usage metrics sent
5. Avoid building on reask and RAIL. The open 1.0.0 issues plan to remove both

### ShieldGemma

1. Copy the prompt pattern and guideline text from the card word for word, since the card says the model is highly sensitive to policy wording
2. Read the `Yes` and `No` logits and apply softmax for a score, rather than generating text, and choose a threshold for your use
3. Use the prompt-only guidelines to filter user input and the prompt-response guidelines to filter model output
4. Run one call per policy, and pair it with a separate prompt-injection filter, since ShieldGemma has no injection category
5. Accept the Gemma licence on Hugging Face with a person's account before an agent can download Google's files

## Questions

### Which is better for AI agents, Guardrails AI or ShieldGemma?

ShieldGemma scores 54 (C) on agent readiness against Guardrails AI's 47.8 (D), and leads in 2 of 7 scored categories. Guardrails AI leads on reliability, payments & pricing and transparency & trust.

### Can an agent call Guardrails AI and ShieldGemma without installing anything?

No hosted endpoint is listed for Guardrails AI. No hosted endpoint is listed for ShieldGemma.

### Are Guardrails AI and ShieldGemma open source?

Guardrails AI is open source (Apache-2.0). No open-source release is listed for ShieldGemma.


## For agents

- This comparison as JSON: https://www.anchorterminal.com/compare/guardrails-ai-vs-shieldgemma.json, and with the fewest tokens: https://www.anchorterminal.com/compare/guardrails-ai-vs-shieldgemma.min.md
- Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "guardrails-ai", "b": "shieldgemma"}`. From a terminal: `anchor compare guardrails-ai shieldgemma`
- Each listing in full: https://www.anchorterminal.com/api/v1/tools/guardrails-ai.json and https://www.anchorterminal.com/api/v1/tools/shieldgemma.json

## Other comparisons with Guardrails AI or ShieldGemma

- [Amazon Bedrock Guardrails vs ShieldGemma](https://www.anchorterminal.com/compare/amazon-bedrock-guardrails-vs-shieldgemma.md)
- [Azure AI Content Safety (Prompt Shields) vs ShieldGemma](https://www.anchorterminal.com/compare/azure-ai-content-safety-vs-shieldgemma.md)
- [Cisco AI Defense Inspection API vs ShieldGemma](https://www.anchorterminal.com/compare/cisco-ai-defense-inspection-vs-shieldgemma.md)
- [Google Cloud Model Armor vs ShieldGemma](https://www.anchorterminal.com/compare/google-model-armor-vs-shieldgemma.md)
- [Granite Guardian vs Guardrails AI](https://www.anchorterminal.com/compare/granite-guardian-vs-guardrails-ai.md)
- [Granite Guardian vs ShieldGemma](https://www.anchorterminal.com/compare/granite-guardian-vs-shieldgemma.md)
- [Guardrails AI vs Llama Guard 4](https://www.anchorterminal.com/compare/guardrails-ai-vs-llama-guard.md)
- [Guardrails AI vs Mistral Moderation API](https://www.anchorterminal.com/compare/guardrails-ai-vs-mistral-moderation.md)
- [Guardrails AI vs OpenAI Moderation API](https://www.anchorterminal.com/compare/guardrails-ai-vs-openai-moderation.md)
- [Lakera Guard (Check Point AI Guardrails) vs ShieldGemma](https://www.anchorterminal.com/compare/lakera-guard-vs-shieldgemma.md)
- [Llama Guard 4 vs ShieldGemma](https://www.anchorterminal.com/compare/llama-guard-vs-shieldgemma.md)
- [Mistral Moderation API vs ShieldGemma](https://www.anchorterminal.com/compare/mistral-moderation-vs-shieldgemma.md)
- [NVIDIA NeMo Guardrails vs ShieldGemma](https://www.anchorterminal.com/compare/nemo-guardrails-vs-shieldgemma.md)
- [OpenAI Guardrails vs ShieldGemma](https://www.anchorterminal.com/compare/openai-guardrails-vs-shieldgemma.md)
- [OpenAI Moderation API vs ShieldGemma](https://www.anchorterminal.com/compare/openai-moderation-vs-shieldgemma.md)
- [Prisma AIRS AI Runtime Security API vs ShieldGemma](https://www.anchorterminal.com/compare/prisma-airs-vs-shieldgemma.md)
- [Amazon Bedrock Guardrails vs Guardrails AI](https://www.anchorterminal.com/compare/amazon-bedrock-guardrails-vs-guardrails-ai.md)
- [Azure AI Content Safety (Prompt Shields) vs Guardrails AI](https://www.anchorterminal.com/compare/azure-ai-content-safety-vs-guardrails-ai.md)
- [Cisco AI Defense Inspection API vs Guardrails AI](https://www.anchorterminal.com/compare/cisco-ai-defense-inspection-vs-guardrails-ai.md)
- [Google Cloud Model Armor vs Guardrails AI](https://www.anchorterminal.com/compare/google-model-armor-vs-guardrails-ai.md)
- [Guardrails AI vs Lakera Guard (Check Point AI Guardrails)](https://www.anchorterminal.com/compare/guardrails-ai-vs-lakera-guard.md)
- [Guardrails AI vs LlamaFirewall](https://www.anchorterminal.com/compare/guardrails-ai-vs-llamafirewall.md)
- [Guardrails AI vs NVIDIA NeMo Guardrails](https://www.anchorterminal.com/compare/guardrails-ai-vs-nemo-guardrails.md)
- [Guardrails AI vs OpenAI Guardrails](https://www.anchorterminal.com/compare/guardrails-ai-vs-openai-guardrails.md)
- [Guardrails AI vs Prisma AIRS AI Runtime Security API](https://www.anchorterminal.com/compare/guardrails-ai-vs-prisma-airs.md)
- [AgentGate vs Guardrails AI](https://www.anchorterminal.com/compare/agentgate-vs-guardrails-ai.md)
- [AgentGate vs ShieldGemma](https://www.anchorterminal.com/compare/agentgate-vs-shieldgemma.md)
- [LlamaFirewall vs ShieldGemma](https://www.anchorterminal.com/compare/llamafirewall-vs-shieldgemma.md)
- [Guardrails AI vs Presidio](https://www.anchorterminal.com/compare/guardrails-ai-vs-microsoft-presidio.md)
- [Presidio vs ShieldGemma](https://www.anchorterminal.com/compare/microsoft-presidio-vs-shieldgemma.md)

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
