# How to write a guardrail policy

To write a guardrail policy, name one act of the AI, say where it applies, draw the line with examples on both sides, pick the action, then test it on real traffic before turning it on.

## Steps

1. **One act per policy.** "The assistant does not reveal its system prompt." Two rules in one sentence cannot be tuned apart.
2. **Word it as the AI's act.** What it writes or what its agent does, not an outcome in the world.
3. **Say where it applies.** The user's prompt, the response, tool calls. A rule about leaked data belongs on responses and tool calls.
4. **Draw the line.** Add a case that breaks the rule and a near one that does not: quoting a public price list is fine, quoting another customer's invoice is not.
5. **Pick the action.** Block, rewrite, hold for a person, or only flag: see [guardrail actions](/glossary/guardrail-actions).
6. **Test before it is live.** Run it over past traffic and read what it would have caught: see [policy backtesting](/glossary/policy-backtesting).
7. **Start by flagging.** Watch a day of real matches, then switch to blocking.

## Common mistakes

- **Too broad.** "No harmful content" matches a nurse asking about overdoses. See [false positives](/glossary/guardrail-false-positives).
- **A goal, not a rule.** "Stay compliant" cannot be checked.
- **Keyword thinking.** Listing words to avoid in a policy that a model reads for meaning.
- **No owner.** A policy nobody reviews drifts out of date.

## With White Circle

In [Control](/products/control) a policy is a plain sentence with an action. Policies are versioned, can be tested before they go live, and a change applies at once.

