Get the free coreGet core

AI guardrails examples: named tools and what each one checks

Updated 6 min readSection 05 / Threats
SHORT ANSWER

The AI guardrails examples below come in two kinds. Filters score text going into or out of a model: Amazon Bedrock Guardrails, Azure Prompt Shields, Google Model Armor, OpenAI moderation and Llama Guard. Rules limit what an agent can do: permission rules, hooks and sandboxes in Claude Code, run modes in Cursor, and the sandbox in Gemini CLI. A filter only gives a score, so ask who makes the final call: the model, or code that cannot be talked out of it.

These AI guardrails examples name real products, say what each one checks and say who acts on the result. The cloud filters are for apps you build yourself. If you only run Claude Code, Cursor or Gemini CLI on a Mac, skip to the section on coding agents. Definitions are on AI guardrails, and the layers for a coding agent are on AI agent guardrails.

01Eleven AI guardrails examples at a glance

Two terms first. A classifier is a model that sorts text into labels, such as safe or unsafe. A microVM is a very small virtual machine, a fenced-off computer of its own.

ExampleKindWhat it checksWhat acts on the result
Amazon Bedrock GuardrailsCloud filterHarmful categories, denied topics, personal data, answers not backed by your sourcesThe filter can block or mask content
Azure Prompt ShieldsCloud filterPrompt attacks and hidden instructions in documentsYou decide what to do with the result
Google Model ArmorCloud filterPrompts and responsesTemplates you configure
OpenAI moderationCloud filterHarmful content in text and imagesYour app, which filters, routes or acts
Llama Guard 3-8BClassifier modelLabels input or output as safe or unsafeThe app that reads the label
NVIDIA NeMo GuardrailsOpen-source libraryPolicy for what an agent may do, plus tool callsYour application or agent harness
Guardrails AIOpen-source libraryInput and output guards built from validatorsYour application, which runs the guards
Claude Code permission rules, hooks, sandboxAgent rulesTool calls, commands, what a process can touchClaude Code and the operating system, not the model
Cursor run modesAgent rulesWhich tool calls need your approvalYou, or a classifier that can be wrong
Gemini CLI sandboxAgent sandboxShell commands and file changes, kept apart from the hostThe sandbox
Docker SandboxesAgent sandboxAgent runs in a microVM with its own filesystem and networkThe microVM

02Cloud filters for apps you build

These services check the text going into and out of a chatbot or app that you build on a large language model (LLM).

Amazon Bedrock Guardrails. Content filters cover six categories: hate, insults, sexual content, violence, misconduct and prompt attacks. A prompt attack is text written to make the model break its rules. It covers jailbreaks, which are tricks to get around the rules, and prompt injection. It also covers prompt leakage, which is making the model reveal its hidden instructions. This needs the Standard tier. You can also define denied topics and filters that block or mask personal data such as names and ID numbers. A grounding check flags answers the source text does not support.

Azure Prompt Shields. They catch two attack types. User prompt attacks try to bypass the system's instructions. Document attacks are hidden instructions inside documents, emails or web pages. In Foundry, Microsoft's AI platform, user prompt attack detection is on by default and document attack detection is off. The standalone Content Safety API does not block or route content itself.

Google Model Armor. A Google Cloud service that screens prompts and responses. It can block adversarial inputs and redact sensitive data. You set filters and confidence thresholds, which are cut-off scores, in templates. A lower cut-off finds more events but may raise false alarms.

OpenAI moderation. It detects harmful content in text and images. The free endpoint accepts text and images but not audio.

03Open-source and model-based examples

NVIDIA NeMo Guardrails is an open-source library for programmable safety and security controls in LLM and agent apps. You write a policy that says what each agent may do, mixing quick local rules with model-backed checks for jailbreaks, injected instructions and unsafe tool calls. Your application or agent harness, the code that runs the agent, runs these checks and decides whether to go on. It installs with pip install nemoguardrails and needs Python 3.11 to 3.13.

Guardrails AI is a Python framework that runs input and output guards in your application. Its Hub holds pre-built validators, small checks for one type of risk, that you combine into guards.

