Back to blog
guardrailsLlama GuardNeMo GuardrailsPrompt ShieldsAI agents

LLM Guardrails: What Prompt Filters Let Through

Published on 2026-11-096 min read
In short: Guardrails (Llama Guard, NeMo Guardrails, Azure Prompt Shields and their equivalents) are filters that read text and classify it. They catch part of the injection attempts and prohibited content, but none of them decides whether a specific action is allowed for a specific user, and published research regularly bypasses the ones that were tested. Treat them as a detection layer sitting behind limited permissions and human approval of sensitive actions.

What is a guardrail for an AI agent?

It is a component placed before or after the model (or around its tool calls) that examines a piece of text and lets it through, blocks it or flags it. It can be a small classification model, a rules engine or a cloud service. Three families coexist:

  • Content classifiers judge whether an input or output falls into a prohibited category (violence, personal data and so on).
  • Injection detectors look for instructions that try to hijack the model (see prompt injection).
  • Flow-control frameworks orchestrate "rails" on inputs, outputs, retrieved documents and tool calls.

The right question for each product: which step of the flow does it watch, and for which category of risk? Vendor documentation answers it, and we re-read those pages for the table below.

What do Llama Guard, NeMo Guardrails and Azure Prompt Shields cover?

Each covers a precise scope, narrower than the word "guardrail" suggests. Summary based on the vendors' documentation:

ProductWhat the documentation describesWhat it detects or controlsLimits stated by the vendor
Llama Guard 3 (Meta, 8B)Content safety classifier fine-tuned from Llama 3.1 8B, assessing an LLM's inputs and responses14 risk categories (the 13 of the MLCommons taxonomy plus code interpreter abuse), 8 languages including FrenchDepends on its training data; may be susceptible to adversarial and prompt injection attacks; may refuse benign requests
NeMo Guardrails (NVIDIA)Framework of configurable "rails"Input, retrieval (documents and chunks), dialog, execution (tool calls and arguments) and output railsThe page presenting the rail types states no limits; effectiveness depends on the rules and models you configure
Azure Prompt Shields (Microsoft)Service detecting attempts to manipulate the model through adversarial inputsUser prompt attacks (changing rules, conversation mockups, role-play, encoding) and document attacks (instructions hidden in documents, emails, web pages)Does not determine whether content is harmful, accurate, grounded or compliant; trained and evaluated mainly on English; does not verify the provenance of submitted content

A few Azure configuration details that matter in practice: in Foundry, user prompt attack detection is on by default, while document attack detection is off by default and must be enabled. For agents, scanning tool responses is available in preview for supported tools. The standalone API analyzes one prompt and up to five documents per call, and your application decides what to do with the result.

What slips through?

Three categories of risk escape a text filter, even a well-configured one:

  • Actions that look legitimate. An agent that exports every customer because a polite message asked triggers no content alert. The filter sees acceptable text; only a permission check on the tool sees the problem. That is excessive agency (LLM06), detailed in our article on the topic.
  • Abuse of rights. A genuine user asking the agent for another customer's data writes nothing malicious. That isolation is tested on the data side, as in the article on multi-tenant isolation.
  • Adaptive attacks. The filter is a component the attacker can probe and bypass.

On that last point, two published studies are instructive, with their scope:

  • Hackett and co-authors (April 2025, revised July 2025) tested six protection systems, including Microsoft's Azure Prompt Shield and Meta's Prompt Guard, with two evasion methods (character injection and algorithmic attacks). They report evasion reaching up to 100% success in some instances while preserving the attack's effect.
  • Nasr, Carlini, Tramèr and co-authors (October 2025) bypassed 12 recent defenses against jailbreaks and prompt injections using adaptive attacks. Success rates exceeded 90% for most, whereas those defenses originally reported near-zero rates. The authors argue a defense should be evaluated against an attacker who adapts to it.

These results do not invalidate filters. They remind us that a detection rate measured on known attacks is no guarantee against an attacker who adjusts their attempts.

How do you test a guardrail honestly?

You measure what it blocks, what it lets through and what the agent can do when it is wrong. A four-step test:

  1. Establish a baseline without the filter. Which injection payloads work against the bare agent? Without it you cannot say what the filter adds.
  2. Replay the same payloads with the filter on. Record the detection rate by category: direct injection, document, image, encoding, language other than English.
  3. Attack the filter itself. Rephrasing, splitting across several messages, encodings, Unicode characters, other languages, a payload hidden in a file. This track imitates the adaptive attacker of the studies above. To automate part of the attempts, see our Promptfoo, Garak and PyRIT comparison.
  4. Check the safety floor. Assume the filter fails: what can the agent do with its permissions? The test concludes on impact through the tools, and the detection score comes after.

Measure false positives too: an overly strict filter ends up disabled by the team, which is the worst configuration. The Llama Guard 3 model card itself warns of possible refusals of benign prompts.

If your agent speaks French, test in French. Llama Guard 3 lists French among its languages, but Azure's documentation says its models are mainly trained and evaluated on English and recommends evaluating every language your application uses with representative attacks.

Where do guardrails belong in an agent architecture?

Where they detect without carrying the decision alone. A reasonable layout:

  • User input and retrieved documents: injection detection, first in "annotate" mode to measure, then "block" once false positives are known.
  • Tool responses: this is where instructions from web pages, emails and files arrive. See file-based injection.
  • Tool calls: deterministic rules (allowed-action list, parameter validation, caps) that rely on no model.
  • Sensitive actions: human approval with the exact action displayed, see human-in-the-loop.
  • Logging of what the filter detected or let through, for audit and incident response.

OWASP recommends combining input and output filtering with least privilege, human approval of risky actions and adversarial testing, and states it is unclear whether fool-proof prevention exists.

Should you deploy a guardrail anyway?

Yes, as a detection layer with realistic expectations. A filter reduces the noise of opportunistic attacks, produces usable signals in the logs and can block content your policy prohibits. It does not replace permission separation, human approval or regular testing. Plan for its upkeep too: detection models evolve, so do your agents, and a filter never retested after an update gives a false impression of coverage.

How does CleanIssue assess an agent protected by a guardrail?

We test the agent with and without the filter, then attack the filter: the report shows what it stopped, what it let through and the real impact on the agent's tools. The Agent Red Team Express (€1,900, 5 days, start within 48 hours after the quote and authorization are signed) covers one agent; several agents, or different filtering setups per customer, fall under the Custom Red Team, quoted individually. Tests run on development or staging by default; production is targeted only at the client's written request. The first step is a free 30-minute discovery call.

Does your product ship an AI agent? CleanIssue tests what a stranger can make it do with the Agent Red Team Express (5 days, €1,900), or a custom red team for several agents and MCP servers. First step: a free 30-minute discovery call.

Know what your agent can do before an attacker does.

A free 30-minute discovery call: you describe your agent, I tell you what I would test and what it costs. Five case studies are published.

Book a call