Guardrails
Hard constraints implemented in code, not in the prompt.

In one sentence
Hard constraints the agent cannot violate, implemented in code and not just in the prompt: maximum values, prohibited actions, data it cannot access. It is the technical implementation of business policies.
Without it
The rule lives in the prompt: the model may ignore it — and one day it will.
With it
The rule lives in code: a violation goes from unlikely to impossible.
Example
The prompt says, "do not mention the child's address." In the code, there is a function that scans the output for address patterns and refuses delivery. Only the function is a guardrail; the sentence in the prompt is an intention, and the difference shows up the day the model is updated underneath.
The common mistake
Entrusting the rule to the prompt. The model may or may not follow what is in the prompt, while code enforces the limit. Any rule whose violation would be unacceptable must exist outside the model, because the model is probabilistic and "almost always complies" does not work as a compliance policy.
In practice
- Take the rules whose violation would be unacceptable and implement them in code.
- Test by trying to violate them. Without that test, you are only assuming the guardrail works.
- The guardrail returns the reason to the agent, because a silent block triggers the same attempt again.
How to make it tangible
Critical rules implemented as validation in code, outside the prompt.
Translated from Portuguese with AI assistance.
