# Rules and decisions for agents

## An agent that remembers your house rules

An AI agent starts every session without memory. Rules and decisions fix that. A rule is guidance the agent should follow, such as "Every checkout control must work with a keyboard". A decision is a choice your team made and why, such as "Reports use the shop time zone".

You keep both as pages in the [Memory Drawer](https://sprintree.com/docs/memory-drawer). This page explains how agents read and write them. The Memory Drawer page explains how you mark pages as rules and decisions yourself.

## How an agent reads them

When an agent starts work on a card, it asks Sprintree for the card's context with the `get_work_context` tool. One answer gives it the card, its parent chain, its description, open blockers, acceptance criteria and the rules that apply. These rules are of two kinds.

- **Always-on rules.** Rules marked **Apply to every task** reach the agent on every card.
- **Linked rules.** Other rules and decisions reach it when the card, or one of its parents, links to the page.

An agent can also list the whole drawer at any time with `get_project_rules`, to read rules before it plans work.

Rule text is guidance, not a command. If your own words to the agent disagree with a rule, your words win.

## How an agent writes them

You rarely need to open Pages to create a rule. Say it to your agent:

- "From now on, always run the linter before committing."
- "We decided to keep the old export format until March."

The agent saves the first as a rule and the second as a decision, then sends you the link. Open the page to check the wording. Edit it like any page.

In Claude Code, the Sprintree plugin reminds the agent to save a decision after you answer one of its questions in the terminal. An answered [agent question](https://sprintree.com/docs/agent-questions) on a card can also become a decision with **Save as decision**.

## Check what your agent sees

1. Ask your agent, "Which rules apply to WEB-12?" It reads the card context and lists them.
2. Compare with the page list in **Pages**, filtered by **Rules** or **Decisions**.
3. If a rule is missing, check that it has the kind **Rule** and, for a rule that should apply everywhere, that **Apply to every task** is on.

## Tips and common mistakes

- Keep each rule short and about one thing. A long list is easy to ignore.
- Include the reason in a decision. The agent, and the next teammate, will respect it more.
- Rules and decisions have restricted access. Invited members can read them. A visitor who joins a public project does not.
- A rule can look right and still fail if it is vague. "Write good tests" is weaker than "Each bug fix adds a failing test first".
- Do not put secrets in a rule. Anyone who reads the page and every agent connected to the account can see it.

## Related pages

- [Memory Drawer](https://sprintree.com/docs/memory-drawer) to mark rules and decisions yourself.
- [Agent questions](https://sprintree.com/docs/agent-questions) to turn an answer into a decision.
- [Work with AI agents](https://sprintree.com/docs/work-with-ai-agents) for the big picture.
- [Technical MCP reference](https://sprintree.com/docs/mcp) for `get_work_context` and `get_project_rules`.
