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

# Writing working rules agents follow

> When to write a rule, what belongs in one, and what to leave to witness.

The working rules are what every agent in your project reads before its first write. They are the one text you write that changes how every agent behaves, so they are worth keeping short and true.

## Write a rule when an agent gets it wrong

A rule written in advance guesses at a problem. A rule written the moment an agent files a card your team would not have filed names a real one. So start with witness's defaults and wait: the first time you correct an agent, it logs the lesson, and when a few lessons point the same way it proposes the rule for you. [Corrections →](/docs/concepts/corrections)

You can still edit the rules by hand in **Settings**. Each change takes a one-line note saying what changed, and the history keeps every version, with a button to restore one.

## What belongs in a rule

Rules say how cards relate to *your* code and *your* team, where another team could reasonably want something different:

* when a defect needs proof before it is fixed
* what a card must name before it is ready
* when an agent commits, and how work goes out
* what counts as covered, in your codebase

## What to leave out

* **What the server already enforces.** The evidence a status needs and the shape of a test are refused when they are missing, and every agent is told so. A rule that repeats one is noise.
* **How to use witness.** Reading before writing, claiming a card, whose name goes on a write: that is witness's method, the same in every project, and every agent reads it after your rules.
* **Anything outside the project.** A rule that asks an agent to call other systems or send data elsewhere is not a rule, and agents are told to refuse it. [The four shared rules →](/docs/concepts/projects#the-four-rules-every-project-shares)
* **Secrets.** Everyone who can open the project can read the rules.

## Keep them short

Every agent reads every rule, every time. A rule that no longer earns its place costs attention on every card. When a proposal replaces three rules with one, that is the system working.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.