Skip to content

docs: propose plugin-owned external verification approvals#15

Merged
kevinlin-openai merged 4 commits into
openclaw:mainfrom
Guardiola31337:rfc/plugin-owned-external-verification-approvals
Jul 24, 2026
Merged

docs: propose plugin-owned external verification approvals#15
kevinlin-openai merged 4 commits into
openclaw:mainfrom
Guardiola31337:rfc/plugin-owned-external-verification-approvals

Conversation

@Guardiola31337

@Guardiola31337 Guardiola31337 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

External plugins sometimes need a user to complete a verifier-specific ceremony before a protected tool can continue. OpenClaw should own approval state, denial, expiry, cancellation, and tool continuation, while the plugin owns the verifier and proof.

The first concrete user is the external AgentKit plugin:

Why This Change Was Made

This RFC proposes one narrow external-verification route on a plugin-owned approval:

  • requireApproval.externalResolution carries a verifier label and canonical allow decisions, defaulting to allow-once
  • core derives plugin ownership and the originating run from the registered hook; the public caller-identified request path cannot create these approvals
  • approval creation, run abort, attempt replacement, and completion are serialized so late proof cannot resume a cancelled run or authorize a grant
  • external actions use a stable authenticated interaction identity; native retries are core-issued and bound to the active attempt, so redelivery, stale clicks, and double clicks are idempotent
  • the owning plugin receives an in-process verifier handler, an AbortSignal, a text-only challenge sink, and an attempt-scoped completion helper
  • graceful shutdown cancels live plugin work; startup reconciliation closes orphaned durable state before accepting dispatch or completion
  • successful completion goes through the canonical first-answer ledger, and verification lifecycle metadata is audited without storing proof payloads in core

This does not add arbitrary plugin actions, a public plugin resolver RPC, operator.admin authority, World-specific core code, new auto-review authority, or fields on ordinary approval.resolve calls.

User Impact

If accepted and implemented, a user can choose Verify once, Verify and trust for session, or Deny from the normal OpenClaw approval flow. The plugin can show its QR/link and attest successful verification, but only OpenClaw can commit the terminal decision and resume the original tool call.

Evidence

  • rebased on openclaw/rfcs main at 13819ef
  • reviewed against OpenClaw main at c4f1661f70738c65cb05716d7a438e58090706de
  • git diff --check origin/main...HEAD
  • structured contract review completed after exercising run-abort creation races, completion races, multi-client replay/retry behavior, shutdown/restart handling, and grant idempotency; final review reported no actionable findings

The RFC defines host contract tests, AgentKit integration tests, and a manual user-flow artifact as implementation acceptance criteria. Current OpenClaw main does not implement this API, so runtime proof belongs to the implementation PR and updated AgentKit release rather than being claimed by this document-only proposal.

Related implementation context:

@Guardiola31337
Guardiola31337 force-pushed the rfc/plugin-owned-external-verification-approvals branch from 636a8b2 to 49f2895 Compare June 15, 2026 14:58
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 9:35 PM ET / July 17, 2026, 01:35 UTC.

Summary
Adds a 697-line draft RFC defining a plugin-owned external-verification path while retaining OpenClaw ownership of approval state, terminal decisions, auditing, and protected-tool continuation.

Reproducibility: not applicable. this is a design proposal for a new plugin and approval capability, not a report of broken existing behavior. Source and current documentation instead confirm that the proposed external-resolution seam is not implemented today.

Review metrics: 1 noteworthy metric.

  • RFC scope: 1 file, 697 lines added. A single document defines a substantial new approval and plugin API contract that warrants focused ownership review.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach redacted live proof against the revised registration-derived and attempt-bound contract.
  • Obtain explicit approval/API security-owner acceptance of the permanent plugin authority boundary.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The revised contract has no after-change live proof; add a redacted terminal capture, logs, linked artifact, or short recording showing allow-once, session trust, denial, external verification, and resumed execution, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review; redact keys, IP addresses, phone numbers, private endpoints, and other sensitive data.

Risk before merge

  • [P1] Accepting the RFC establishes a compatibility-sensitive plugin API contract; minimum-host registration behavior and legacy-client fail-closed behavior must remain explicit.
  • [P1] The proposed verifier can influence whether a protected action resumes, so registration-derived identity, attempt binding, denial precedence, replay behavior, and grant idempotency are security-boundary requirements rather than implementation details.
  • [P1] No live artifact demonstrates the revised contract; the older prototype used materially different authority and resolver semantics.

