openclaw/docs/tools/elevated.md
Vincent Koc adf0e297b9
docs(tools): fix concrete ux defects in docs/tools (#143856)
* docs(tools): fix concrete ux defects in docs/tools

Works the objectively-checkable subset of the open `ux` audit findings for
`docs/tools/`. Every change below is a thing a reader would otherwise get
wrong, not a restructuring preference.

- goal.md: drop the body `# Goal` that duplicated the frontmatter title and
  rendered a second H1; keep the `#goal` anchor as an `<a id>` stub.
- steer.md: state in the intro that `/tell` is an alias of `/steer`. The
  alias appeared in a code sample before the page ever named it
  (`src/auto-reply/commands-registry.shared.ts:412`).
- kimi-search.md: add the missing `openclaw plugins install
  @openclaw/moonshot-provider` step. `moonshot` is an external package
  (plugin-inventory "Official external packages"), so the documented setup
  could not work as written.
- grok-search.md: say that the `xai` plugin ships with OpenClaw and needs no
  install, since every sibling provider page opens with an install step.
- searxng-search.md, diffs.md: add `openclaw gateway restart` to the install
  fence, matching duckduckgo, exa, firecrawl, lobster, parallel and
  perplexity.
- ollama-search.md: the hosted setup told readers to point
  `models.providers.ollama.baseUrl` at ollama.com without saying that this
  also moves their Ollama *model* traffic. Name the side effect and point at
  the page's own scoped `webSearch.baseUrl` alternative.
- reactions.md: define `clearAll` and `emoji-list`, both used in the channel
  sections but never introduced.
- browser-linux-troubleshooting.md: the verify step jumps from CDP port 18800
  to 18791 with no explanation; say it is the browser control service port
  derived from `gateway.port`, and that `jq` is optional. Promote the second
  `Problem:` heading from H3 to H2 so it stops reading as a sub-part of the
  first (anchor id unchanged).
- apply-patch.md: `*** Move to:` and `*** End of File` were named in Notes but
  never shown. Extend the format block with both; the block now applies
  cleanly against the real `apply_patch` implementation.
- exec.md: fill the one empty Notes cell in the config table
  (`tools.exec.node`).
- permission-modes.md: say what `openclaw approvals get` prints and why it is
  in the recommended-default sequence.
- code-mode/internals.md: give the Runtime status table real header labels
  instead of an empty header row.
- screen.md: say how a client advertises the `ui-commands` capability.
- elevated.md: tag two directive fences as `text` (5 of 478 docs/tools fences
  were untagged; MD040 is disabled so the linter does not catch it).

No anchor ids were dropped: ids enumerated with `parseDocsDocument` before and
after across all 15 files; the only delta is one new Steps id in
kimi-search.md.

* docs(tools): address ClawSweeper review

Both findings were correct.

- screen.md: the connect handshake field is `caps`, not `capabilities`
  (`packages/gateway-protocol/src/schema/frames.ts:46`;
  `ui/src/api/gateway.ts:476`). A client following the old wording would not
  advertise the capability.
- reactions.md: the `emoji-list` gate and result are channel-specific, not
  shared. Telegram gates `react` and `emoji-list` together under
  `actions.reactions` and returns the current chat's allowed reactions
  (`extensions/telegram/src/channel-actions.ts:160-162`), while Slack gates
  `emoji-list` separately under `actions.emojiList`
  (`extensions/slack/src/message-actions.ts:64`). The How it works bullet now
  only defines what the action is and says both vary by channel; the Telegram
  specifics moved into the Telegram accordion.
2026-09-10 16:19:50 +08:00

6.1 KiB

summary read_when title
Elevated exec mode: run commands outside the sandbox from a sandboxed agent
Adjusting elevated mode defaults, allowlists, or slash command behavior
Understanding how sandboxed agents can access the host
Elevated mode

When an agent runs inside a sandbox, its exec commands are confined to the sandbox environment. Elevated mode lets the agent break out of ordinary agent-configured sandboxing and run commands outside the sandbox instead, with configurable approval gates. Sessions whose creator role requires sandboxing cannot use elevated mode to escape.

Elevated mode only changes behavior when the agent is **sandboxed**. For unsandboxed agents, exec already runs on the host.

Directives

Control elevated mode per-session with slash commands:

Directive What it does
/elevated on Run outside the sandbox on the configured host path, keep approvals
/elevated ask Same as on (alias)
/elevated full Run outside the sandbox on the configured host path and skip approvals when the mode/host approval policy is already permissive
/elevated off Return to sandbox-confined execution

Also available as /elev on|off|ask|full.

Send /elevated with no argument to see the current level.

How it works

Elevated must be enabled in config and the sender must be on the allowlist:
```json5
{
  tools: {
    elevated: {
      enabled: true,
      allowFrom: {
        discord: ["user-id-123"],
        whatsapp: ["+15555550123"],
      },
    },
  },
}
```
Send a directive-only message to set the session default:
```text
/elevated full
```

Or use it inline (applies to that message only):

```text
/elevated on run the deployment script
```
With elevated active, `exec` calls leave the sandbox. The effective host is `gateway` by default, or `node` when the configured/session exec target is `node`. In `full` mode, exec approvals are skipped when the resolved exec mode/host approval policy is already fully permissive (security `full`, ask `off`); otherwise the normal approval policy still applies. In `on`/`ask` mode, configured approval rules always apply.

Resolution order

  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)

Availability and allowlists

  • Global gate: tools.elevated.enabled (must be true)
  • Sender allowlist: tools.elevated.allowFrom with per-channel lists
  • Per-agent gate: agents.entries.*.tools.elevated.enabled (can only further restrict; both the global and per-agent gate must be true)
  • Per-agent allowlist: agents.entries.*.tools.elevated.allowFrom (sender must match both global + per-agent)
  • Channel-provided fallback allowlist: channel plugins can optionally supply a fallback allowlist through an SDK adapter hook, used when tools.elevated.allowFrom.<provider> is not configured. No bundled channel currently implements this hook, so in practice every provider needs an explicit tools.elevated.allowFrom.<provider> entry today.
  • All gates must pass; otherwise elevated is treated as unavailable

Allowlist entry formats:

Prefix Matches
(none) Sender ID, E.164, or From field
name: Sender display name
username: Sender username
tag: Sender tag
id:, from:, e164: Explicit identity targeting

What elevated does not control

  • Tool policy: if exec is denied by tool policy, elevated cannot override it.
  • Required role sandboxing: if the authenticated session creator's operator role required a sandbox, elevated mode cannot run commands on the Gateway or a node.
  • Host selection policy: elevated does not turn auto into a free cross-host override. It uses the configured/session exec target rules, choosing node only when the target is already node.
  • Separate from /exec: the /exec directive adjusts per-session exec defaults (host, security, ask, node) for authorized senders and does not require elevated mode.
The bash chat command (`!` prefix; `/bash` alias) is a separate gate that requires `tools.elevated` to be enabled in addition to its own `tools.bash.enabled` flag. Disabling elevated locks `!` shell commands out as well. Shell command execution from the agent. Approval and allowlist system for `exec`. Gateway-level sandbox configuration. How the three gates compose during a tool call. Per-agent sandbox and tool limits. The reasoning budget an elevated run uses.