# Entry Points and Confirmation Routing

Which permission mode each entry point runs in, and where its confirmation prompts are answered.

## Mode by entry point

The active permission mode (`safe` vs `auto`) is decided by entry point:

| Entry | Mode |
|---|---|
| TUI | `auto` when the starting working directory qualifies, otherwise `safe`; toggled per session with `Shift+Tab` |
| `POST /v1/send` | `safe` while the web dashboard has a confirmation listener open and the request does not set `enable_edit`; confirms are answered there. Otherwise (v1.3.9) API auto mode: no prompts, read-only unless `enable_edit:true`, and always sandboxed, see [REST API](/rest-api-overview). `enable_sandbox` was removed; use `agen -p --skip-sandbox` (Removed in v1.5.0). `agen -p` always uses API auto mode and, since v1.5.0, calls `app.Send` in its own process instead of going over HTTP. The `allow_all` request field was removed |
| `POST /v1/chat/completions` | `auto`; the work directory defaults to `$HOME`, which does not qualify, so the `safe` rules apply unless the request names a qualifying work directory |
| Telegram | `safe` (confirm gate uses a Telegram inline-keyboard select) |
| Discord | `safe` (confirm gate uses a Discord select menu) |
| Resumed pending task | Keeps the mode stored with the task |
| Subagent | Inherits the parent's mode; under `auto` it is not limited to the working directory |

The permission mode is not rendered into the turn context or the system prompt: the `## Permission Mode` section and `configs/prompts/system_prompt/inject/permission/*.md` were Removed in v1.3.7, and the gate above is applied by the harness alone. Commands on the read-only list skip the gate in every mode.

## Origin-routed confirmations

Every interactive request carries an origin prefix — `cli-`, `chat-`, `tg-`, or `dc-`. CLI confirmations are consumed only by the TUI — since v1.2.0 they travel over the daemon socket to the TUI window that started the run, not to every open TUI — web requests by the web confirmation stream, and Telegram or Discord requests by their matching channel listeners. A confirmation from a channel other than the TUI that is left unanswered for five minutes is skipped and the task is kept as pending (since v1.1.1 TUI confirmations wait without a time limit), so one channel can neither intercept nor indefinitely hold another channel's prompt.
