Guardrails that work: classifiers, policies and moderation in production
No single filter holds on its own. Guardrails that work are a stack of layers, each measured on your data and in your languages. This is the stack we recommend, with the guard models available in September 2026.
A guardrail is not one filter but a stack of seven layers, from input screening to logging and monitoring. Open guard models now cover most of these layers, and some read your policy as plain-language input, which helps when it is written in Spanish or French.
Jailbreak research shows why layers matter: long-context, repeated-sampling and multi-turn attacks each beat a single model or filter. Measure every layer on your own labeled set, in each language: false positives, false negatives, latency and cost.
Seven layers, not one filter
Each layer catches a different failure; together they cover what no single model can.
| Layer | What it does | Typical tools | What it catches |
|---|---|---|---|
| 1. Input screening | Classifies the request and retrieved content before the model | Prompt Guard 2, Prompt Shields, Qwen3Guard | Jailbreaks, injection, out-of-policy requests |
| 2. System policy | States what the product does and declines | System prompt, versioned like code | Scope drift |
| 3. Model choice | A well-aligned, well-calibrated model for the job | Your evaluation suite | Over- and under-refusal at the source |
| 4. Output classification | Checks each answer against the policy | Llama Guard 4, gpt-oss-safeguard, Shieldstral | Harmful output that got through |
| 5. Tool permissions | Limits what an agent can do, whatever the model decides | Least privilege, allowlists, confirmations | Damage from a successful injection |
| 6. Human review | Sends flagged or high-impact cases to a person | Review queue | Ambiguous cases, irreversible actions |
| 7. Logging and monitoring | Records inputs, outputs and verdicts | Traces, dashboards, alerts | Slow multi-turn attacks, drift, abuse |
Layers 5 and 7 do not depend on any model being right, which is why they hold when the others fail. The UK's NCSC says the same about prompt injection: treat it as a residual risk and limit its impact with deterministic, non-LLM controls.
The guard models available in September 2026
| Model | Vendor, date | License, deployment | Languages | Scope and notes |
|---|---|---|---|---|
| Llama Guard 4 (12B) | Meta, Apr 2025 | Llama 4 Community; self-hosted | English + 7, incl. Spanish and French | Prompts and responses, text and images, 14 categories |
| Prompt Guard 2 (86M, 22M) | Meta, Apr 2025 | Llama 4 Community; self-hosted | Multilingual; bigger gaps in 22M | Input attacks only; vulnerable to adaptive attacks |
| ShieldGemma 2 (4B) | Google, Apr 2025 | Gemma Terms; self-hosted | English training data | Images only, three policies |
| Granite Guardian 4.1 (8B) | IBM, Apr 2026 | Apache 2.0; self-hosted | English | Harm, jailbreak, RAG groundedness, agent tool calls; custom criteria |
| Qwen3Guard-Gen (0.6B to 8B) | Alibaba, Oct 2025 | Apache 2.0; self-hosted | 119 languages and dialects | Safe, controversial or unsafe |
| gpt-oss-safeguard (20B, 120B) | OpenAI, Oct 2025 | Apache 2.0; self-hosted | Test on your data | Reads your policy; reasoned verdicts |
| Shieldstral 1.0 (3B) | Mistral, Aug 2026 | Apache 2.0; one 16 GB GPU | 12, incl. Spanish and French | Reads your policy; text and images |
| Moderation API | Mistral | Managed API | Test on your data | About 10 categories, inputs and outputs |
| NeMo Guardrails + NemoGuard | NVIDIA | Apache 2.0 toolkit; self-hosted | Depends on the models | Rails at input, retrieval, dialog, execution and output |
| Prompt Shields | Microsoft | Managed Azure service | Test on your data | Direct and indirect (document) attacks |
| Constitutional Classifiers | Anthropic, 2025 and 2026 | Proprietary; only inside Claude | Not applicable | Two-stage cascade |
Note that “guard model” covers different jobs. Prompt Guard 2 and Prompt Shields look for attacks in inputs, ShieldGemma 2 moderates images, NeMo Guardrails orchestrates other models and the rest judge content against a policy. Every card also lists limits, from English-only evaluation to weaker reliability on obfuscated inputs.
Policy-as-prompt classifiers help in Spanish and French
Classic guard models bake a fixed taxonomy into their weights, such as Llama Guard 4's 14 hazard categories. Policy-as-prompt classifiers (gpt-oss-safeguard, Shieldstral and Granite Guardian's “bring your own criteria” mode) read your policy as plain-language input at inference time, next to the content being judged. Changing the policy means editing text, not collecting labeled data and retraining.
The legal or compliance team that owns the policy can write it in the language of the business, with its own examples: what counts as financial advice for a Colombian bank, or as a medical claim for a French insurer. One model applies it across products, and every change is versioned and reviewable.
Two cautions. Accuracy depends on wording: Google warns that ShieldGemma 2 is “highly sensitive” to how safety principles are described. And reasoning costs money: gpt-oss-safeguard offers low, medium and high effort, and Granite Guardian 4.1 a thinking and a non-thinking mode, so the usual design is a cascade: a fast single-pass classifier first, the reasoning judge only for flagged or ambiguous content.
Treat the policy like code: a short document with definitions and examples per language, an owner, a version and tests on your labeled set before every deployment.
Measure on your own labeled set
Vendor numbers say a model is plausible; only your data says it works.
Build the set from real traffic, in each language: clearly allowed requests, clearly disallowed ones and, above all, the borderline cases where over-refusal lives. Public benchmarks help seed it (XSTest and OR-Bench for over-refusal, SORRY-Bench for unsafe requests), but they are mostly in English and do not know your policy.
| Metric | Why it matters | How to read it |
|---|---|---|
| False positives (over-blocking) | Legitimate users get refused and leave or work around you | Per language and per category, not only overall |
| False negatives (missed harm) | Harmful content or actions get through | Weighted by severity: a miss on self-harm outweighs many on profanity |
| Latency | Each layer adds at least one call | 95th percentile, end to end, streaming included |
| Cost | Guard calls are billed like any other | Per 1,000 conversations, cascade included |
Vendor figures show the trade-offs. Meta reports 97.5% recall at a 1% false-positive rate for Prompt Guard 2 86M. Anthropic's first Constitutional Classifiers cut jailbreak success from 86% to 4.4% in its tests, at 23.7% more compute and 0.38 points more refusals; the 2026 cascade brought over-refusal to about 0.05% and overhead to roughly 1%. Useful references, but none measures your policy in your languages: that is the job of your own evals.
What jailbreak research shows
Four results, described at the conceptual level only.
- Many-shot jailbreaking (Anthropic, 2024) fills a long context with fake dialogues in which an assistant complies. Harmful answers rise with the number of examples, and larger models proved more susceptible. Training the model to resist only delayed the effect; classifying and rewriting the prompt first cut attack success from 61% to 2% in one internal test.
- Best-of-N (2024) resends a request with random surface variations until one gets through, with no access to the model's internals. With enough attempts, the authors report 89% success on GPT-4o and 78% on Claude 3.5 Sonnet, and it also got past defenses such as circuit breakers.
- Crescendo (Microsoft, 2024) escalates over several turns, each harmless on its own: 98% success against GPT-4 and 100% against Gemini Pro in its authors' tests.
- Bug bounties show what layering buys. In Anthropic's February 2025 challenge, 339 researchers sent over 300,000 messages and one found a universal jailbreak. Against the 2026 system, some 198,000 attempts had found none by January 2026, with rewards of up to $35,000.
The lesson: long context beats a single safety-trained model, repeated sampling beats a single static classifier, and multi-turn escalation beats per-message filtering. Classify whole conversations, rate-limit, watch for bursts of near-identical retries and keep layers that do not depend on any model.
A guard model is also a model. Meta's cards say Llama Guard 4 “may be susceptible to adversarial or prompt injection attacks” and Prompt Guard 2 is “vulnerable to adaptive attacks”. Treat each verdict as one signal among several, never as proof of safety.
Two reference architectures
A customer chatbot mostly risks bad answers; an internal agent mostly risks bad actions.
| Stage | Customer-facing chatbot | Internal agent with tools |
|---|---|---|
| Input | Light injection and jailbreak classifier, plus a content check | Same, plus every retrieved document, email or tool result treated as untrusted |
| Policy | Short product policy; AI disclosure at the first interaction | Task scope and allowed tools and data, in the system prompt |
| Model | Well-calibrated, measured for over-refusal in your languages | The strongest model your evaluation justifies |
| Output | Policy-as-prompt classifier: allow, rewrite, block or hand off | Output classifier, plus a check that each tool call matches the user's request |
| Actions | None beyond answering; account changes go to a human | Least privilege, egress allowlists, confirmation before sending, paying or deleting |
| Oversight | Weekly sample review of refusals and blocks | Human approval for high-impact actions; full traces |
For agents, no classifier replaces capability limits: an agent that cannot send email cannot be tricked into leaking data by email. More patterns in prompt injection and agent security and AI agents in production.
What it means for companies in Colombia and Europe
Languages. Check each guard model's coverage against your real traffic: Llama Guard 4 and Shieldstral list Spanish and French, Qwen3Guard claims 119 languages, and Granite Guardian 4.1 and ShieldGemma 2 were trained on English data. Measure in Colombian Spanish and in French, with slang, typos and mixed languages, not on translated benchmarks.
Data residency. Most open guard models ship under Apache 2.0 and run on your own infrastructure, so screened content never leaves it. Their logs hold the most sensitive text in your system: in Colombia they fall under Ley 1581 de 2012, in the EU under the GDPR, with retention and access rules to match.
Regulation. In the EU, Article 50 of the AI Act has required since August 2, 2026 that people be told they are interacting with an AI system. From December 2, 2026, an image or video generator that can foreseeably and reproducibly produce non-consensual intimate images or child abuse material needs safeguards that reliably prevent it, or falls under the new prohibitions: there, guardrails become a legal requirement. Details in our 2026 regulatory map.
Launch checklist
- Write the policy: scope, definitions, allowed and disallowed examples per language, owner and version.
- Build a labeled set from real traffic, borderline cases included, in every language you serve.
- Choose guard models on measured errors, latency and cost, not on vendor tables.
- Put a light input classifier first and treat all retrieved content as untrusted.
- Classify outputs against the same policy, with a defined action per verdict: allow, rewrite, block or hand off.
- Give agent tools least privilege and require confirmation for irreversible actions.
- Log inputs, outputs, verdicts and model versions under a retention policy; alert on retry bursts and escalating conversations.
- Red-team before launch, multi-turn and many-attempt attacks included, and again after every model or policy change.
- Review refusals and blocks weekly and feed the errors back into the labeled set.
Key takeaways
- Guardrails are a stack of seven layers; tool permissions and logging still hold when every model fails.
- Open guard models cover most needs in 2026, several under Apache 2.0; check language coverage, since some were trained on English only.
- Policy-as-prompt classifiers let your legal or compliance team write and version the policy in Spanish or French without retraining.
- Measure false positives, false negatives, latency and cost on your own labeled set; vendor figures are only a starting point.
- Many-shot, Best-of-N and multi-turn attacks each beat a single filter: classify whole conversations and watch for bursts of retries.
Sources
- Llama Guard 4 12B: model card
- Llama Prompt Guard 2 86M: model card
- Qwen3Guard-Gen-8B: model card
- Introducing gpt-oss-safeguard
- Granite Guardian 4.1 8B: model card
- Shieldstral 1.0 3B: model card
- Prompt Shields in Azure AI Content Safety
- NeMo Guardrails
- Next-generation Constitutional Classifiers: More efficient protection against universal jailbreaks
- Many-shot jailbreaking
- Best-of-N Jailbreaking
- Great, Now Write an Article About That: The Crescendo Multi-Turn LLM Jailbreak Attack
Editorial note: this analysis reflects the public information available on the review date. Models, prices and rules change fast; every third-party figure links to its source, and our opinions are labeled as such. Spotted an error? Write to contact@slash-digital.io.
The questions we hear often
What is a guard model?
A model trained or prompted to classify prompts, responses or images against a safety policy, such as Llama Guard 4, Qwen3Guard or gpt-oss-safeguard. It sits around your main model and returns a verdict, not an answer for the user.
Which guard model should we test first?
For self-hosting in Spanish and French, compare Llama Guard 4, Qwen3Guard and Shieldstral on your labeled set, and consider gpt-oss-safeguard as a reasoning judge for flagged cases. Keep the one whose errors are most acceptable on your data.
Do guardrails slow the chatbot down?
Every layer adds at least one model call. Keep the input check light, escalate to heavier judges only for flagged content and measure 95th-percentile latency end to end.
Can a guard model be fooled?
Yes. Meta's own cards warn that Llama Guard 4 may be susceptible to adversarial attacks and Prompt Guard 2 to adaptive attacks. That is why classifiers are one layer among several, with permissions, monitoring and human review behind them.
Is a good system prompt enough?
No. It states the policy, but many-shot, repeated-sampling and multi-turn attacks are designed to get around exactly that. Pair it with input and output classifiers, tool limits and logging.
More analysis to read next
Prompt injection and agent security: risk number one
Why prompt injection is still unsolved, what the 2025–2026 incidents show and which controls actually work for agents and chatbots.
Local AI and open weightsUncensored models: what they are and what they risk
What removing a model's safeguards really means, why the ecosystem exists, what it breaks, what the law bans in 2026 and what to use instead.
Agents and engineeringAI agents in production: what works in 2026
Workflow or agent, the eight building blocks, adoption and failure data, computer use, design rules, costs, security and a launch checklist.
Where to next
Let's put it in production
Tell us your challenge. We reply within 24 business hours with an honest first read: if we can help, we'll say how; if not, we'll say who can.
I reply personally. No endless forms, no canned replies.