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> |
Edit the policy
Section titled “Edit the policy”moat editIt 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/**"]Example: always ask before deploying
Section titled “Example: always ask before deploying”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.
Edit by hand
Section titled “Edit by hand”$EDITOR ~/.moat/policy.yamlmoat policy lint # schema, ids, globs; warnings for rules that can never matchmoat # shows what changed and asks you to accept itThe full policy language and the default policy are in POLICY.md.