Files
openclaw/docs/tools/elevated.md

64 lines
4.0 KiB
Markdown
Raw Normal View History

2026-01-04 05:21:12 +00:00
---
summary: "Elevated exec mode and /elevated directives"
2026-01-04 05:21:12 +00:00
read_when:
- Adjusting elevated mode defaults, allowlists, or slash command behavior
title: "Elevated Mode"
2026-01-04 05:21:12 +00:00
---
2026-01-31 21:13:13 +09:00
2026-01-04 05:21:12 +00:00
# Elevated Mode (/elevated directives)
## What it does
2026-01-31 21:13:13 +09:00
- `/elevated on` runs on the gateway host and keeps exec approvals (same as `/elevated ask`).
2026-01-22 05:32:13 +00:00
- `/elevated full` runs on the gateway host **and** auto-approves exec (skips exec approvals).
- `/elevated ask` runs on the gateway host but keeps exec approvals (same as `/elevated on`).
- `on`/`ask` do **not** force `exec.security=full`; configured security/ask policy still applies.
2026-01-18 04:27:33 +00:00
- Only changes behavior when the agent is **sandboxed** (otherwise exec already runs on the host).
2026-01-22 05:32:13 +00:00
- Directive forms: `/elevated on|off|ask|full`, `/elev on|off|ask|full`.
- Only `on|off|ask|full` are accepted; anything else returns a hint and does not change state.
2026-01-04 05:21:12 +00:00
2026-01-08 22:57:08 +01:00
## What it controls (and what it doesnt)
2026-01-31 21:13:13 +09:00
2026-01-09 20:42:16 +00:00
- **Availability gates**: `tools.elevated` is the global baseline. `agents.list[].tools.elevated` can further restrict elevated per agent (both must allow).
2026-01-22 05:32:13 +00:00
- **Per-session state**: `/elevated on|off|ask|full` sets the elevated level for the current session key.
- **Inline directive**: `/elevated on|ask|full` inside a message applies to that message only.
- **Groups**: In group chats, elevated directives are only honored when the agent is mentioned. Command-only messages that bypass mention requirements are treated as mentioned.
- **Host execution**: elevated forces `exec` onto the gateway host; `full` also sets `security=full`.
- **Approvals**: `full` skips exec approvals; `on`/`ask` honor them when allowlist/ask rules require.
2026-01-18 04:27:33 +00:00
- **Unsandboxed agents**: no-op for location; only affects gating, logging, and status.
- **Tool policy still applies**: if `exec` is denied by tool policy, elevated cannot be used.
- **Separate from `/exec`**: `/exec` adjusts per-session defaults for authorized senders and does not require elevated.
2026-01-04 05:21:12 +00:00
## Resolution order
2026-01-31 21:13:13 +09:00
2026-01-04 05:21:12 +00:00
1. Inline directive on the message (applies only to that message).
2. Session override (set by sending a directive-only message).
3. Global default (`agents.defaults.elevatedDefault` in config).
2026-01-04 05:21:12 +00:00
## Setting a session default
2026-01-31 21:13:13 +09:00
2026-01-22 05:32:13 +00:00
- Send a message that is **only** the directive (whitespace allowed), e.g. `/elevated full`.
- Confirmation reply is sent (`Elevated mode set to full...` / `Elevated mode disabled.`).
2026-01-18 04:27:33 +00:00
- If elevated access is disabled or the sender is not on the approved allowlist, the directive replies with an actionable error and does not change session state.
2026-01-08 03:22:14 +01:00
- Send `/elevated` (or `/elevated:`) with no argument to see the current elevated level.
2026-01-04 05:21:12 +00:00
## Availability + allowlists
2026-01-31 21:13:13 +09:00
- Feature gate: `tools.elevated.enabled` (default can be off via config even if the code supports it).
- Sender allowlist: `tools.elevated.allowFrom` with per-provider allowlists (e.g. `discord`, `whatsapp`).
- Unprefixed allowlist entries match sender-scoped identity values only (`SenderId`, `SenderE164`, `From`); recipient routing fields are never used for elevated authorization.
- Mutable sender metadata requires explicit prefixes:
- `name:<value>` matches `SenderName`
- `username:<value>` matches `SenderUsername`
- `tag:<value>` matches `SenderTag`
- `id:<value>`, `from:<value>`, `e164:<value>` are available for explicit identity targeting
2026-01-09 20:42:16 +00:00
- Per-agent gate: `agents.list[].tools.elevated.enabled` (optional; can only further restrict).
- Per-agent allowlist: `agents.list[].tools.elevated.allowFrom` (optional; when set, the sender must match **both** global + per-agent allowlists).
- Discord fallback: if `tools.elevated.allowFrom.discord` is omitted, the `channels.discord.allowFrom` list is used as a fallback (legacy: `channels.discord.dm.allowFrom`). Set `tools.elevated.allowFrom.discord` (even `[]`) to override. Per-agent allowlists do **not** use the fallback.
2026-01-09 20:42:16 +00:00
- All gates must pass; otherwise elevated is treated as unavailable.
2026-01-04 05:21:12 +00:00
## Logging + status
2026-01-31 21:13:13 +09:00
- Elevated exec calls are logged at info level.
2026-01-22 05:32:13 +00:00
- Session status includes elevated mode (e.g. `elevated=ask`, `elevated=full`).