> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anagram.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules

> Always-on instructions that keep your agent on-brand and out of trouble.

Rules are standing orders. Every rule you save applies to every response your agent gives, on every page, in every conversation. They're how you encode the things a good employee would just know: what to promise, what never to promise, how to talk about competitors, when to point someone to customer service.

You'll find Rules as a tab in **Brain**.

## Writing a rule

Each rule is one instruction with a polarity:

* **Always** rules describe what the agent should do. "Always greet shoppers warmly and stay on-brand."
* **Never** rules describe what it must avoid. "Never promise a specific delivery date."

Pick **Always** or **Never**, write the behavior in the text box, and click **Save rule**. It's live immediately. Your saved rules appear in a list below the composer, and every rule in that list is active. To retire a rule, delete it; there's no on/off switch.

## What makes a good rule

Keep each rule to a single, concrete behavior. A few patterns that work well:

* **Guardrails.** "Never give medical advice; suggest the customer consult a doctor."
* **Brand voice.** "Always refer to our loyalty program as The Circle, not the rewards program."
* **Sales behavior.** "Always suggest a complementary product after answering a product question."
* **Escalation.** "Never handle order cancellations; direct shoppers to [support@yourbrand.com](mailto:support@yourbrand.com)."

Avoid stuffing several instructions into one rule. "Always be friendly, mention free shipping, and ask for their email" is three rules pretending to be one, and the agent follows three separate rules more reliably.

## Rules vs. knowledge vs. skills

It's worth keeping the three straight, because the fix for a bad answer depends on which one is missing:

* The agent got a **fact** wrong or didn't know it? Add [knowledge](/brain/knowledge).
* The agent **behaved** wrong, was off-brand, or promised something it shouldn't? Add a rule.
* The agent needs to follow a **multi-step process** for a specific task, like size finding? Write a [skill](/brain/skills).

## Testing a rule before saving

While you're writing a rule, the preview chat next to the editor automatically applies it on top of what you've already saved. You'll see a "Testing unsaved changes" badge; nothing there goes live or touches your analytics. Chat with the preview, check the behavior change, and save once it looks right. This works for edits to knowledge and skills too.
