# Rules (https://docs.neuralisapp.com/package-system/rules)

A `rules/*.md` file is a hard constraint the agent must obey on every turn. It
is injected into the system prompt near the top (primacy), grouped with
[instructions](https://docs.neuralisapp.com/package-system/instructions.md), wrapped in a
`<package_file category="rule">` block. Rendering, the frontmatter that is dropped, the
per-file cap (`packageFileMaxChars`, default 8,000 characters) and the
placeholders are the same for both categories:
[Instructions → Prompt-injected categories](https://docs.neuralisapp.com/package-system/instructions.md#prompt-injected-categories).

```markdown
---
name: mutation-safety
description: Never write outside the project's own sources.
---

Before any write, confirm the target URI belongs to the current project...
```

<Callout type="info" title="Rules are a native privilege">
For any package below `native` trust, discovery downgrades `rules/`
contributions to `docs`. A project-installed package can ship reference
material, but it cannot inject always-on behavioral constraints into the
system prompt.
</Callout>

Keep rules short: they cost tokens on every turn. Move background into
[docs](https://docs.neuralisapp.com/package-system/docs.md) and procedures into a
[skill](https://docs.neuralisapp.com/package-system/skills.md). A rule obeys the same visibility gates as
every category — package state and `requiredFeatures` — and is toggleable per
agent and per conversation
([Instructions → Visibility](https://docs.neuralisapp.com/package-system/instructions.md#visibility)).
