Guardrails
An LLM tries to answer anything it is sent. It can also say things you never meant it to say. Guardrails are checks you put around the model. They watch what goes in, what comes out, and what the model may do. One check is never enough, so you use several layers.
New words
- Guardrail
- A check outside the model that can block or fix traffic.
- PII
- Personal data, such as a card number, phone number or email.
- Redaction
- Hiding private parts of the text, for example with stars.
- Classifier
- A small model that puts text into a category.
- Threshold
- The score above which a message is blocked.
- False positive
- A normal message that is blocked by mistake.
- Defence in depth
- Many layers of checks, so one failure is not a disaster.
What you will learn
- The problem: the model says yes to everything
- How it works: checks on three sides of the model
- Three ways to build a guard
- Try it: run messages through the guards
- Trade-offs and failure modes
- Production practices
- In code
- In a real system
- Interview tip
- Key takeaways
10 quiz questions at the end.
The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.