# No Elevated Mode

How a call that reaches outside the safe boundary is authorized one call at a time, and when the system password is required.

There is no `/sudo` command and no session-wide escalation. The `/dangerous` command was removed; use the per-call confirmation below or the direct TUI actions. Per-request authorization replaced both: a call that reaches outside the safe boundary raises a confirmation for that one call, and the grant is scoped to that session plus that specific path.

`$HOME` is writable with no setup, except `~/.config/agenvoy`, which is read-only since v1.5.0 (see [Permanent denials](/security-denials#permanent-denials)). Under `auto`, a write inside `$HOME` but outside the working directory asks once (see [Permission Modes](/security-permissions-modes)). These sit outside it:

| Case | What happens |
|---|---|
| A sensitive path inside `$HOME` | `boundary.Restricted` collects it and raises a plain confirmation (no password), in every permission mode except a trusted Skill (v1.3.22), which runs it and grants the path. Approval grants that path for that session |
| A path outside `$HOME` | `boundary.Restricted` collects it and raises a confirmation that also requires the operating-system password, in every permission mode except a trusted Skill (v1.3.22) (before v1.3.7 `auto` rejected it without a prompt). Approval grants that path for that session. Since v1.3.10 `read_files` and `find_files` skip the prompt for paths on the readable list (built-in system and package locations plus `readable_path`) |
| A command that has to write outside `$HOME` | The agent attaches `write_paths` to that one `run_command` or `background_command` call; those paths are bound into the sandbox only after the same password-backed prompt is approved |
| A command the sandbox blocks for reasons `network` and `write_paths` cannot fix | Since v1.3.0 the call may set `sandbox: false` to run outside the sandbox with the user's full permissions. It always raises the password-backed prompt — allow rules and `auto` do not skip it; since v1.3.22 a trusted Skill does — and runs only once the password is verified; the confirmation is labelled `outside sandbox: <cmd>` |
| A command that needs root | Since v1.3.2 the call passes argv `['sudo', '<binary>', ...]`. It raises a confirmation labelled `sudo: <cmd>` that always demands the system password, in every permission mode including a trusted Skill, and allow rules never skip it; after approval it runs as `sudo -n <binary> ...` outside the sandbox on the sudo ticket |

Password checks live in one place, `internal/sudo`: `sudo -n -v` probes whether a sudo ticket is still cached (3 s limit), and `sudo -S -v` verifies a typed password (30 s limit). The sudo ticket is the only clock — there is no second TTL. While it is still cached the prompt appears without a password field, and a root daemon skips the check.

The TUI and the local web dashboard can collect the password; the web confirm endpoint accepts a restricted approval only from a loopback connection, also while LAN access is on. Since v1.2.0 the TUI no longer runs `sudo -v` itself: the password is typed into the TUI's password field, sent to the daemon with the reply, and verified there with `sudo -S -v`; the confirmation goes only to the TUI window that started the run. Channels that cannot collect one never elevate: since v1.3.3 Telegram and Discord restricted prompts offer no **Yes** and point to the TUI or Web UI on this machine, and a remote HTTP approval gets 403 while the dashboard keeps the card and shows the error (before v1.3.3 such a channel could approve and the call came back **skipped**). Since v1.3.3 a wrong password keeps the prompt open for another try, and restricted prompts drop **don't ask again** and **allow this turn**.

Since v1.3.2 `run_command` and `background_command` accept `sudo` only in that argv form: no sudo flags, no nested `sudo` / `su`, and the target must be a bare binary not on `denied_command`. `sudo` inside `sh -c` is still rejected, with an error pointing to the argv form. `sudo rm` deletes for real, while a plain `rm` still moves to the trash. `pkg_manage` was dropped (Removed in v1.3.2): system packages go through `run_command`, with `['sudo', <package manager>, ...]` on Linux, or `brew` with `sandbox: false` on macOS (never `sudo` with `brew`).

The `run_command` sandbox constrains writes, not reads, so a command fails on a path only when the operating system itself refuses. The file tools (`read_files`, `find_files`, `open_file`, `file_history`, and since v1.5.2 the file paths of a multipart `http_request`) still raise the password-backed confirmation before reading outside `$HOME` (since v1.3.10 `read_files` and `find_files` skip it for paths on the readable list) and a plain confirmation before reading a sensitive path, and `denied_path` rejects reads as well as writes. Approved paths are held in daemon memory per session, so a grant lasts until the daemon restarts.
