# Guardrails

> Canonical: https://skillalmanac.com/glossary/guardrails | Last verified: 2026-11-23 | Index status: not offered to search engines

Guardrails are the checks, rules and limits placed around an AI system to keep its inputs, outputs and actions within defined boundaries. IBM describes them as spanning data, model, application and infrastructure layers.

Also called: AI guardrails, LLM guardrails, guardrails for AI agents, AI guardrail, agent guardrails.

## In plain language

Guardrails are the barriers on the side of a road: they do not drive the car, they stop it leaving the road. For an AI they can be a filter that blocks certain requests, a check that rejects a badly formatted answer, a rule that the agent may only read files and not delete them, or a step that asks a person to approve something risky. Suppose a coding agent works overnight. A guardrail might stop it after a set number of steps or refuse to push to a shared branch. They have limits: no set of rules covers every case, and a rule that only lives in the prompt can be talked around. Checks also add delay and effort, so teams choose which ones to run.

## Technical definition

IBM groups guardrails into four layers: data (cleaning training data), model (fine-tuning, validation and monitoring), application (filters and validators around inputs and outputs, and restrictions on tool use) and infrastructure (access control, encryption, logging). In agent software the application layer is often a function that runs before or after the model or a tool call. The OpenAI Agents SDK documents input, output and tool guardrails and a tripwire that halts a run by raising an exception. Anthropic's documentation describes screening input with a lightweight model, validating input, screening tool output and limiting access to sensitive data and actions. A prompt rule is one layer among these, not the only one.

## How it shows up when you use agents

In a coding agent, guardrails are the approval prompts before shell commands and file edits, the lists of allowed and denied commands, limits on which folders it may write to, and hooks that run your own checks before or after an action. Which of these are on by default depends on the tool, so read its permission documentation. The same word also covers filters in an application built with an [AI agent](/glossary/ai-agent) framework, such as the input, output and tool guardrails in the OpenAI Agents SDK.

What breaks when guardrails are misunderstood: a team writes "be careful, never delete files" into a prompt and treats the job as done. A prompt is an instruction the model may or may not follow, and it is exposed to [prompt injection](/glossary/prompt-injection). Our [guide on autonomous agent risks](/learn/autonomous-ai-agents-risks-and-guardrails) makes the point that enforcement has to sit outside the model. The opposite failure also happens: approval prompts that are clicked through without reading stop being a check at all.

Next action: list what your agent could do that would be hard to undo, such as pushing, deleting or spending money. For each one, put a limit in a place the model cannot change: a permission rule, a read-only credential, a hook, or a server-side rule. Then use a reviewed checklist such as the [coding-agent-guardrails skill](/skills/skill-almanac/coding-agent-guardrails) to audit what you have. [Human-in-the-loop](/glossary/human-in-the-loop) approval is one kind of guardrail, and it works only while people actually read what they approve.

## Common confusions

- **Guardrails versus alignment.** Guardrails are checks and limits added around a system. Alignment concerns what the model itself is trained to do. They are used together.
- **Guardrails versus a system prompt.** A prompt rule is one soft layer. IBM describes guardrails at data, model, application and infrastructure level, and not all of them are in the prompt.
- **Guardrails versus guarantees.** IBM notes that generative models can behave unpredictably, so anticipating every vulnerability is hard. A guardrail lowers risk; it does not remove it.
- **Myth.** Adding a filter makes an agent safe to leave alone. IBM notes that filtering can add delay and that threats change, so guardrails need upkeep.

## Worked examples in this catalogue

### [coding-agent-guardrails](https://skillalmanac.com/skills/skill-almanac/coding-agent-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A pre-action checklist for a coding agent, plus a read-only audit of the guardrail setup in a repository.

Why it exercises the concept: It turns the idea into a concrete checkpoint an agent passes before it acts, and it audits what a repository already has set up.

### [Autonomous AI Agents: Risks and Guardrails](https://skillalmanac.com/learn/autonomous-ai-agents-risks-and-guardrails)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A worked example of an unattended coding agent making a run of reasonable-looking decisions, then a list of guardrails: tool limits, permission limits, approval for high-impact actions, stopping conditions, downstream policy and logging.

Why it exercises the concept: It shows what guardrails are protecting against and puts the main ones in one list, with the point that enforcement has to sit outside the model.

### [agent-hooks-authoring](https://skillalmanac.com/skills/skill-almanac/agent-hooks-authoring)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Coding-agent hooks written, installed, tested and debugged, with each hook proven by firing it with sample input.

Why it exercises the concept: A hook runs as ordinary code at a defined point in the agent's work, so it is a check that does not depend on the model following instructions.

## Related terms

- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Agentic AI](https://skillalmanac.com/glossary/agentic-ai.md)
- [Prompt injection](https://skillalmanac.com/glossary/prompt-injection.md)
- [Human in the loop (HITL)](https://skillalmanac.com/glossary/human-in-the-loop.md)
- [AI safety](https://skillalmanac.com/glossary/ai-safety.md)
- [Agent harness](https://skillalmanac.com/glossary/agent-harness.md)
- [Sandbox](https://skillalmanac.com/glossary/sandbox.md)
- [NeMo Guardrails](https://skillalmanac.com/glossary/nemo-guardrails.md)

## Sources

- [What Are AI Guardrails?](https://www.ibm.com/think/topics/ai-guardrails), IBM (accessed 2026-11-23)
- [Guardrails - OpenAI Agents SDK](https://openai.github.io/openai-agents-python/guardrails/), OpenAI (accessed 2026-11-23)
- [Mitigate jailbreaks and prompt injections](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks), Anthropic (accessed 2026-11-23)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-23. [Glossary index](https://skillalmanac.com/glossary.md).
