Skip to content

Guardrails

Guardrail

Checks that stop or constrain an action before it happens.

Guardrails are the rules that constrain what an agent is allowed to do: a path it may not write to, a command it may not run, a class of request it must refuse, a number it may not exceed. They exist because the model cannot be trusted to police itself; it will attempt the blocked thing if nothing stops it.

Their placement matters. A guardrail on the output catches bad answers after the model has already produced them, and the user has usually already read them. A guardrail on the tool call catches the action before it happens. A guardrail on the input catches a prompt injection before it reaches the model. The strongest systems check all three.

Guardrails also need to be narrow. A rule that is too broad turns the agent useless, and a rule that is too specific misses the case it was written for. This is the same lesson as ordinary security: allow by default, deny by exception, and log the exceptions.

Related terms

Want this working inside your team?

It starts with one conversation about your workflow.

Ask on WhatsApp