In this glossary topic:

What is an AI guardrail?
An AI guardrail is an automatic check that runs around an AI model and screens what goes into it and what comes out of it. OpenAI's developer guidance describes guardrails as controls that steer an application, and its agent tools run them on the user's input and on the model's output. Anthropic uses the word more broadly. Its documentation groups reducing hallucinations, keeping replies consistent, resisting jailbreaks, and preventing prompt leaks under a single heading: strengthening guardrails.
Guardrails exist because a model on its own can be tricked, can invent facts, and can produce harmful or off-topic text. A guardrail catches some of these problems before a person sees them, or stops a risky request before the model acts on it.
What are the main types of AI guardrails?
Guardrails are usually grouped by where they run:
- Input guardrails check a person's message before the model sees it. They catch off-topic requests, jailbreaks (prompts written to trick the AI into breaking its rules), and prompt injection.
- Output guardrails check the model's reply before the person sees it. They look for made-up facts, harmful content, and replies in the wrong format.
Many guardrails are safety filters: smaller AI models that label text as safe or unsafe. OpenAI offers a free moderation model that labels content such as harassment, hate, self-harm, and violence. Output checks also matter for quieter harms, such as stereotypes. A 2024 UNESCO study found that popular language models linked women with words like "home" and "family" far more often than men.
What does a guardrail cost?
Every guardrail is a trade-off. OpenAI's guidance says designing guardrails and setting their thresholds means balancing accuracy, speed, and cost. Blocking too much fractures the experience, and blocking too little can cause lasting harm to the business. A strict filter stops more harm but also refuses more harmless requests. Researchers call this exaggerated safety. Their test set, XSTest, includes requests like how to "kill a Python process," which a well-calibrated model shouldn't refuse.
Vendors now publish these costs. In February 2025, Anthropic reported that new input and output classifiers cut successful jailbreaks from 86% to 4.4%, while refusals rose by 0.38% and computing costs by 23.7%. Guardrails reduce problems but don't remove them. Anthropic's documentation says techniques for reducing hallucinations don't eliminate them entirely.
How does a guardrail differ from a system prompt or a content policy?
A content policy is the written rule for what an AI may and may not produce. A system prompt is the set of standing instructions a product gives the model before every conversation, often asking it to follow that policy. A guardrail is the automatic check that tests whether the model actually did. A jailbreak, for example, tries to get the model to ignore its instructions, and an input guardrail can catch it before the model responds.
The 3 work together, but only the guardrail can block a reply. When it does, people see the result as a refusal. Apple's Image Playground, for example, answers a blocked prompt with "Unable to use that description." That message is part of the user experience, so designers need to write it as carefully as any other.
The AI Fundamentals for UX course covers how to design the policies and checks that shape AI replies.





