Permissions & modes
spai puts a permission gate in front of anything that changes your system. It
combines a tier-based gate, a configurable policy layer, and three
execution modes.
Execution modes
Section titled “Execution modes”- manual (default) — write/elevated/destructive actions ask first.
- auto — run everything without prompting (
--autonomousdoes the same one-shot). - plan — propose the tool calls but never execute (
--dry-run).
Set the mode with /mode in a session, cycle it with Shift-Tab, or pass
--autonomous / --dry-run for one-shot runs.
Tier-based gate
Section titled “Tier-based gate”Each tool call is classified by risk:
- read —
read_file,glob,grep,list_dirrun freely. - write —
write_file,edit_fileare confirmed in manual mode. - elevated / destructive —
sudoand destructive commands always ask, and approval is session-scoped (seesudo_session_timeout).
Command parsing, not string matching
Section titled “Command parsing, not string matching”Command safety is decided by parsing each shell command, so rm -rf,
rm --recursive, and a && rm -rf b are all caught, while echo "rm -rf" is
not.
Configurable policy layer
Section titled “Configurable policy layer”You can layer a policy on top of the tier gate in the [permissions] section of
spaid.toml — allow / confirm / deny per tool or per MCP server, plus a bash
allow_commands prefix allowlist (e.g. git status) that bypasses
confirmation.
Resolution precedence, highest first:
- per-tool entry (
[permissions.tools]) - per-MCP-server entry (
[permissions.mcp_servers]) - bash
allow_commandsprefix match - default tier-based behavior
See Configuration for the full set of keys.