← AI glossary

AI glossary · Basic · Safety & alignment · AI security

Guardrails

Guardrails are safety mechanisms that check and block content before and after an AI model, so that the model does not take in or produce content that is dangerous or breaks the rules.

About this term
Level
Basic · Technical terms you often meet in AI news
Added
2026-10-08
In plain words Just as a guardrail at the edge of a road keeps cars from going off the road, it is a fence that keeps an AI's conversation from leaving the allowed range. However, it is not as solid as a real guardrail, so it can be broken through by clever attempts.

How it works

Guardrails usually work at two points. First, before the user's input reaches the model, they check it for harmful requests or hidden instructions. Then, before the model's answer reaches the user, they check again for personal information, harmful content or company policy violations. Methods for checking range from simple rules such as banned-word lists to small AI models trained specifically for checking.

The two points where guardrails step inUser input → Input check; Input check → AI model(Pass); AI model → Output check; Output check → Answer to user(Pass); Input check → Refuse · revise(Block)User inputInput checkHarmful requests ·hidden instructionsAI modelOutput checkPersonal information ·policy violationsAnswer to userRefuse · revisePassPassBlock
The two points where guardrails step in The user's input and the model's answer are each checked once. If there is a problem, it is blocked or fixed at that stage.

Why it matters

No matter how well a model itself is trained, jailbreaks and mistakes cannot be fully prevented. Guardrails add one more layer outside the model to reduce risk. When companies use AI for customer service or internal work, they must follow industry regulations and company policies, so guardrails are especially important. When AI agents handle real tools, guardrails are also used to stop them before they take dangerous actions.

Things to know

If guardrails are too strict, they refuse even normal questions and become inconvenient to use. If they are too loose, dangerous content gets through. More checking steps make responses slower and costs higher. So the key challenge for each service is finding the right balance between safety and convenience.

Example

For a workplace chatbot that searches internal documents to answer questions, guardrails might filter out questions in which an employee asks about another person's HR information at the input stage, and mask personal information such as resident registration numbers or contact details if it appears in an answer at the output stage. Several cloud and AI companies offer these checking functions as separate tools.

Related terms