Maintainer options:

  1. Require owner review and aligned proof (recommended)
    Keep the RFC draft until an approval-boundary owner accepts the contract and a current prototype proves the proposed registration, legacy-client, denial, and replay behavior.
  2. Accept the design with an explicit proof override
    A maintainer may accept the specification before implementation while explicitly owning the unproven compatibility and security assumptions.
  3. Pause the core API direction
    Close or defer the RFC if maintainers do not want external verifier attestations to become part of the core plugin contract.

Next step before merge

  • [P1] An approval-boundary owner must decide the durable plugin authority and compatibility contract; there is no narrow automated repair to dispatch.

Maintainer decision needed

  • Question: Should OpenClaw accept this registration-derived, attempt-bound plugin attestation contract as the permanent core seam for external approval verification?
  • Rationale: The RFC deliberately lets plugin code attest an external ceremony that can unblock protected execution; automation cannot choose that durable trust and compatibility boundary.
  • Likely owner: kevinslin — They are actively reviewing the exact API, compatibility, and approval semantics that require a human decision.
  • Options:
    • Validate and accept the narrow seam (recommended): Keep the revised ownership model, require approval-boundary review plus prototype-aligned proof, and accept the RFC once those checks confirm the contract.
    • Require a prototype before acceptance: Leave the RFC in draft until a current implementation demonstrates the revised identity, compatibility, replay, and denial semantics.
    • Reject external resolution in core: Keep plugin approvals limited to existing decisions and require external verifiers to use a separate plugin-owned workflow without protected-call continuation.

Security
Needs attention: The document adds no executable supply-chain surface, but its proposed verifier authority is a security boundary requiring explicit owner acceptance.

Review details

Best possible solution:

Finalize a narrow core-owned approval contract after approval/security-owner review, then implement it against the open OpenClaw tracker with compatibility tests and a redacted end-to-end AgentKit demonstration covering verification, denial, expiry, replay, and resumed execution.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a design proposal for a new plugin and approval capability, not a report of broken existing behavior. Source and current documentation instead confirm that the proposed external-resolution seam is not implemented today.

Is this the best way to solve the issue?

Unclear pending maintainer approval. The core-owned ledger and registration-derived plugin identity are a maintainable direction, but the permanent authority contract, compatibility policy, and implementation proof require approval-boundary owner judgment.

AGENTS.md: not found in the target repository.

Codex review notes: model internal, reasoning high; reviewed against 2d213ae23462.

Label changes

Label justifications:

  • P2: This is a bounded but significant plugin API and approval-flow proposal with active review and no current production regression.
  • merge-risk: 🚨 compatibility: The RFC formalizes new registration requirements, decisions, and legacy-client behavior that future plugins and hosts would depend on.
  • merge-risk: 🚨 security-boundary: The proposed contract allows a plugin-owned verifier attestation to participate in unblocking a protected action.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The revised contract has no after-change live proof; add a redacted terminal capture, logs, linked artifact, or short recording showing allow-once, session trust, denial, external verification, and resumed execution, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review; redact keys, IP addresses, phone numbers, private endpoints, and other sensitive data.
Evidence reviewed

Security concerns:

  • [high] Confirm the plugin attestation authority boundary — rfcs/0011-plugin-owned-external-verification-approvals.md:14
    A successful plugin attestation can cause core to allow and resume protected execution, so registration-derived identity, attempt-specific binding, denial precedence, replay handling, and idempotency must be accepted as normative requirements before the RFC lands.
    Confidence: 0.94

