Elevated Mode
Elevated Mode (/elevated directives)
它做什么
/elevated on在 gateway host 上运行并保持 exec approvals(与/elevated ask相同)。/elevated full在 gateway host 上运行并auto-approves exec(skips exec approvals)。/elevated ask在 gateway host 上运行但保持 exec approvals(与/elevated on相同)。on/ask不 forceexec.security=full;configured security/ask policy 仍然适用。- 仅当 agent 是sandboxed时改变 behavior(否则 exec 已经在 host 上运行)。
- Directive forms:
/elevated on|off|ask|full,/elev on|off|ask|full。 - 仅接受
on|off|ask|full;其他内容返回 hint 且不改变 state。
它控制什么(以及它不控制什么)
- Availability gates:
tools.elevated是 global baseline。agents.list[].tools.elevated可以进一步 per agent 限制 elevated(两者都必须 allow)。 - Per-session state:
/elevated on|off|ask|full为 current session key 设置 elevated level。 - Inline directive:消息中的
/elevated on|ask|full仅适用于该消息。 - Groups:在 group chats 中,elevated directives 仅在 agent is mentioned 时 honored。绕过 mention requirements 的 command-only messages 被视为 mentioned。
- Host execution:elevated forces
execonto the gateway host;fullalso setssecurity=full。 - Approvals:
fullskips exec approvals;on/askhonor them when allowlist/ask rules require。 - Unsandboxed agents:location 的 no-op;仅影响 gating、logging 和 status。
- Tool policy still applies:如果
exec被 tool policy denied,elevated 不能使用。 - Separate from
/exec:/exec为 authorized senders 调整 per-session defaults 且不需要 elevated。
Resolution order
- 消息上的 Inline directive(仅适用于该消息)。
- Session override(通过发送 directive-only message 设置)。
- Global default(config 中的
agents.defaults.elevatedDefault)。
Setting a session default
- 发送仅directive 的消息(允许 whitespace),例如
/elevated full。 - 发送 confirmation reply(
Elevated mode set to full.../Elevated mode disabled.)。 - 如果 elevated access is disabled 或 sender is not on the approved allowlist,directive replies with an actionable error 且不改变 session state。
- 发送
/elevated(或/elevated:)不带 argument 查看 current elevated level。
Availability + allowlists
- Feature gate:
tools.elevated.enabled(默认可以通过 config off 即使 code supports it)。 - Sender allowlist:
tools.elevated.allowFromwith per-provider allowlists(例如discord、whatsapp)。 - Unprefixed allowlist entries 仅匹配 sender-scoped identity values(
SenderId、SenderE164、From);recipient routing fields 从不用于 elevated authorization。 - Mutable sender metadata requires explicit prefixes:
name:<value>matchesSenderNameusername:<value>matchesSenderUsernametag:<value>matchesSenderTagid:<value>、from:<value>、e164:<value>available for explicit identity targeting
- Per-agent gate:
agents.list[].tools.elevated.enabled(optional;can only further restrict)。 - Per-agent allowlist:
agents.list[].tools.elevated.allowFrom(optional;when set,sender must match both global + per-agent allowlists)。 - Discord fallback:如果省略
tools.elevated.allowFrom.discord,channels.discord.allowFromlist 用作 fallback(legacy:channels.discord.dm.allowFrom)。设置tools.elevated.allowFrom.discord(甚至[])来 override。Per-agent allowlists 不 use the fallback。 - All gates must pass;otherwise elevated is treated as unavailable。
Logging + status
- Elevated exec calls logged at info level。
- Session status includes elevated mode(例如
elevated=ask、elevated=full)。