Layered guardrails
Swipe to change step
Step 1 of 8. Guardrails are checks around the model: on input, on the actions it wants to take, and on its output. Cheap checks in code come first; model-based checks go where code cannot decide. User. Input filter (size, PII, injection), highlighted. Model (system prompt). Output filter (schema, PII, grounding), highlighted. Reply. Policy engine (identity, limits), highlighted. Approval gate (risky actions), highlighted. refund tool. arrow from User to Input filter. arrow from Input filter to Model. arrow from Model to Output filter. arrow from Output filter to Reply. arrow from Model to Policy engine, labelled tool call. arrow from Policy engine to Approval gate. arrow from Approval gate to refund tool.
In this chapter
- 64.1Where guardrails sit in a system4 min read
- 64.2Input filtering and classification4 min read
- 64.3Output filtering and validation4 min read
- 64.4Policy layers: rules outside the prompt4 min read
- 64.5Approval gates for risky actions4 min read
- 64.6Content moderation pipelines4 min read
- 64.7Testing guardrails: false positives and bypasses4 min read
- 64.8Worked example: hooks, permissions and moderation prompts5 min read
- 64.9Topical and off-rail classifiers6 min read
- 64.10PII and secret detection and redaction7 min read
- 64.11Guardrail frameworks compared6 min read
Chapter check
Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.
Loading check…