L169 · Under the hood · 2 min
Guardrails on the way in
Input guardrails check what users send before the model sees it, catching private data, abuse and tricks early.
01 · The idea
Anyone can type anything into a public chat box. Some messages contain things the system should never pass on, like full card numbers. Some are attempts to make the bot break its rules, often called jailbreaks.
An input guardrail is a check that runs first. Simple ones use rules: block messages over a certain length, hide anything that looks like a phone or ID number. Smarter ones use a small classifier model that labels the message as fine, off-topic, abusive or a likely trick.
When a check fires, the app can block the message, remove the risky part, ask the user to rephrase, or hand the chat to a person. A bank bot might reply "Please do not share your card number here" and blank it out.
Guardrails make mistakes both ways. Too strict and they block normal customers, too loose and tricks slip through. Teams test them with real examples, keep a log of what was blocked, and adjust over time.
02 · Think of it like this
It is the security desk at a building entrance. Most visitors walk straight in, a few get asked to leave their bags, and a rare one is turned away.
03 · Do it now
04 · Quick check
Words in this lesson
See also
L163Under the hood · 3 min
MCP safety: what can go wrong with connectors
Every connector is a door between the AI and your data, so check who made it, what it can touch and what text it lets in.
L185Under the hood · 3 min
When AI products fail in public
Public AI failures usually follow a few patterns, like invented facts, promises nobody approved and bots tricked into embarrassing replies, and each has a known fix.
L026Under the hood · 2 min
AI agents: AI that takes action
An agent is AI that does not just answer but takes steps: it plans, uses tools, checks the result, and keeps going.
L200AI at work · 3 min
Reading customer feedback at scale
Paste a batch of reviews or survey answers and ask AI to group them into themes with counts and real quotes.