What I checked:

  • Unique proposal is absent from target main: The current target main tree at 2d213ae23462d425c84d0fd4ff8727f571b46602 does not contain RFC 0011 or an equivalent external-verification approval RFC, so the branch remains materially necessary. citeturn289469view0. (2d213ae23462)
  • Current branch contract: The latest branch revision derives plugin ownership from registration, binds verification to a host-issued attempt, preserves canonical first-answer semantics, audits verification lifecycle metadata, and fails unsupported clients closed. (rfcs/0011-plugin-owned-external-verification-approvals.md:14, 7adb5b756498)
  • Active maintainer review: The July 15 review requested registration-derived ownership, explicit deny precedence, minimum-version handling, existing decision semantics, lifecycle auditing, and a default decision; the contributor updated the branch on July 16 rather than abandoning it. (rfcs/0011-plugin-owned-external-verification-approvals.md:1, 7adb5b756498)
  • Existing capability is narrower: Current OpenClaw documentation describes plugin permission requests and core-managed approval records, but not a plugin verifier that can attest an external ceremony and resume the protected action. citeturn798385view0. (docs/plugins/plugin-permission-requests.md:61)
  • Earlier implementation is not a safe substitute: The closed implementation attempt used a caller-supplied pluginId and operator.admin resolver, while the revised RFC explicitly rejects those authority choices; it therefore does not supersede the current proposal. (rfcs/0011-plugin-owned-external-verification-approvals.md:14, 7adb5b756498)
  • Feature history provenance: OpenClaw's existing plugin approval flow appears to date to 6ade7354164e99ad551290f6c78e5aa2ffdc7566, with later gateway authorization work in 60d74564954cc5d44100c170a95e4ffb265f8af8 and 6356622f8513bde72ae3450231989e2c5a626c64. (src/plugins/approval.ts:109, 6ade7354164e)

