Guardrail Tools: The Landscape (October 2026 snapshot)¶
TL;DR
Enforce authorization with deterministic policy engines first. Use OPA, Cedar, or OpenFGA for RBAC and tool access before adding probabilistic classifiers.
Combine specialized guardrail layers. Pair an injection classifier or managed API, a PII engine, a policy engine, a gateway check on every tool call, and red-teaming tools.
Know what each detector actually checks. Content-safety models like Llama Guard do not detect prompt injection or enterprise data leaks.
Measure every guardrail on your own traffic. Track false-positive rate, false-negative rate, and p95 latency across your domain documents and languages. Roll out in shadow → flag → block stages.
You will learn:
What each guardrail tool detects and where it runs
Open models vs managed APIs vs policy engines
Agent, MCP, and gateway security tools, and the commercial AI-security platforms
Capability matrix and latency profiles
How to evaluate guardrails, including public benchmarks
This document reflects the ecosystem as of October 2026. Security companies acquired several guardrail vendors during 2025–2026, and maintainers archived several popular open-source projects (see Ownership and status changes).
Check repository status first: Review the project's README, changelog, latest release date, license, and archive status before you adopt it.
Look past detector marketing names: "Prompt injection detection" can mean a 22M-parameter classifier or a slow reasoning LLM with different recall and latency.
Benchmark every guardrail on your own data: Never deploy a guardrail in production before you measure its accuracy and latency (Evaluate guardrails on your own data).
The architecture in 04-guardrails is durable, while product names change rapidly. Wrap every guardrail behind your own interface so you can swap vendors easily.
flowchart LR
U["User prompt"] --> IN["Input checks: injection, jailbreak, PII, topic"]
IN --> AG["Agent / LLM"]
D["Retrieved docs and tool outputs"] --> CTX["Context checks: indirect injection, ACL filtering"]
CTX --> AG
AG --> ACT["Tool-call checks: authorization policy, args validation, approval"]
ACT --> T["Tools: SQL, create_ticket"]
AG --> OUT["Output checks: toxicity, PII leakage, groundedness, format"]
OUT --> R["Response to user"]
subgraph S1["Frameworks"]
F1["NeMo Guardrails / Guardrails AI / LlamaFirewall"]
end
subgraph S2["Classifiers and APIs"]
F2["Llama Guard / Prompt Guard / Granite Guardian / ShieldGemma / Azure / Bedrock / Model Armor / OpenAI / Lakera"]
end
subgraph S3["Deterministic"]
F3["Presidio / OPA / Cedar / OpenFGA"]
end
Frameworks orchestrate checks across the request path. Classifiers and managed APIs detect risks probabilistically. Policy engines and PII recognizers authorize or redact deterministically or semi-deterministically. Red-teaming tools attack the full pipeline offline and in CI.
Each card covers six fields: Link · Type/License · Strengths · Detects/covers · Best for · Watch-outs. "Detects/covers" lists only capabilities documented by the project.
Runs programmable rails at five stages: input, dialog, retrieval, execution, and output. Adds tool-calling rails that validate tool names and JSON-Schema arguments and check that each tool result matches a prior call. Uses Colang to model conversational flows and topic boundaries. Integrates self-check prompts, jailbreak detection, RAG fact-checking, Presidio, GLiNER, Llama Guard, Patronus, Cleanlab, Guardrails AI, and commercial security APIs.
Detects/covers
Jailbreak heuristics, prompt and code injection, PII (via Presidio or GLiNER), content safety (via Llama Guard or the NVIDIA NemoGuard safety models), topic safety, RAG groundedness, off-topic dialog, invalid tool calls, and unsafe tool execution.
Best for
Teams that want one programmable orchestration layer around the LLM with dialog and topic control.
Watch-outs
Colang requires learning a custom DSL, and Colang 1.0 and 2.x syntax differ. Every LLM-based rail adds a model call, so measure latency per rail. The built-in tool-call and tool-result validation needs the opt-in experimental IORails engine and supports only the OpenAI Chat Completions format. These checks fail closed. Anonymous usage telemetry is on by default. Set NEMO_GUARDRAILS_NO_USAGE_STATS=1 or DO_NOT_TRACK=1 before the library starts in regulated deployments (README).
OSS framework (Python), Apache-2.0, with a community validator hub and commercial hosted offering
Strengths
Composes hub validators (PII, toxicity, competitor mentions, regex, valid SQL, JSON schema, provenance) inside a Guard object. Enforces explicit failure actions via OnFailAction (reask, fix, filter, refrain, noop, exception, fix_reask, custom). Excels at Pydantic structured output validation and can run as a server.
Detects/covers
Depends on installed validators: PII, toxic language, jailbreaks, off-topic text, hallucination/provenance, schema validity, and custom rules.
Best for
Validating and repairing structured outputs (such as generated SQL or ticket payloads) using pluggable checks.
Watch-outs
Hub validator quality varies, and some validators download models or call external LLMs. Avoid reask loops on latency-sensitive paths, and pin validator versions.
OSS framework from Meta's Purple Llama project. The framework is MIT. The Prompt Guard 2 weights it loads stay under the Llama community license.
Strengths
Targets agentic systems by layering specialized scanners: PromptGuard 2 for fast injection classification, AlignmentCheck to audit chain-of-thought reasoning for goal hijacking, CodeShield for insecure code detection, a hidden-ASCII scanner, and custom regex and LLM-check scanners.
Detects/covers
Direct prompt injection and jailbreaks, indirect injection that hijacks agent goals, insecure generated code, hidden Unicode tag characters, and custom regex patterns. An experimental PII-check scanner also exists.
Best for
Agent pipelines that execute tools or code and need trajectory alignment checks in addition to text scanning.
Watch-outs
AlignmentCheck and PIICheck live in scanners/experimental. By default they call a hosted Llama model through the Together API (TOGETHER_API_KEY), so agent traces leave your network. Point them at a self-hosted endpoint if you have data-residency rules. AlignmentCheck invokes a capable LLM at each agent step and adds significant latency. Benchmark this newer framework carefully on your own traces.
You host these open-weight models on your own infrastructure. They give you full data residency and predictable compute cost, while your team manages model serving, scaling, and threshold calibration.
Open weights under Meta's Llama community license (custom, non-OSI license)
Versions
• Llama Guard 1 (Dec 2023, 7B) • Meta-Llama-Guard-2-8B (Apr 2024) • Llama-Guard-3-8B (Jul 2024) • Llama-Guard-3-1B and Llama-Guard-3-11B-Vision (Sep 2024) • Llama-Guard-4-12B (Apr 2025, natively multimodal for text and multiple images, pruned from Llama 4 Scout)
Strengths
Classifies both user prompts and model responses as safe or unsafe and outputs violated category codes. Llama Guard 3 and 4 use 14 categories (S1–S14): the 13 MLCommons hazards plus Meta's own S14 Code Interpreter Abuse. Llama Guard 2 used 11 MLCommons-based categories, and Llama Guard 1 used Meta's own 6-category taxonomy. All versions accept custom category definitions in the prompt.
Detects/covers
Violent and non-violent crimes, sex-related crimes, child exploitation, defamation, specialized advice, privacy violations, intellectual property, indiscriminate weapons, hate, self-harm, sexual content, elections, and code interpreter abuse.
Best for
Self-hosting input and output content-safety classification. Use the 1B variant for tight latency budgets.
Watch-outs
Llama Guard is a content-safety classifier, not a prompt-injection detector. It will mark an enterprise salary-table leak as "safe" unless it violates a harm category. Host 8B and 12B models on GPUs.
• Prompt-Guard-86M (v1, 2024) • Llama-Prompt-Guard-2-86M (multilingual) and Llama-Prompt-Guard-2-22M (DeBERTa-xsmall architecture with ~75% lower latency than 86M)
Strengths
Runs tiny BERT-style classifiers. Meta reports about 19 ms (22M) and 92 ms (86M) per 512-token classification on an A100 GPU (model card). Small enough to scan every user prompt and every retrieved document chunk. Benchmark CPU latency yourself.
Detects/covers
v2 performs binary benign/malicious classification for prompt injections and jailbreaks (v1 output separate injection and jailbreak labels). Meta states that the models focus on explicit, known attack patterns, such as text that explicitly tries to override prior instructions.
Best for
Running a fast first-pass filter over user inputs and untrusted context (retrieved chunks and tool outputs).
Watch-outs
Enforces a 512-token context window, so split long documents into segments and score each segment (in parallel if you can). Expect lower recall on subtle or indirect injections in retrieved text. Do not rely on Prompt Guard 2 alone for indirect injection. Tune thresholds for false positives on security-related text, and pair with architectural defenses (Retrieval & context guardrails).
• 3.0 → 3.2 (2024–2025) • 3.3 8B (Aug 2025) with hybrid think/no-think modes • 4.1 8B (Apr 2026) with improved Bring Your Own Criteria (BYOC) for multi-part policies
Strengths
Evaluates prompts and responses for both general harm and RAG or agent risks under a permissive Apache-2.0 license. Supports natural-language BYOC policies, fast no-think scoring, and explainable think reasoning traces.
Self-hosting RAG groundedness, tool-call validation, and content safety under an Apache-2.0 license.
Watch-outs
Requires GPU serving for low-latency 8B inference, and think mode increases latency. Calibrate groundedness score thresholds against your own labeled dataset.
Scores policy violations conditioned on the policy text you pass in the prompt. Offers 2B, 9B, and 27B text model sizes so you can trade accuracy for latency.
Detects/covers
Text: sexually explicit content, dangerous content, harassment, and hate speech. Image: sexually explicit content, dangerous content, and violence/gore.
Best for
Self-hosting content moderation with tunable probability thresholds or scanning images for safety.
Watch-outs
Detects content harms only, not prompt injection, PII, or RAG groundedness. Evaluates one policy per call, so checking multiple custom policies multiplies inference calls.
Uses a safety reasoning model to classify content against any custom written policy you supply at inference time. Explains its reasoning and adapts to new policies without retraining.
Detects/covers
Any custom business policy you write (such as blocking customer PII exports or unauthorized cross-team ticket priority changes).
Best for
Enforcing nuanced, domain-specific policies offline or generating training labels for a smaller, faster classifier.
Watch-outs
Reasoning models run much slower and cost more compute than small classifiers. Use them for asynchronous review or dataset labeling rather than inline hot paths. Requires the harmony response format.
0.6B, 4B, and 8B sizes. Labels prompts and responses as safe, controversial, or unsafe. Categories include PII and Jailbreak. Gen supports 119 languages and dialects. The Stream variant classifies tokens as the model generates them, for real-time output checks.
Decide how to treat the "controversial" tier for each risk tier. Benchmark recall on your languages and domain.
Combines Analyzer (NER, regex, checksum, and context-word recognizers), Anonymizer (redact, replace, mask, hash, or reversibly encrypt), Image Redactor, and Structured data redaction. Supports custom recognizers for internal employee or ticket IDs.
Detects/covers
Names, emails, phone numbers, credit cards, IBANs, national IDs across multiple countries, IP addresses, locations, dates, and custom internal patterns.
Best for
Self-hosting PII detection and redaction across user inputs, retrieved chunks, telemetry traces, and model outputs.
Watch-outs
Default NER models miss names in messy enterprise text. Tune confidence thresholds, add custom regex and deny-lists, and monitor community governance activity.
Commercial Azure service (also integrated into Microsoft Foundry content filters)
Strengths
Offers a comprehensive single-vendor safety suite. Prompt Shields detects both direct user prompt attacks and indirect document attacks hidden in retrieved text or emails. Groundedness detection checks answers against source chunks, and task adherence flags misaligned agent tool calls.
Detects/covers
Hate, sexual, violence, and self-harm with severity levels, protected text and code material, custom categories, direct and indirect prompt attacks, ungrounded claims, and agent task adherence.
Best for
Azure-hosted applications that want prompt injection, harm filtering, and groundedness checks from one managed API.
Watch-outs
Several features remain in preview, vary by Azure region, or enforce character limits. Verify regional availability and container options before committing.
Bundles content filters (Hate, Insults, Sexual, Violence, Misconduct, Prompt Attack), natural-language denied topics, word filters, PII filters (block or mask), contextual grounding checks, and Automated Reasoning checks. Automated Reasoning validates responses against a logic policy that AWS extracts from your uploaded policy documents. The ApplyGuardrail API works independently with any model.
Detects/covers
Harmful content, jailbreaks, prompt injection, prompt leakage (Standard tier), PII, off-topic queries, and ungrounded or irrelevant answers. Automated Reasoning returns findings about policy-rule violations but does not block content.
Best for
AWS-hosted applications that want one managed policy for topic boundaries, PII masking, and grounding checks on single-turn or summarization flows.
Watch-outs
Compare Standard tier (stronger multilingual and code support, cross-Region inference) against Classic tier (English, French, Spanish). Contextual grounding: AWS states that conversational QA and chatbot use cases are not supported. Limits are 100,000 characters of grounding source, 1,000 for the query, and 5,000 for the response. You must pass retrieved chunks explicitly. With streaming, an irrelevant response can reach the user before the check flags it. Automated Reasoning: detect mode only (your app must act on the findings), English (US) only, no streaming, and GA in seven Regions. You must review and test the extracted policy before you rely on it (docs).
Screens prompts, responses, and documents for any model, regardless of cloud host. Uses separate input and output templates with configurable confidence thresholds (HIGH, MEDIUM_AND_ABOVE, LOW_AND_ABOVE). Scans PDF, CSV, TXT, and Office files up to 4 MB. Screens images (Preview). Integrates with Google Cloud MCP servers and Agent Gateway to screen agent and tool traffic.
Detects/covers
Responsible AI harms (sexually explicit, dangerous, harassment, hate), CSAM, prompt injection and jailbreaks, sensitive data via Cloud Sensitive Data Protection infoTypes, and malicious URLs (up to 256 URLs per payload).
Best for
GCP-hosted applications and pipelines that scan uploaded documents before indexing them for RAG.
Watch-outs
Does not include a RAG groundedness check or topic control. Prompt-injection, RAI, and CSAM filters read up to 65,536 tokens. Sensitive Data Protection reads up to 130,000 tokens (0.5 MB). Prompt-injection detection returns no match for inputs shorter than three words. Exclusion rules (Preview) help you reduce false positives. Calibrate confidence levels carefully because LOW_AND_ABOVE increases false positives.
Runs omni-moderation-latest across text and images and returns per-category probability scores at zero API cost. You can call the standalone endpoint, or pass a moderation object in a Responses or Chat Completions request to get scores for the input and output with no separate call.
Detects/covers
Harassment, hate, illicit behavior, self-harm, sexual content, violence, and their subcategories.
Best for
Adding a free baseline content-safety check on user inputs and model outputs.
Watch-outs
Checks content harms only. It does not detect prompt injection, PII, off-topic queries, or hallucinations, and you cannot customize categories. Inline moderation does not block generation. Read the scores before you show the output or take an action.
Commercial platform with SaaS and self-hosted container deployment options
Strengths
Focuses on adversarial AI security backed by data from the Gandalf red-teaming game. Provides low-latency per-project policies and agent-specific behavioral defenses.
Detects/covers
Prompt Defense (direct and indirect injection), Content Moderation, Data Leakage Prevention (PII and system prompt leaks), malicious links, and Agent Behavior Defense (goal-deviation checks and tool allow/deny lists).
Best for
Teams that want a dedicated prompt-injection detector with a self-hosted container option.
Watch-outs
Expect product packaging updates following the Check Point acquisition. Benchmark false-positive rates on your own domain traffic.
Demonstrated an influential four-layer defense: heuristics, LLM classification, a vector database of prior attacks, and canary tokens injected into system prompts to detect prompt leakage.
Best for
Learning layered defense concepts and copying the canary-token pattern for system prompt leak detection.
Watch-outs
Unmaintained prototype. Do not deploy Rebuff in production.
LLM classifiers only estimate risk probabilistically. Authorization must be deterministic. In our running example, a deterministic policy engine must decide whether a user can read a document, query a database table, or create a ticket in a queue. The agent cannot talk its way around a policy engine. See Access control & RBAC.
Zanzibar-style relationship-based access control (ReBAC)
Filtering document permissions at retrieval time (such as checking whether a user can view a parent folder) at scale
Follow these proven authorization patterns:
Filter retrieval ACLs before prompting: Filter chunks using the end user's identity before they enter the prompt, never the service account's identity.
Authorize every tool call with concrete arguments: Check the end user's identity, the tool name, and the exact argument values on every call.
Log every policy decision in the trace: Record the input, allow/deny decision, and policy version on the same OpenTelemetry trace as the LLM call.
Test policies like application code: Write unit tests for allow/deny rules and run regression suites whenever roles or schemas change.
Agentic RAG apps call tools through MCP servers and AI gateways. These are good choke points for guardrails, because every tool call passes through them. Keep the tool-call gate and tool tiers from Tool & action guardrails (§2 and §6). Use the tools below to enforce or audit them.
Gateway turns APIs and Lambda functions into MCP tools behind one endpoint. Policy checks each request against Cedar policies before it allows tool access.
AWS-only. You still need end-user identity in every request to make the policy meaningful.
Model Armor for MCP and Agent Gateway (Google)
Commercial Google Cloud service
Screens prompts and tool traffic for Google Cloud MCP servers and Agent Gateway (MCP, Agent Gateway).
OSS gateway (BerriAI/litellm; GitHub reports license as NOASSERTION, check the LICENSE file) with an enterprise edition
Runs guardrail providers (for example Lakera, Aporia, Presidio, Bedrock) in pre_call, during_call, or post_call mode on every request through the proxy.
Each provider adds its own latency and failure mode. Set the fail mode per guardrail.
Runs deterministic checks (regex, JSON Schema, and others) and partner guardrails on inputs and outputs. Can deny, log, retry, or fall back to another model.
The llm-content-safety policy sends prompts or completions to Azure AI Content Safety, including attack-pattern (Prompt Shields) checks. It can also check requests and responses for MCP tools and A2A agent APIs that API Management manages. Blocks with HTTP 403.
Adds a Content Safety call to every request, so measure the latency. Harm categories follow Azure AI Content Safety.
Regex lists alone miss paraphrased attacks. Check which AI plugins need a Kong Enterprise or Konnect license.
Follow these rules for agent traffic:
Scan tool descriptions before you connect a server: Tool descriptions are untrusted input. Re-scan when a server updates.
Enforce the tool tier at the gateway: Apply the T0–T3 tiers from Tool & action guardrails §6. For example, create_ticket is T1: show an inline preview and require one-click user confirmation before submit.
Fail closed on tool-enabled turns: If a gateway guardrail times out on a tool call, block the call or route the turn to a no-tools mode.
Security vendors bought most independent AI-guardrail startups in 2024–2026. The products below combine runtime guardrails with model scanning, red teaming, or AI usage discovery. Verify current packaging with each vendor, and benchmark them on your own data like any other detector.
Works like nmap for LLMs by combining probes (attack generators), detectors (attack evaluators), and generators (model or endpoint adapters). Ships a large catalog covering encodings, DAN jailbreaks, prompt injection, data leakage, malware, and package hallucination.
Best for
Running broad baseline vulnerability scans against a model or endpoint before and after you add guardrails.
Watch-outs
Targets models by default, so write a custom generator adapter to test a multi-step agent with tools. Budget time and tokens for large probe suites.
Built by Microsoft's AI Red Team around composable targets, converters (encoding, translation, and obfuscation), scorers, attack executors (including multi-turn Crescendo escalation), and attack memory stores.
Best for
Security engineering teams running programmatic, multi-turn red-team campaigns against application endpoints.
Watch-outs
PyRIT is a Python framework rather than a single-command scanner, so expect to write test code. Install from microsoft/PyRIT.
OSS CLI (MIT), part of OpenAI, with a commercial enterprise edition
Strengths
Generates adversarial attacks by pairing plugins (pii, rbac, bola, bfla, sql-injection, shell-injection, excessive-agency, hallucination, indirect-prompt-injection, rag-document-exfiltration, rag-poisoning, memory-poisoning, mcp, prompt-extraction) with delivery strategies (jailbreaks, encodings, multi-turn). Ships framework presets for OWASP LLM Top 10, OWASP Top 10 for Agentic Applications, OWASP API Top 10, NIST AI RMF, MITRE ATLAS, EU AI Act, and ISO/IEC 42001 in the same YAML CI workflow as promptfoo evals.
Best for
Running automated application-level red teaming in CI, especially for RBAC bypass and agent tool misuse.
Watch-outs
The OWASP LLM preset docs still cite the 2025 list. Map results to LLM01:2026-style IDs with the table in Threat model & OWASP. Review generated attacks and calibrate the LLM graders against human labels (LLM-as-a-judge). Treat red-team reports as investigation leads rather than a single KPI score.
Pairs vulnerability definitions with single-turn and multi-turn attack methods using the same Python workflow as DeepEval. Includes framework presets for "OWASP Top 10 for LLMs 2025", "OWASP Top 10 for Agentic Applications 2026", NIST, MITRE, EU AI Act, Aegis, and BeaverTails, and integrates with Confident AI.
Best for
Teams already using DeepEval that want red-teaming suites written in the same Python test style.
Watch-outs
Relies on LLM-generated attacks and LLM judges, so calibrate its graders against human review (LLM-as-a-judge). The OWASP LLM preset targets the 2025 list, so map findings to 2026 IDs with Threat model & OWASP.
Detection accuracy: Two tools with ✅ in the same column can have very different recall and false-positive rates on your domain traffic.
Language coverage: Most classifiers perform best in English, so benchmark every target language your users speak.
Context length limits: Small classifiers truncate inputs (Prompt Guard 2 caps at 512 tokens), so split long retrieved documents into chunks and score each chunk.
Indirect injection scanning: Only a few tools explicitly distinguish retrieved documents from user prompts (Azure document attacks, Lakera indirect defense, LlamaFirewall AlignmentCheck). With most tools, you must explicitly wire chunk and tool-output scanning yourself. Small classifiers such as Prompt Guard 2 target explicit attack patterns, so expect lower recall on subtle injections in retrieved text.
Agent-level privilege risks: Stop excessive agency and confused-deputy bugs with deterministic authorization, tool tiers, and user confirmation rather than text classifiers (Tool & action guardrails).
Same risk, different tool: a mapping for the running example¶
For the matching OWASP IDs (for example LLM01:2026 Prompt Injection and LLM03:2026 Excessive Agency), see the mapping table in Threat model & OWASP.
Risk in the enterprise assistant
Primary control (deterministic)
Detector (probabilistic)
Red-team check
User sees docs they lack access to
Enforce retrieval ACL filters via OpenFGA or OPA
None
Run promptfoo rbac, bola, and rag-document-exfiltration plus role-swap tests
Text-to-SQL reads restricted tables or rows
Use a read-only DB role, OPA/Cedar SQL allow-lists, and row-level security
Guardrails AI SQL validators
Run promptfoo SQL injection plugins and PyRIT campaigns
create_ticket abused (wrong queue, spam, priority escalation, data exfiltration into ticket text)
Enforce OPA/Cedar tool authorization and rate limits. create_ticket is tier T1: show an inline preview and require one-click user confirmation before submit
Deterministic controls like authorization policies, least-privilege roles, read-only database connections, retrieval ACLs, and human approval gates do not suffer from classifier false negatives. Implement a policy engine or IAM check before you add probabilistic detectors. See Tool & action guardrails.
flowchart TD
A["Data may leave your network?"] -->|"No"| B["Self-hosted: Prompt Guard 2, Llama Guard, Granite Guardian, ShieldGemma, Presidio, NeMo / Guardrails AI"]
A -->|"Yes"| C["Already on one cloud?"]
C -->|"Azure"| D["Azure AI Content Safety"]
C -->|"AWS"| E["Bedrock Guardrails via ApplyGuardrail"]
C -->|"GCP"| F["Model Armor"]
C -->|"Multi-cloud or none"| G["Lakera / Check Point, OpenAI moderation, or self-hosted models"]
B --> H["Need dialog / topic flows?"]
H -->|"Yes"| I["NeMo Guardrails"]
H -->|"No, mainly output validation"| J["Guardrails AI"]
Run fast, cheap checks first: Execute regex, schema, and policy checks before small classifiers, and run LLM rails last.
Execute independent checks in parallel: Run input classifiers concurrently with vector retrieval to hide guardrail latency.
Define fail-closed vs fail-open per stage: Fail closed for tool-enabled turns, Tier 3 intents (HR, finance, security procedures), and access-control checks. Fail open and flag only for read-only, low-risk Q&A. If a classifier times out on a tool-enabled turn, fail closed or route the turn to a no-tools mode. See Guardrails architecture §5.
Wrap every detector behind one interface: Use a single check(stage, text, context) -> decision contract so you can swap vendors by changing configuration.
Never rely on an LLM guardrail for authorization: Enforce permissions in OPA, Cedar, OpenFGA, or your database.
Inline on high-risk paths or sampled asynchronously
Tens to hundreds of milliseconds on GPU
Dedicated GPU hours
Managed APIs (Azure, Bedrock, Model Armor, Lakera, OpenAI)
Inline
Network round-trip plus inference time (varies by region and payload size)
Per-call or per-character fees (OpenAI moderation is free)
Reasoning safety models, LLM-as-judge rails
Asynchronous, sampled, or high-risk actions only
Seconds
Input and output tokens
Treat these numbers as order-of-magnitude planning estimates. Benchmark p50, p95, and p99 latency on your own payload sizes, and remember that scanning 10 retrieved chunks requires 10 classifier inputs (batched or sequential).
Fit the checks into the canonical per-stage budgets in Guardrails architecture §5. These are starting rules of thumb; calibrate them on your app:
Stage
Budget
Input checks
50–150 ms
Retrieval and context checks
10–50 ms (add 50–150 ms if a classifier scans retrieved chunks for injection)
Tool-call gate
5–50 ms
Output checks
100–800 ms (LLM-judge groundedness sits at the top of the range)
Every probabilistic guardrail is a classifier. Evaluate it like a classifier before launch and monitor it continuously in production. See Online evals and Monitoring, alerting & drift.
Build a labeled benchmark dataset per guardrail with hard benign examples (security docs, code, quoted emails) and real attack samples.
Measure both error rates: Compute false-positive rate (benign traffic blocked) and false-negative rate (attacks missed) per category and language.
Select thresholds from an ROC or PR curve: Never ship a vendor's default threshold without calibrating it to your risk appetite.
Benchmark p95 and p99 latency using realistic production payload sizes, including full retrieved document batches.
Test the full chunking pipeline: Verify whether attacks split across document chunks bypass a 512-token classifier window.
Run red-teaming suites before and after changes and save the reports as regression baselines.
Monitor production block and appeal rates: Sample both blocked and passed requests every week for human review.
Re-evaluate after model or API updates: Re-run your benchmark whenever a vendor updates a hosted detector.
Roll out in three stages: Start in shadow (log only, no user effect), move to flag (annotate the trace and notify reviewers, no block), then move to block (enforce). Promote a stage only when the measured error rates meet your targets.
Sample online traffic by cost: Run deterministic checks and the injection classifier on 100% of traffic. Run LLM judges on 1–5% of traffic plus 100% of flagged or negative-feedback traces (Online evals).
Validate every LLM grader: Calibrate LLM-based guardrails and red-team graders against human labels with the bar in LLM-as-a-judge (≥ 100 labelled items, ≥ 30–50 FAIL examples, TPR and TNR ≥ 0.85, Cohen's κ ≥ 0.60; ≥ 0.90 for high-risk slices).
Use a scorecard like this for each detector. The targets are starting rules of thumb; calibrate them on your data and risk tier:
Metric
Target (rule of thumb)
Minimum sample to support it
Measured
Recall on injection set (direct)
≥ 0.90
Enough attacks for a narrow Wilson interval (for example ≥ 100)
Recall on injection set (indirect, in retrieved docs)
≥ 0.80
Same as above
FPR on benign production sample
≤ 1%
≥ 300 benign cases (rule of three: 0 errors in 300 gives a 95% upper bound of about 1%)
FPR on "security-flavored" benign sample
≤ 5%
≥ 60 benign cases
p95 latency added
Within the stage budget above (for example ≤ 50 ms for an input classifier)
Production-size payloads
Report each rate with a Wilson confidence interval, not only a point estimate. See Dataset strategy for sizing.
Bedrock sensitive info filter + contextual grounding with only the current question as the query (AWS does not support chatbot QA), or a self-hosted groundedness judge for multi-turn chat
Orchestration
NeMo Guardrails or a thin in-house Python wrapper
Thin in-house Python wrapper
Red teaming (CI + quarterly)
promptfoo red team + garak in CI, and PyRIT for deep campaigns
Layer deterministic and probabilistic controls: Combine policy engines (OPA, Cedar, OpenFGA), detectors (classifiers or managed APIs), PII redaction (Presidio), and red teaming.
Match each detector to its exact threat: Content-safety models (Llama Guard, ShieldGemma, OpenAI moderation) do not catch prompt injection, and injection classifiers do not replace least-privilege architecture.
Weigh residency against managed breadth: Self-host open models when data cannot leave your network. Use managed cloud APIs for document scanning, PII filters, and grounding checks, but read their limits first (for example, Bedrock contextual grounding does not support chatbot QA, and Automated Reasoning only detects).
Keep authorization 100% deterministic: Enforce document, SQL, and tool permissions in OPA, Cedar, or OpenFGA using the end user's identity.
Measure every guardrail on your own data: Track false-positive rate, false-negative rate, and p95 latency before launch and after every vendor update. Roll out in shadow → flag → block stages.
Gate agent tools at one choke point: Scan MCP servers before you connect them, and enforce tool tiers and fail-closed rules at the gateway.
Wrap every guardrail behind your own interface: The security market consolidates fast (LLM Guard and Rebuff archived, WhyLabs discontinued, Lakera → Check Point, Protect AI → Palo Alto Networks, CalypsoAI → F5, Prompt Security → SentinelOne, Presidio → community, promptfoo → OpenAI).