Skip to content

Change the rules

Your policy is ~/.moat/policy.yaml. Most changes need no editing at all:

You want Run
Read and write a folder moat allow --dir <folder>
Reach a host moat allow --site <host>
Allow the command you were just asked about moat allow --last --always
Take one of those back moat allow --remove <id>
Terminal window
moat edit

It opens the policy in $VISUAL or $EDITOR. When you close the editor it checks the policy, shows the diff and asks Apply? [y/N]. A policy with errors is never written, and the previous version is kept in ~/.moat/policy.yaml.bak.

Example: read-only access to every repo under a folder

Section titled “Example: read-only access to every repo under a folder”
allow:
- id: work-repos-read
reason: reference code the agent may read
fs.read: ["~/work/acme/**"]
ask:
- id: deploys
reason: deploys reach production
shell: ["npm run deploy*", "fly deploy*"]

Rules are tried in the order deny → allow → ask, and across one command the strictest answer wins. A deny cannot be overridden by an allow.

Terminal window
$EDITOR ~/.moat/policy.yaml
moat policy lint # schema, ids, globs; warnings for rules that can never match
moat # shows what changed and asks you to accept it

The full policy language and the default policy are in POLICY.md.