Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

AI glossary

Guardrails

Guardrails are the checks around a model call that stop unsafe or unwanted input and output, enforced in code rather than only asked for in the prompt.

They sit on both sides of the model: on the way in, checking length, topic and personal data; on the way out, checking format, banned content and whether a tool call is allowed.

A simple example is an allowlist: the assistant may call these three tools with these argument ranges, and anything else is refused by the code before it runs.

A guardrail written only as a sentence in the system prompt is a hope. Real guardrails are code that runs whatever the model says.

Learn it hands-on

These free lessons teach it with commands to run in a lab and checked tasks. Read them whole with no account.

← All AI terms