Usage & Prompting

Guardrails

Guardrails are the boundaries within which a system may act: what it may see, what it may do, where it has to stop and ask someone. What matters is not that they exist but where they sit. A rule in the system prompt is an instruction to a model that as a rule follows it and in rare cases doesn't: with unusual inputs, in long conversations, under deliberate attempts. A rule in the surrounding code is a boundary that is not negotiable, because the model doesn't even see it. For anything whose violation costs money, data, or reputation, only the second design is a control. The first is a request that is usually granted.

An example

An agent may approve invoices. The guardrails: up to 500 euros on its own, above that approval by a human; only to suppliers on the stored list; never the same invoice number twice; if the purchase order reference is missing, abort with a message. What matters is where these rules live. As a sentence in the system prompt they are a request. As a check in the code before sending they are a boundary.

A closer look

Guardrails sit in three places: before the model in input validation, in the model via system instruction and alignment, after the model in output checks, enforced formats, and approvals. The third is the most reliable, because it does not depend on the model itself.

Why it matters

The difference between a request and a boundary is the whole content of the term, and the point where audits fail. A model that has been instructed not to trigger payments over 500 euros will as a rule comply and in rare cases won't. For a payment system, “as a rule” is not a control. The robust way to build puts every boundary whose violation is expensive or legally relevant in ordinary code outside the model. The model may then propose; the check decides what passes.

Commonly misunderstood

A guardrail in the prompt is a request. Anyone who needs a boundary that holds has to draw it outside the model: in permissions, approvals, and what the system is technically able to do at all.

Where this term does its work in the magazine.

1 article uses the term or takes up its principle.