Conditions
Eachwhere value is matched against one field:
"main|master"— any of the alternatives."*/migrations/*"—*matches any run of characters, including/;?matches one character."!main|dev"— a leading!negates the whole value: anything except main or dev.- A field the action doesn’t have never matches, so the rule doesn’t fire.
Actions
Commands are parsed, not pattern-matched.cd, git -C, bash -c, eval, env and sudo wrappers are followed. Writes through >, tee, cp, mv and sed -i count as file writes.
Inside a git repository, every action also has
repo (owner/name, from the origin remote) and current_branch. File and directory actions have dir.
Where rules come from
Rules load in this order. When two have the sameid, the first one wins.
- Built-in rules. An agent can’t grant exceptions, edit rule files, edit the CLI’s config (
.synheart/config.yamlin a repository or in your home folder) or turn the guard off. These can’t be overridden. - Team rules, set by an admin under Agents → Team rules and synced to each machine.
- Your own rules, in
~/.synheart/guard/rules.yaml(synheart guard initwrites a starter set). - Exceptions you granted with
synheart guard allow. - Repository rules, in
.synheart/guard.yamlat the repository root.
A team example
Risky-changes pack
If you want checkpoints before risky changes and don’t want to write the rules yourself, add the risky-changes pack. It is off until you add it, and every rule in it asks. None of them deny.- Paths only. The file rules look at the path being written, never at what is written, and they skip
node_modules/,vendor/and.git/. A page such asdocs/migrations-guide.mdthat only mentions migrations is an ordinary edit. - No repeated asks. If your file already has a rule that covers one of these, that pack rule is skipped. The starter set already asks before pushes to protected branches and before discarding work, so on top of it only the first three rules are added.
- Your own file. The added rules are ordinary rules. Edit the
saytext to point at your runbook, remove any you don’t want, or grant a one-off withsynheart guard allow risky.migration-write --for 1h. - Who can add it. Only you can run the command, from your own terminal. An agent can’t add a pack.
- What Synapse records. In team mode, Synapse records the rule id (for example
risky.api-contract-write) for each time a rule fires. - Cursor. Cursor can’t ask before a file edit, so the two file rules stop the edit there and say why.
When rules are too strict
Agents → Team lists rules people always let through when asked. Those are candidates to relax, so developers are asked less. Before turning a new rule on for everyone, addshadow: true and watch the would fire column for a week.