WriteMyAIPromptFree, no sign-up

Guardrail

A guardrail is a check placed around a model — before input reaches it or after output leaves it — that enforces a rule the prompt alone cannot guarantee.

Guardrails exist because prompts are requests, not enforcement: a model can always fail to follow one. Anything that must never happen belongs in code that validates the input or the output, not in a sentence asking the model nicely.

Related terms

Prompt injection
Prompt injection is an attack in which instructions hidden inside content a model processes cause it to ignore its original instructions.
Jailbreak
A jailbreak is a prompt crafted to make a model bypass its own safety training and produce output it would normally refuse.
Stop sequence
A stop sequence is a string that causes a model to stop generating as soon as it produces that string.

More on safety

See the full glossary, read the guides, or put it into practice in the prompt builder.