Safety & ops
What is Guardrail?
A guardrail is a constraint that blocks unsafe or out-of-policy actions.
Examples: confirm before writes, refuse invented refunds, strip unsourced statistics.
Visual
Guardrail layers
Guardrails wrap the agent at input, output, and execution boundaries.
Why it matters
Guardrails are constraints that block unsafe or out-of-policy actions. They are the safety layer between what the model wants to do and what it is allowed to do.
Guardrails matter because models will occasionally request dangerous actions — deleting files, sending emails to wrong recipients, inventing refund amounts. The guardrail catches these before they execute.
Types of guardrails
Input guardrails filter dangerous requests before they reach the model. Output guardrails check model responses before they are shown or acted upon. Execution guardrails wrap tool calls with permission checks — confirm before writes, block unauthorized actions, rate-limit expensive calls.
The most important guardrail is the simplest: require human confirmation before any write action.
Key takeaways
- 1Guardrails block unsafe actions at input, output, and execution boundaries.
- 2The simplest effective guardrail: confirm before writes.
- 3Guardrails are code, not prompt instructions.
Common mistakes
- ✕Relying on the prompt to enforce safety instead of code-level guardrails.
- ✕Implementing guardrails only on input, not on output and execution.
- ✕Making guardrails so strict they block legitimate actions.
Related terms
Concept neighborhood
Terms linked from Guardrail in the glossary graph.
- Guardrail
- Human-in-the-Loop
- Agent Security