ModelRefs / Guardrails — AI Glossary
Guardrails — AI Glossary
Runtime checks that constrain LLM inputs and outputs to safe, on-policy, and structured forms. Guardrails are not alignment.
Overview
Guardrails include PII detection and redaction, jailbreak detection, topic restriction, toxicity filtering, output schema validation, and hallucination detection. Implemented client-side (Llama Guard, NeMo Guardrails, Guardrails AI) or server-side at the model gateway.
Reference details
| Topic | safety |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
Example: Two checks, two directions
Inbound, a guardrail scans the user message for an injection attempt and refuses before the model ever sees it. Outbound, it validates the response against a schema and scans for anything resembling a card number or national ID; a failing response is regenerated or blocked rather than returned. Both sit outside the model, which is what makes them enforceable.
Commonly confused with
Guardrails are not alignment. Alignment shapes what the model tends to do during training; guardrails are runtime checks that hold whether or not the model cooperates. A well-aligned model still needs guardrails, because alignment is a tendency and a guardrail is a control.
When to use it
Reach for it when:
- Output flows somewhere consequential — a customer, a database, a payment
- You must be able to show an auditor what was enforced
- The input is user-controlled and may be adversarial
Reach for something else when:
- As your only defence: guardrails are filters, and filters are bypassable
- On internal prototypes, where they mostly slow iteration
- As a substitute for permissions — a check that says no is weaker than an action that cannot be taken
Referenced by
This term is used by the following ModelRefs references:
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Guardrails — AI Glossary.
Frequently asked questions
What is Guardrails?
Runtime checks that constrain LLM inputs and outputs to safe, on-policy, and structured forms.
What concepts are related to Guardrails?
Closely related concepts include hallucination, jailbreak, prompt injection, alignment.