What are guardrails?

Guardrails are the layered safety and policy controls that keep an AI agent within authorized boundaries. Effective guardrails combine clear prompt instructions with controls enforced outside the model—such as least-privilege tool permissions, deterministic output validation, and human approvals for irreversible actions—so a single model mistake cannot cause harm.

By Sacha Arbonel, Founder and CTOLast updated
  • Also called
  • AI guardrails
  • Agent rules

Why do guardrails matter?

Language models can misread edge cases or be steered by prompt injection. Relying solely on polite system-prompt rules is fragile; defense-in-depth guardrails enforce hard limits at the runtime and tool layers.

Guardrails work at several layers. Rules in the instructions say what the agent must and must not do. Permissions limit which tools it can use and how. Checks verify outputs, for example that an amount is within policy. Approvals put a person in front of irreversible actions.

No single layer is enough. A model can ignore an instruction, so the actions that matter most should be enforced outside the model, by permissions and approvals.

Key characteristics of guardrails

  • Instruction rules define business policy and escalation criteria in plain language.
  • Tool permissions restrict which APIs and arguments an agent is allowed to invoke.
  • Schema and policy checks validate outputs before they reach downstream code or users.
  • Human-in-the-loop approvals gate irreversible writes such as sending messages or issuing refunds.

How guardrails works step by step

  1. 1. Prompt rulesClear, testable policy boundaries
  2. 2. Tool allowlistRestrict tools and customer scope
  3. 3. Output checksValidate schema and hard limits
  4. 4. Approval gateRequire human sign-off on writes
Defense-in-depth guardrail layers around every agent action.

Prompt rules vs. runtime-enforced guardrails

DimensionPrompt rules (soft)Runtime guardrails (hard)
Where enforcedInside the language model promptApplication code, tool layer, and runtime
Resistance to injectionCan be overridden by adversarial inputCannot be bypassed by model text
Best used forTone, triage preferences, drafting stylePermissions, spend caps, and approvals
Failure modeModel quietly forgets or bends a ruleAction is blocked or paused deterministically

Example in practice

How Norilu handles guardrails

Frequently asked questions

Are prompt instructions alone enough to act as guardrails?
No. Prompt instructions guide normal behavior, but any consequential action—like paying money, deleting records, or emailing customers—must be enforced outside the model with permissions and approvals.
How do you test whether guardrails actually hold?
Add adversarial test cases—including out-of-policy requests and prompt injection attempts—to your evaluation suite and verify that hard checks pass on every candidate version.

Go deeper