Permission policy (ADR 0006). Pure decision function — the Executor consults it and,
for :ask, calls a front-end-supplied asker.
Modes:
:auto(default) — everything is allowed; no prompts. The blessed common path.:ask— only genuinely risky operations prompt.readnever asks;bashcommands on a conservative safe-list auto-run;writeand non-safebashask.:read_only— mutating tools are denied; reads and safe commands run.
Workspace confinement is enforced elsewhere (the tools) and is the real floor in every mode — this layer is a convenience gate on top.
Summary
Functions
Decide whether a tool call may run under mode.
All valid permission modes.
Whether a tool call mutates state (and so is gated outside :auto).
Whether a shell command is read-only and safe to auto-run: first token on the safe-list, no shell metacharacters, and no mutating git subcommand.
Types
@type decision() :: :allow | :deny | {:ask, String.t()}
@type mode() :: :auto | :ask | :read_only
Functions
Decide whether a tool call may run under mode.
@spec modes() :: [mode()]
All valid permission modes.
Whether a tool call mutates state (and so is gated outside :auto).
Whether a shell command is read-only and safe to auto-run: first token on the safe-list, no shell metacharacters, and no mutating git subcommand.