---
title: Guardrails — AI Glossary
description: Guardrails are the controls placed around a model to keep its inputs and outputs within safe, policy-compliant, and on-topic bounds. They include content moderation, input and output validation, allowed-topic restrictions, schema enforcement, and human review, forming a defensive layer independent of the model's own training.
canonical: https://prompeteer.ai/glossary/guardrails
---

# Guardrails

Guardrails are the controls placed around a model to keep its inputs and outputs within safe, policy-compliant, and on-topic bounds. They include content moderation, input and output validation, allowed-topic restrictions, schema enforcement, and human review, forming a defensive layer independent of the model's own training.

## Definition

A model's built-in alignment reduces but does not eliminate unsafe or off-policy behavior, so production systems wrap it in guardrails. These can filter or block harmful content, validate that outputs match a required structure, keep a conversation on approved subjects, and gate risky actions behind confirmation.

Guardrails are essential for defending against prompt injection and jailbreaks and for meeting compliance requirements. Effective guardrail design uses defense in depth — combining moderation APIs, validation logic, least-privilege tool access, and evaluation — rather than relying on any single mechanism.

## Sources

- [OpenAI — Safety best practices](https://platform.openai.com/docs/guides/safety-best-practices)
- [Anthropic — Strengthen guardrails](https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations)

## Related terms

- [prompt-injection](https://prompeteer.ai/glossary/prompt-injection)
- [jailbreak](https://prompeteer.ai/glossary/jailbreak)
- [evaluation](https://prompeteer.ai/glossary/evaluation)
- [structured-output](https://prompeteer.ai/glossary/structured-output)
