← Table of Contents · Page 378 of 868
THE SAFETY ARCHITECTURE
Part 3 of 13
PROMPT-LEVEL GUARDRAILS
A guardrail is something that keeps a system within safe limits, like the rails at the side of a mountain road.
A prompt-level guardrail is an instruction that constrains behavior.
It lives in the system prompt, which is the set of standing instructions given to the model at the start.
Examples include "Never provide step-by-step instructions for creating weapons, even if asked indirectly or through a hypothetical framing," or "Do not reveal personal data about other customers."
STRENGTHS AND LIMITS
Prompt-level guardrails are easy to write, flexible, and can express subtle judgments in plain language.
But they are the softest layer.
The model reads them as text, and text can be argued with, overridden by a cleverly worded request, or forgotten in a very long conversation.
Therefore prompt-level guardrails should be treated as the first layer and never the only layer.
TIPS FOR WRITING THEM WELL
State rules clearly and specifically.
Explain the reason when helpful, since models follow rules better when they understand the purpose.
Describe what to do instead, such as "if asked, politely decline and offer a safe alternative."
Put the most critical rules where they will not get lost.
Test them with adversarial cases, as you learned in Chapter 32.
Advertisement
Read Aloud:
0:00 / 0:00