AI guardrails examples: named tools and what each one checks
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.
| Example | Kind | What it checks | What acts on the result |
|---|---|---|---|
| Amazon Bedrock Guardrails | Cloud filter | Harmful categories, denied topics, personal data, answers not backed by your sources | The filter can block or mask content |
| Azure Prompt Shields | Cloud filter | Prompt attacks and hidden instructions in documents | You decide what to do with the result |
| Google Model Armor | Cloud filter | Prompts and responses | Templates you configure |
| OpenAI moderation | Cloud filter | Harmful content in text and images | Your app, which filters, routes or acts |
| Llama Guard 3-8B | Classifier model | Labels input or output as safe or unsafe | The app that reads the label |
| NVIDIA NeMo Guardrails | Open-source library | Policy for what an agent may do, plus tool calls | Your application or agent harness |
| Guardrails AI | Open-source library | Input and output guards built from validators | Your application, which runs the guards |
| Claude Code permission rules, hooks, sandbox | Agent rules | Tool calls, commands, what a process can touch | Claude Code and the operating system, not the model |
| Cursor run modes | Agent rules | Which tool calls need your approval | You, or a classifier that can be wrong |
| Gemini CLI sandbox | Agent sandbox | Shell commands and file changes, kept apart from the host | The sandbox |
| Docker Sandboxes | Agent sandbox | Agent runs in a microVM with its own filesystem and network | The 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.
- Permission rules. Claude Code enforces them, not the model, and a line in CLAUDE.md does not change what is allowed. Details: AI agent permissions.
- Hooks. A hook is your own script that runs at a fixed point. A PreToolUse hook runs before a tool call and can block it, and exit code 2 is the block signal. More: Claude Code hooks.
- Sandbox. The operating system fences the process, so the boundary holds regardless of what the model chose to run. Gemini CLI has its own sandbox for shell commands and file changes, and Docker Sandboxes run the agent in a microVM. Compare them on the sandbox page.
- Model review. This one is a filter inside the agent. Claude Code's auto mode uses a separate classifier model to review actions before they run. Cursor's Auto-review also uses a classifier, and Cursor says plainly that it is not a security boundary. The list of what auto mode allows is on auto mode.
- Switches. Cursor's File-Deletion Protection is meant to stop the agent from automatically deleting files, including with rm. A user reported that it did not catch a PowerShell delete. External-File Protection covers changes outside the workspace.
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.
Related guides
Sources
- Amazon Bedrock docs: Guardrails
- Amazon Bedrock docs: guardrail components
- NVIDIA NeMo Guardrails on GitHub
- Guardrails AI on GitHub
- Llama Guard 3-8B model card
- OpenAI docs: moderation
- Microsoft Learn: Prompt Shields
- Google Cloud: Model Armor overview
- Claude Code docs: permission modes
- Claude Code docs: hooks
- Claude Code docs: sandboxing
- Cursor docs: run modes
- Gemini CLI docs: sandbox
- Docker docs: Sandboxes
- OWASP GenAI: LLM Top 10
- Simon Willison: the lethal trifecta
- Artificial Immunity