---
title: "What are AI guardrails?"
description: "Deterministic checks and limits around a model, such as schema validation, thresholds, allow-lists and approval gates, that prevent or catch invalid or har"
canonical: https://sudosapient.si/answers/what-are-ai-guardrails
updated: 2026-10-27
publisher: Sudo Sapient (https://sudosapient.com/)
---
# What are AI guardrails?

**Deterministic checks and limits around a model, such as schema validation, thresholds, allow-lists and approval gates, that prevent or catch invalid or harmful outputs. They belong in code, not only in prompts.**

Guardrails work best in ordinary code around the model rather than in the prompt alone: schema validation on outputs, allow-lists of permitted actions, thresholds that block or escalate, rate and spend limits, and a hard rule that irreversible actions such as payments, deletions or external messages need human approval. Prompt instructions help, but they are a suggestion to the model, while code-level checks are enforced every time.

## Go deeper

- [Guardrails: Definition](https://sudosapient.si/terms/guardrails)

## More on building blocks

- [What are evals in AI?](https://sudosapient.si/answers/what-are-evals-in-ai)
- [What is RAG?](https://sudosapient.si/answers/what-is-rag)
- [What is human-in-the-loop AI?](https://sudosapient.si/answers/what-is-human-in-the-loop-ai)
