Approvals
Agents read and write files, run shell commands, and drive browsers. Approvals are the control surface over that — the difference between an agent you let run unattended and one you watch every keystroke of.
The policy
An ordered list of rules plus a default. The first rule that matches a tool call decides; anything uncovered falls back to the default.
extensions:
approval:
default: ask-human
rules:
- match: "bash(git log *)" # tool(pattern); first match wins
action: allow
- match: "bash(rm *)"
action: denyFour verdicts:
| Verdict | Meaning |
|---|---|
allow | Runs immediately |
deny | Refused, with a reason handed back to the agent |
ask-agent | A separate approval agent judges the call |
ask-human | Parked until you decide, in the TUI or web UI |
ask-agent is the interesting one: a second, usually cheaper model reviews the
call in context and decides. Point it at a model with the provider: key:
extensions:
approval:
provider: approval-agent
default: ask-agentApproving in practice
A parked call surfaces inline in the transcript — in the TUI, in the web UI, or
on your phone. Approve it, deny it, or deny with a comment: the comment goes
back to the agent as the reason, which usually redirects it rather than just
stopping it (“don’t use rm, move it to /tmp instead”).
Denying can also stop the turn outright when you want the agent to halt, not adapt.
Denial is a first-class outcome, not an error. An agent that gets denied is expected to route around it, and a good deny comment is the cheapest way to steer a long-running task.
Safe shell pipelines
Shell is the hard case: bash(git log *) is easy to allow, but real commands
are chains. BotBandit parses a shell command into its actual structure and evaluates
each stage, so a safe chain can auto-approve as a whole without you hand-listing
every permutation — and the approved command is executed as parsed arguments,
never re-parsed from a string that could mean something different the second
time.
This is opt-in, per policy, with pipelines: true:
extensions:
approval:
pipelines: true
rules:
- match: "bash(git log *)"
action: allowWith it, git log --oneline | head -20 auto-approves: git log matches an
allow rule and head is a built-in stdin-only filter. Every other stage of a
chain needs an allow rule of its own. See
ADR-003
for the model.
Claude Code and Codex
Agent providers bring their own
shell and file tools, and gate them with their own settings on the provider
block — permissionMode and allowedTools for claude; approvalPolicy,
sandboxPolicy and approvalsReviewer for codex. BotBandit’s policy governs the
tools BotBandit adds to them. So on those profiles, keep the policy summary out of
the agent’s prompt, where its bash(...) rules would describe a tool the agent
doesn’t have:
profiles:
coder:
provider: codex
extensions:
- approval: { policyNotice: off }Codex’s default workspaceWrite sandbox lets its shell write only the
session’s directory and the temp directories. sandboxPolicy.writableRoots
opens extra directories — say, a package manager’s global store — and each one
is writable to every Codex turn of that provider with no approval asked:
providers:
codex:
sandboxPolicy:
type: workspaceWrite
writableRoots:
- ~/Library/pnpm/store
- ~/Library/Caches/pnpm
- ~/.local/state/pnpm
shellEnvironment:
npm_config_store_dir: ~/Library/pnpm/storeshellEnvironment sets environment variables for every command Codex runs for
that provider. pnpm needs it here: without an explicit store directory it tests
its home folder (~/Library/pnpm), fails under the sandbox and quietly builds a
fresh .pnpm-store/ in the worktree. Use your own paths (pnpm store path
without its trailing version segment such as v10, pnpm config get cache-dir); npm, which reads the same variable, warns about it on each run. Listing the pnpm home
instead needs no variable, but that folder also holds pnpm’s global binaries,
which are on your PATH. The model’s commands and ps both see the values, so
keep secrets out.
BotBandit refuses a root that overlaps its own home, ~/.codex, a config file or
another listed root, or lies inside a temp directory. Keep the list short, or
put it on a separate provider (baseProvider: codex) used only by the profiles
that need it.
Unattended runs
Scheduled tasks and headless run-task sessions have no human to ask, so
ask-human there means “park forever”. Give unattended profiles a policy that
terminates: an explicit allow-list with default: deny, or ask-agent.
Further reading: ADR-001 covers the policy and tool-capability model in full.