Guardrails are constraints on model output. Three main types: (1) Schema validation — model must generate JSON with a defined structure; (2) Allowlist/blocklist — disallowed content (names, addresses, amounts outside range); (3) Confidence threshold — model must indicate confidence, answers below threshold are blocked.
Tools 2026: Guardrails AI (open-source framework), Outlines (constrained generation), custom regex+post-processing. Most production systems use a combination.
Practical example: AI in invoice processing. Guardrail: invoice amount MUST be in predefined range (e.g. EUR 25-250k). If model generates 'EUR 1,250,000,000' — block the answer, escalate to human. Eliminates 80% of costly errors.