Guardrails for LLM features
For engineers
Input and output checks, moderation, policy classifiers and guardrail tools, layered with tool limits and approvals, and measured for both bypasses and false blocks
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
A feature needs a maximum message size, a card-number redaction and a moderation call. In what order should the checks run?
Check yourself · 2 of 5
A model reply should be JSON with an amount field, but the amount is missing. What is the usual first action?
Check yourself · 3 of 5
Your policy says "never quote prices." A provider moderation endpoint scores hate, violence and self-harm. What follows?
Check yourself · 4 of 5
An agent has a read-only database role and no network access. A prompt injection gets through the classifier. What limits the damage?
Check yourself · 5 of 5
A filter blocks an attack in English but lets the same request through in Base64. What pattern is this?
Topics
- Input checks before the model call5 min read · Length and format limits, moderation, personal-data detection, topic classifiers and injection classifiers on untrusted content, and the latency each check adds
- Output checks before users see a response5 min read · Schema validation, moderation, personal-data and secret scanning, grounding and citation checks, and the choice between blocking, rewriting and flagging, including for streamed output
- Guardrail tools and policy models5 min read · Provider moderation endpoints, Llama Guard, NeMo Guardrails, Guardrails AI and cloud guardrail services such as Bedrock Guardrails compared on policy coverage, latency and hosting
- Layering guardrails with tool limits and approvals5 min read · Guardrails as one layer among least privilege, sandboxing, rate limits and human approval, because any single classifier can be fooled
- Guardrail bypasses and false positives5 min read · Encodings, other languages, multi-turn setups and indirect content that slip past filters, and over-blocking that refuses legitimate users; measuring both rates on a labelled set
Start here
- OWASP Top 10 for LLM Applications (opens in a new tab)DocsFree
Names the risks guardrails address: prompt injection, sensitive information disclosure and improper output handling.
- Llama Guard: LLM-based input-output safeguard for human-AI conversations (opens in a new tab)PaperFree
The paper behind a policy classifier model that labels both prompts and responses against a written taxonomy.
- NVIDIA NeMo Guardrails documentation (opens in a new tab)DocsFree
Overview of input, dialog, retrieval, execution and output rails in an open-source toolkit.
Scenarios
Helps to know first
110 questions · last verified 2026-12