Rules and guards
Rules your agents follow, and guards they cannot get around.
Memories tell the agent what to do. Rules make sure it happens: they run in the hooks, before and after the agent acts, so the agent cannot skip them.
What a rule does
| Action | Effect |
|---|---|
| Block | The command or edit does not run |
| Ask first | The agent stops and asks you; it goes on only after you say so |
| Remind | The agent gets a message right when it matters |
| Add memories | Puts chosen memories into the session |
| Note | Records the event, nothing else |
A rule can match commands (git push), files, tools or words in the prompt, and run every time, once per answer,
once per session, once per command or file, or once per person.
Examples
- Never restart, stop or kill containers, services or the host.
- Dropping a database needs my OK.
terraform destroyonly when I asked for it.- Editing secret files needs my OK.
- No co-author or AI lines in commits.
Add them from Ready rules under Rules or write your own.
Trial run
Before you save a rule, Trial run shows how often it would have fired in the last 7 days of your team's sessions.
Activity
Every time a rule blocks, asks, reminds or adds memories, mastermem logs it for 30 days: the rule, the person, the
repo, the client and what it matched (only a command's first words or a file pattern like **/prod/*.env, never the
full command). Under Rules, each rule shows how often it fired, and Activity lists the latest hits; click a count
to see only that rule. Owners see the whole team, members their own.
Team rules
In a team, rules a member or an agent proposes wait for an owner in To confirm. A rule can apply to everyone or only
to one person.
mastermem's own rules
The pushes on How it works are rules too. Under Rules, mastermem you can turn each one off or
limit it to the main agent or to subagents.