Skip to content

Exec approvals: human sign-off for risky agent commands #58

Open

Description

@melvincarvalho

openclaw's approvals subsystem pauses dangerous exec calls until the operator approves (CLI + gateway methods + events). For jsclaw this is the natural complement to sandboxMode 'off'/#42's posture flip: unsandboxed agents become defensible when bash calls matching deny-patterns wait for a thumbs-up via gateway event (webchat/TUI/channel prompt). Scope: approval policy config, runner-side gate (agent-micro tool layer + default runner), approval.requested/resolved events, openclaw-shaped methods for #46.

Activity

  1. melvincarvalho commented on Jun 11, 2026

    @melvincarvalho
    ContributorAuthor

    Audit (2026-06-12) — two sources: openclaw's implementation + WAC 2.0's principles

    openclaw's approvals subsystem (from the shipped dist)

    Large — most of it is channel-delivery/native-routing machinery — but the core is small:

    • Gate point: a before-tool-call hook intercepts every tool invocation before it runs; policy resolves to allow / deny / ask. Config carries approvalPolicy (e.g. "auto" short-circuits, no prompt).
    • RPC family exec.approval.*: request, requested (event pushed to clients), get, list, resolve, resolved (event), wait. A pending approval carries a reason.
    • Surfaces: /approve slash command and an elevated command; approvals route to channels (reactions on Telegram, native prompts) — the same broadcast path our heartbeat alerts already use.
    • Decision verbs: approve / deny.

    WAC 2.0 / Secure Access Conditions (webacl.org/secure-access-conditions) — the principles

    WAC 2.0 adds acl:Condition (acl:ClientCondition/acl:IssuerCondition) and explicitly defines no approvals, obligations, or human-in-the-loop — it leaves exactly the seam approvals fill. Its evaluation principles are the right defaults for an approval gate:

    • Fail-closed: unrecognized condition/mode/missing policy → deny. (Unknown command pattern → ask, never silently allow.)
    • Monotonic: conditions only ever restrict, never widen access.
    • Conjunctive: all conditions must pass.

    This also connects to JavaScriptSolidServer/JavaScriptSolidServer#338 (secure-access-conditions deny semantics) — a jsclaw approval policy expressed in WAC-adjacent terms would let a pod-resident agent's gating speak the same vocabulary as the pod's own ACLs.

    jsclaw mapping — why now

    The risk is concrete and current: Scuttle runs unsandboxed (bash as the host user), reachable from Telegram + Nostr, with an MCP client that pulls in external content, and (once HEARTBEAT.md lands) acting on a timer unwatched. Prompt injection through any inbound channel reaches a real shell. Approvals are the guardrail that makes the unsandboxed/autonomous default defensible — the complement to sandboxMode (#42).

    PoC scope

    1. Policy in config: approvals: { mode: "auto"|"ask"|"deny", rules: [{ tool, match, decision }] } — fail-closed default for dangerous tools (bash matching destructive patterns, writes outside the agent folder, network to new hosts), auto for the safe majority. Monotonic: rules only restrict.
    2. Gate at the single injection point — runContainerAgent already wraps every run (the same place skills/sessions hook), so it's runner-agnostic. A pending tool call pauses, emits an approval request.
    3. Surface: broadcast an approval.requested event (gateway clients) and deliver to the agent's channel (reply yes/no, or /approve <id>); resolve with a timeout that denies on expiry (fail-closed).
    4. MCP: the permissions_* tools deferred on Gateway as MCP server: agents and sessions as tools over Streamable HTTP #73 (exec.approval.list/resolve) so an operating host can clear approvals.
    5. Per-agent: trusted main agent may run mode: auto; channel/visitor agents default ask.

    Dependencies / deferred

    • Pairs with completing heartbeat (verify a cycle fires + write HEARTBEAT.md) — an autonomous agent is the strongest argument for the gate, and the riskiest thing to run without it.
    • Deferred: openclaw's full channel-reaction routing, elevated/escalation levels, approval persistence across restarts, the WAC-RDF expression of policy (start with plain config; the acl: vocabulary is a later interop bridge to #338).

    Power-user note

    Before this ships, the interim guardrail for dogfdooding Scuttle autonomously is keeping channel allowFrom tight (operator only) — which it already is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions