Skip to content
pi-c Artifact [6ee92a4328]
Login

Artifact [6ee92a4328]

Artifact 6ee92a4328684e528c9a98a1a34ee834c50503d5304f52bb17af6e754a3ae1f2:


# Permission modes

Status: decided by the owner 2026-11-27 (ticket #107, closing #41): permission modes like Claude
Code's, off by default. Built 2026-11-27.

Tier: core (`src/perm.c`). Clock: durability. Record: `pic_permission`, a `pic_ask` per call that
asks. Default: `allow`, which asks nothing.

## Why

Pi has no permission prompts, and pic followed it: a PreToolUse hook's `ask` ran the call. A phone
that can start work wants the opposite for some conversations: stop before a command or an edit
and wait for a yes, from wherever the person is. Durable questions ([asks](../dev/asks.md)) made
that possible without a process waiting at a terminal.

## The decision

- Four modes, plain words: `allow`, `ask-edits`, `ask-all`, `read-only`. Claude Code's
  `bypassPermissions`, `default` and `plan` map to the first, third and fourth; its `acceptEdits`
  (edits run, commands ask) has no counterpart here, and `ask-edits` (edits ask, commands run) none
  there.
- The mode is the conversation's, durable, so every client sees and changes the same one. The
  setting `permissionMode` is a new conversation's; `--permission-mode` sets the conversation's at
  its next request.
- A call that asks is an ask with three answers: Allow, Allow for this conversation, Deny. It is
  keyed by the call, so a crash or a kill leaves it open and the call unrun, and the next owner of
  the request finds it.
- A hook's `ask` asks in every mode; a hook's `allow` skips the mode's question; `read-only` refuses
  a change whatever a hook says.
- A run with nobody there waits for the ask's expiry like any question, then denies and says so.

## Why core

The gate sits between a call's journaled intent and its start, which only core owns: it decides
nothing a model, vendor or prompt changes, only what the person chose, and it must be journaled
before the call may run and read back on recovery. The rule is four lines of C over a registry
flag (`read_only`) and two tool names; everything a person sees is an ask, which is core already.
The internals are in [permissions](../dev/permissions.md).