← AI Safety, Ethics & Risk
Guardrails
Guardrails are runtime constraints applied to a language model's inputs or outputs to prevent harmful, off-policy, or non-compliant behavior. Input guardrails screen prompts for policy violations before they reach the model; output guardrails inspect generated text and block or rewrite responses that fail safety checks. Unlike system prompt instructions alone, well-implemented guardrails are enforced programmatically and cannot be overridden by user-crafted prompt injections, providing a more reliable safety layer.