What a guardrail is, and what it can't be
A guardrail is a check that can refuse.
The definition, and why it’s narrow on purpose
Not a policy document, a system prompt, a warning printed beneath an answer, or a dashboard somebody reviews on Tuesday. A guardrail is code that runs while a request is in flight and can stop it. If it can’t stop anything, it’s monitoring: valuable, and a different job that step 12 comes back to.
- The pink arrow is a refusal; the green one is the work beginning.
- Both are the check working correctly, which is the whole problem.
Three consequences, and they’re the whole difficulty
| because it… | the consequence |
|---|---|
| decides now | it runs while the request is in flight. It can’t wait for the incident review, for a person, or for the next model. What it knows then is all it will ever know |
| decides from what it can see | a check at the door sees a request. It doesn’t see which tools the agent will reach for, what it will retrieve, or what it will say: those haven’t happened |
| refuses real people | every refusal lands on somebody. At volume it’s not a rounding error, and it’s the line most often left off the comparison |
The third gets left out because the people paying it aren’t in the room. A check that refuses a harmful request prevents an incident; the same check firing on a request that was fine refuses someone who wanted something reasonable. They’re the same event seen from two sides, and no amount of care makes one happen without risking the other.
The instinct this volume is written against
Faced with those three, the natural move is more checks. If one check is narrow, use six. If a check at the door can be evaded, add one at the exit too.
What this volume doesn’t cover
How to build a classifier that resists evasion is a real field, and it isn’t this one. Every check here is a fixed instrument with a known blind spot, because the question is where to point the checks you have, not how to build a better one.
python3 lab.py ordinary
Part 1 runs the traffic with no guardrails: every harmful request gets through, at $40.00 each.