Guardrails

Also called ai guardrails, safety rails, content filters

Rules, checks and limits placed around an AI system to keep its behaviour safe and on task.

Guardrails are the controls that keep an AI application within acceptable bounds. Some live in the prompt: rules about topics, tone, what to refuse and what never to promise. Others live in code around the model: input filters that block harmful or off-topic requests, output checks that catch leaked personal data or policy violations, schemas that enforce a format, and limits on which tools an agent can call.

The strongest guardrails do not depend on the model's cooperation. A refund bot told "never issue refunds over £100" might be talked out of it; a refund tool that rejects any amount over £100 can not be. Similarly, an agent with read-only access to a database can not delete records, whatever an injected instruction says.

Guardrails also include human checkpoints, rate limits, logging and monitoring. Good practice layers several of them, because each catches different failures. The goal is not to make misuse impossible, which is unrealistic, but to make failures rare, small and noticed quickly.

Example

A healthcare scheduling assistant has guardrails at four levels: the system prompt says not to give medical advice, a classifier flags symptom descriptions and routes them to a nurse line, the booking tool only accepts real open slots, and every cancellation needs patient confirmation.

Common mistake

Treating prompt instructions as the whole guardrail. Prompts are easy to change and can be argued around. Put the rules that really matter, especially around money, personal data and irreversible actions, in code and permissions as well.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close