← My notebook

12 · Quality

Guardrails

Guardrails are checks on the path in and out of a model. They do not make the model safer. They make the system safer.

Two gates

An input check sits before the model; an output check sits after it. Each is ordinary code or a small model with one job: pass, block, or rewrite.

Input: should it see this?

"My card is 4929 1234…" never reaches the model. The input check spots a card number, removes it, and the request stops there. What the model never sees, it cannot leak.

Output: should anyone read this?

"Will losses double?" passes the input check. The model drafts "Losses will double." The output check finds no forecast in the source data and replaces the draft with a supported reply.

What to watch for

Log every block with a reason. Keep checks narrow and testable. And treat guardrails as part of the eval set, because a check that blocks good answers is a bug too.