Guardrail (AI)
What is Guardrail (AI)?
A guardrail is a rule or check layered around an AI agent or model to constrain its behavior — blocking a disallowed topic, refusing an out-of-scope tool call, redacting sensitive data before it reaches the model, or validating a response before it's sent to a customer. Guardrails run before and after the model's own reasoning, catching issues the underlying model might otherwise miss or generate on its own.
More detail
Input guardrails typically screen what reaches the model — filtering prompt injection attempts or sensitive data — while output guardrails check what the model produced before it's shown to a user or acted on.
Guardrails are commonly rule-based (a keyword or pattern check) or a smaller, faster secondary model dedicated to classifying whether a response is safe, rather than relying solely on the primary model's own judgment.
Frequently asked
- Why can't the AI model just police its own behavior?
- A model can be manipulated (via prompt injection) or simply make a mistake, so an independent guardrail layer — checked before and after the model's own reasoning — catches issues that would otherwise reach a customer unfiltered.
- What's a common example of an output guardrail?
- Checking a generated response for personal data before it's sent, refusing to output content matching a disallowed category, or verifying a tool-call result actually matches what the model claimed before acting on it.
See also
Build it on Orbit
Voice, messaging, email, video, and AI agents on one platform and one pay-as-you-go bill. Start free — no credit card required.