Learning path · Guardrails & Safety · 77
Guardrails
Policy layers—input filters, output validators, tool allowlists—that constrain model behaviour before and after generation.
Why it matters
- Models alone do not enforce business or legal rules.
- Defense in depth beyond prompt pleading.
- Required for regulated and customer-facing features.
Key ideas
- Input validation
- Output filtering
- Tool policies
Guardrails combine classifiers, rule engines, and schema validators around the LLM. Check inputs for injection and PII leakage; check outputs for policy violations before users see them. Fail closed on high-risk categories. Test guardrails with red-team suites whenever prompts or tools change. Test guardrails on adversarial inputs whenever tools or retrieval sources expand; new data paths reopen old injection classes. Validate changes on production-like eval slices before rollout. Review blocked and allowed samples weekly with policy owners to tune false positives.
Updated 2026-08-09 · Full learning path