Llama Guard 3-8B is a Llama 3.1 8B model tuned for content safety. It labels prompts and responses as safe or unsafe and lists the violated categories. It covers 14 categories, including one for code interpreter abuse.

04Guardrail examples on a coding agent

On a Mac running Claude Code, Cursor or Gemini CLI, the guardrails sit around commands and files, not around chat text.

05What these AI guardrails examples have in common

Look at the last column of the table. Azure's Content Safety API leaves the decision to you. NeMo's checks are run by your application, which decides whether to go on. OpenAI's results are used by your app to filter, route or act. A guardrail you do not wire into a decision is only a score.

None of them removes prompt injection, which means text that the model treats as an instruction. Simon Willison, a developer who writes about AI security, puts it plainly: guardrails won't protect you on their own. For more on that problem, read prompt injection.

06Three setups that skip the approval prompt

Claude Code's --dangerously-skip-permissions flag replaces the permission prompt with nothing. Protected path checks are also skipped, and only the actions no mode auto-approves still apply. Codex's --dangerously-bypass-approvals-and-sandbox flag, with the alias --yolo, runs without a sandbox or approvals. Cursor's Run Everything mode runs every tool call automatically. The story behind the first one is on dangerously-skip-permissions.

Most of the examples above check a request or a reply before it is used, and sandboxes limit a process while it runs. None of them shows what ran afterwards. The free, open-source core of Artificial Immunity is a different kind of check: it examines the Mac for signs of attack, says how sure it is, and reports what it finds when you or your agent ask it.

07The short version

Of all these AI guardrails examples, pair a filter with a rule that code enforces. Start with one hard limit, a sandbox or a deny rule, then add filters, and check who acts on each result. Setup steps are on the AI agent sandbox and AI agent permissions pages.

FAQ

What are the different types of AI guardrails?

Two kinds. Filters score text going into or out of a model: content filters, prompt-attack detectors and safety classifier models. Rules limit what an agent can do: permission rules, hooks, sandboxes and approval prompts. The table on this page gives a named example of each. Rule libraries such as NeMo Guardrails sit in between, because your own code runs their checks.

Which AI has the fewest guardrails?

The fewest are in setups where you switch the checks off yourself: Claude Code's --dangerously-skip-permissions flag, Codex's --dangerously-bypass-approvals-and-sandbox flag, also written --yolo, and Cursor's Run Everything mode.

Does ChatGPT have guardrails?

For developers, OpenAI publishes moderation models, which detect harmful content in text and images; the moderation endpoint is free to use. Developers use the results to filter content, route a request for review or act on accounts.

What are the top 3 AI security risks?

The 2025 OWASP list of top risks for LLM apps starts with prompt injection, sensitive information disclosure and supply chain. Prompt-attack detectors such as Azure Prompt Shields and Bedrock's prompt attack filter target the first, and Bedrock can block or mask personal data for the second.

What is an example of a guardrail in AI?

Amazon Bedrock Guardrails is one. It can filter hate, insults, sexual content, violence, misconduct and prompt attacks, and it can block denied topics. On a coding agent, a deny rule in Claude Code is another.

Can a guardrail fully stop prompt injection?

Not reliably. OWASP says it is unclear whether fool-proof prevention exists, and Simon Willison writes that nobody yet knows how to prevent it 100% reliably.

Sources

  1. Amazon Bedrock docs: Guardrails
  2. Amazon Bedrock docs: guardrail components
  3. NVIDIA NeMo Guardrails on GitHub
  4. Guardrails AI on GitHub
  5. Llama Guard 3-8B model card
  6. OpenAI docs: moderation
  7. Microsoft Learn: Prompt Shields
  8. Google Cloud: Model Armor overview
  9. Claude Code docs: permission modes
  10. Claude Code docs: hooks
  11. Claude Code docs: sandboxing
  12. Cursor docs: run modes
  13. Gemini CLI docs: sandbox
  14. Docker docs: Sandboxes
  15. OWASP GenAI: LLM Top 10
  16. Simon Willison: the lethal trifecta
  17. Artificial Immunity
Guardrails score text or limit an agent. Artificial Immunity checks the Mac where your agents work when you ask it.Get the free core