Guardrail
Guardrail
A hard rule that blocks a category of action outright, no judgment call involved
✓ Concepts & BehaviorWhat is a Guardrail
A guardrail is a hard rule that blocks an entire category of action outright: never force-push to main, never delete without a lock, never commit a file matching a secrets pattern. It is not a judgment call the model makes case by case, it is a boundary that holds regardless of how reasonable the model's argument for crossing it might sound in the moment.
Guardrails are usually implemented as hooks, since a hook can actually stop an action with a real exit code, where a prompt instruction can only ask nicely. This distinction matters most for anything the model could talk itself into under specific circumstances, an instruction says please don't, a guardrail makes it structurally not happen.
Guardrails matter most for AFK or otherwise unsupervised work, where there is no human immediately present to catch a bad call before it executes. A task with solid guardrails around the genuinely dangerous actions can be run unattended with real confidence, a task relying only on the model's own judgment to avoid disaster generally cannot.
Build your own agent skills, not just prompts.
We design, build, and ship the Claude Code skill libraries production teams actually run on.
Talk to AY Automate ↗