Guardrails (AI)
Also called AI guardrails, safety filters.
Checks placed around an AI model that block, fix or flag unsafe, off-topic or incorrect inputs and outputs.
Last updated
What it is.
Guardrails sit before and after the model. Input checks catch prompt injection, personal data that should not be sent and requests outside the product's scope. Output checks validate format with structured output, check facts against sources, filter harmful content and enforce business rules such as refund limits.
Some guardrails are rules in code, some are classifiers, some are a second model call. The strongest ones are permissions: an agent that cannot reach a system cannot misuse it.
Why it matters
A model's behaviour can be steered but not guaranteed. Guardrails turn the rules the business cares about into checks that run every time, keep a record of what was blocked, and make the system's behaviour easier to explain to customers, auditors and regulators.
Common mistakes.
- 01
Relying on the system prompt as the only guardrail.
- 02
Blocking so much that the product stops being useful. Measure false blocks too.
- 03
Checking output text but not the actions an agent takes.
Work it out with a tool.
Related terms.
- Human-in-the-loop (HITL)A design where a person reviews, corrects or approves what an AI system produces before it takes effect.
- Hallucination (AI)When an AI model produces information that is false or made up, presented as if it were true.
- AI agentSoftware where a language model decides which steps to take and which tools to call, in a loop, to reach a goal.
- High-risk AI system (EU AI Act)An AI system the EU AI Act places in its high-risk class, which brings extra duties before and after it is placed on the market.
Guides and pages
Browse the full glossary or read answers to common questions.