{
  "title": "Elevated Mode (/elevated directives)",
  "content": "* `/elevated on` runs on the gateway host and keeps exec approvals (same as `/elevated ask`).\n* `/elevated full` runs on the gateway host **and** auto-approves exec (skips exec approvals).\n* `/elevated ask` runs on the gateway host but keeps exec approvals (same as `/elevated on`).\n* `on`/`ask` do **not** force `exec.security=full`; configured security/ask policy still applies.\n* Only changes behavior when the agent is **sandboxed** (otherwise exec already runs on the host).\n* Directive forms: `/elevated on|off|ask|full`, `/elev on|off|ask|full`.\n* Only `on|off|ask|full` are accepted; anything else returns a hint and does not change state.\n\n## What it controls (and what it doesn’t)\n\n* **Availability gates**: `tools.elevated` is the global baseline. `agents.list[].tools.elevated` can further restrict elevated per agent (both must allow).\n* **Per-session state**: `/elevated on|off|ask|full` sets the elevated level for the current session key.\n* **Inline directive**: `/elevated on|ask|full` inside a message applies to that message only.\n* **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.\n* **Host execution**: elevated forces `exec` onto the gateway host; `full` also sets `security=full`.\n* **Approvals**: `full` skips exec approvals; `on`/`ask` honor them when allowlist/ask rules require.\n* **Unsandboxed agents**: no-op for location; only affects gating, logging, and status.\n* **Tool policy still applies**: if `exec` is denied by tool policy, elevated cannot be used.\n* **Separate from `/exec`**: `/exec` adjusts per-session defaults for authorized senders and does not require elevated.\n\n1. Inline directive on the message (applies only to that message).\n2. Session override (set by sending a directive-only message).\n3. Global default (`agents.defaults.elevatedDefault` in config).\n\n## Setting a session default\n\n* Send a message that is **only** the directive (whitespace allowed), e.g. `/elevated full`.\n* Confirmation reply is sent (`Elevated mode set to full...` / `Elevated mode disabled.`).\n* 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.\n* Send `/elevated` (or `/elevated:`) with no argument to see the current elevated level.\n\n## Availability + allowlists\n\n* Feature gate: `tools.elevated.enabled` (default can be off via config even if the code supports it).\n* Sender allowlist: `tools.elevated.allowFrom` with per-provider allowlists (e.g. `discord`, `whatsapp`).\n* Per-agent gate: `agents.list[].tools.elevated.enabled` (optional; can only further restrict).\n* Per-agent allowlist: `agents.list[].tools.elevated.allowFrom` (optional; when set, the sender must match **both** global + per-agent allowlists).\n* Discord fallback: if `tools.elevated.allowFrom.discord` is omitted, the `channels.discord.dm.allowFrom` list is used as a fallback. Set `tools.elevated.allowFrom.discord` (even `[]`) to override. Per-agent allowlists do **not** use the fallback.\n* All gates must pass; otherwise elevated is treated as unavailable.\n\n* Elevated exec calls are logged at info level.\n* Session status includes elevated mode (e.g. `elevated=ask`, `elevated=full`).",
  "code_samples": [],
  "headings": [
    {
      "level": "h2",
      "text": "What it does",
      "id": "what-it-does"
    },
    {
      "level": "h2",
      "text": "What it controls (and what it doesn’t)",
      "id": "what-it-controls-(and-what-it-doesn’t)"
    },
    {
      "level": "h2",
      "text": "Resolution order",
      "id": "resolution-order"
    },
    {
      "level": "h2",
      "text": "Setting a session default",
      "id": "setting-a-session-default"
    },
    {
      "level": "h2",
      "text": "Availability + allowlists",
      "id": "availability-+-allowlists"
    },
    {
      "level": "h2",
      "text": "Logging + status",
      "id": "logging-+-status"
    }
  ],
  "url": "llms-txt#elevated-mode-(/elevated-directives)",
  "links": []
}