Likely related people:

  • kevinslin: Provided the most recent detailed review of plugin identity, deny precedence, client compatibility, decision semantics, and audit requirements for this exact RFC. (role: reviewer; confidence: high; files: rfcs/0011-plugin-owned-external-verification-approvals.md)
  • joshavant: Introduced the existing OpenClaw plugin approval flow that this RFC proposes to extend. (role: introduced behavior; confidence: high; commits: 6ade7354164e; files: src/plugins/approval.ts, src/plugins/approval-ledger.ts, src/gateway/server-methods/plugin-approvals.ts)
  • steipete: Recent gateway authorization and plugin approval dispatch work is directly adjacent to the proposed authority boundary. (role: adjacent owner; confidence: high; commits: 60d74564954c, 6356622f8513; files: src/gateway/server-methods/plugin-approvals.ts, src/gateway/server-methods/agent.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (5 earlier review cycles)
  • reviewed 2026-06-27T16:33:57.324Z sha 9e953e4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-06T19:23:30.895Z sha 9e953e4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-07T21:18:12.722Z sha 9e953e4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-16T20:09:56.790Z sha ed4a450 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-17T00:54:24.641Z sha 7adb5b7 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 15, 2026

@kevinslin kevinslin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rfcs should be high signal - please take a human pass through it and remove noise that doesn't need to be in here

6. AgentKit resolves its own pending approval.
7. OpenClaw continues the original blocked tool call.

The first AgentKit attempt put World ID HITL directly in OpenClaw core:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this in the rfc - motivation should just be that certain plugins like worldcoin need ability to handle approvals

approval flows.
- Letting auto review approve an external-proof-required approval without the
external proof.
- Designing durable chat status cards in this RFC. Those are useful but should

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated to plugin owning verification. we don't need it here. could we do a human pass and avoid slop in rfcs as much as possible?

- it can classify whether the underlying command/tool call is risky
- it can explain why the action should be denied or escalated
- it can decline and fall back to the human operator
- it can include `externalVerificationRequired: true` in any bounded review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean auto review can move an approval to the external verification lane? that would require a change to autoreview

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified 👍 tl;dr no auto review change is required

- channel-delivered approval prompts
- opt-in auto mode for lower-risk exec approval review

The safer-auto-mode blog frames the current direction well:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not reference a blog without any links. its also not necessary to call this out in the rfc since this is about plugin approval, not auto review


## Unresolved Questions

- Should verified resolution use the existing `operator.approvals` scope, or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should answer these questions instead of leaving them open unless they are truly unresolvable rigth now

@Guardiola31337
Guardiola31337 force-pushed the rfc/plugin-owned-external-verification-approvals branch from 49f2895 to 9e953e4 Compare June 27, 2026 16:18
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 27, 2026
@Guardiola31337

Copy link
Copy Markdown
Contributor Author

hey @kevinslin, sorry for the delay, i was traveling and just caught up.

rebased this on latest main and tightened it based on your feedback: motivation is now focused on the plugin-owned external verification need, removed the auto-mode/status-card/history noise, clarified that no autoreview change is required, and made the resolver authority explicit (operator.approvals, no operator.admin requirement for external plugin helpers).

would you mind giving it another pass when you have a chance? also happy to move the discussion somewhere else if that would be better.

@Guardiola31337

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@kevinslin

Copy link
Copy Markdown
Contributor

this is coming together. lets tighten it and make sure important behavior is specified

  • plugin should not be caller provided - this allows claiming any plugin id
  • the approval logic should be explicitly spelled out and should be AND (any DENY on approval path should result in DENY)
  • older openclaw clients won't be able to support new format and will only show DENY option
    • we should have a min openclaw version and not register plugin if client doesn't support new format
  • unless there is a good reason, we should stick with current semantics for approvals (allow-always, allow-session) - this should map on to existing implementation details
  • for auditing, we should send when verification started and ended back to openclaw - currently not in the api
  • externalResolution.decisions has no default - should specify one (eg. allow-once)

@Guardiola31337
Guardiola31337 force-pushed the rfc/plugin-owned-external-verification-approvals branch from 9e953e4 to ed4a450 Compare July 16, 2026 20:04
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 16, 2026
@Guardiola31337 Guardiola31337 changed the title Plugin-owned external verification approvals docs: propose plugin-owned external verification approvals Jul 17, 2026
@kevinlin-openai

Copy link
Copy Markdown
Contributor

Some callouts from codex:

[P1] Bind cancellation to the originating run. The RFC promises run cancellation defeats late verification, but its immutable context omits runId and never defines the abort-to-approval cancellation path. Current plugin approval requests omit run identity, while Gateway abort handling targets only exec approvals (src/gateway/server-aux-handlers.ts:153). A late proof could therefore win and authorize a reusable grant after the originating run stopped. Add a host-derived run binding, atomic approval/attempt cancellation, and concurrent-run race tests.
[P1] Define identity for replay versus retry. The RFC distinguishes duplicate delivery of one action from an explicit retry, but neither the typed action nor /approve … external … command defines the stable invocation identity used to distinguish them. Current canonical resolution carries only {id, kind, decision} (packages/gateway-protocol/src/schema/approvals.ts:245). Require a host-derived interaction/message ID: duplicate IDs return the existing attempt; explicit retry gets a new ID and cancels the old attempt.
[P2] Give background verifier work a cancellation signal. The plugin starts polling or callback work and returns, but core can subsequently terminate the attempt through retry, denial, expiry, cancellation, competing resolution, or shutdown. State rejection prevents a late allow, but nothing tells the plugin to stop polling or prevents stale progress output. Add an AbortSignal or terminal callback and invalidate the presentation sink.

@Guardiola31337
Guardiola31337 force-pushed the rfc/plugin-owned-external-verification-approvals branch from 7adb5b7 to 4481068 Compare July 21, 2026 18:47
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: docs: propose plugin-owned external verification approvals This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@Guardiola31337

Copy link
Copy Markdown
Contributor Author

Thanks for the follow-up @kevinlin-openai! Addressed all three callouts in 4481068, rebased on latest main and refreshed the PR's description, ready for another 👀 when you have a chance!

@kevinlin-openai
kevinlin-openai marked this pull request as ready for review July 24, 2026 23:23

@kevinlin-openai kevinlin-openai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepted as a design RFC. Runtime behavior proof remains an implementation requirement tracked in openclaw/openclaw#82336.

@kevinlin-openai
kevinlin-openai dismissed kevinslin’s stale review July 24, 2026 23:24

Superseded by the revised RFC and maintainer approval on head 4977cbf.

@kevinlin-openai
kevinlin-openai merged commit d380c05 into openclaw:main Jul 24, 2026
@Guardiola31337
Guardiola31337 deleted the rfc/plugin-owned-external-verification-approvals branch July 25, 2026 01:03
@Guardiola31337

Copy link
Copy Markdown
Contributor Author

Implementation of the accepted contract is now ready for review:

The PRs implement the RFC’s deny-only generic resolution boundary, host-stamped plugin attempt ownership, verifier presentation/completion split, revision-bound retries, first-answer-wins resolution, durable proof-free audit state, lifecycle cancellation, exact session/tool grants, and signed one-use delegation over pinned TLS.

Hosted final-SHA proof:

The real local Gateway scenarios covered the accepted human and delegation flows. The remaining caveat is that the human World transport was deterministic/mocked rather than a physical World App/manual scan; that limitation is recorded in both PRs and the tracker.

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

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants