Skip to content

feat(openclaw-id): protocol for owner reset vouched for by the Gateway key - #193777

Merged
jalehman merged 3 commits into
mainfrom
openclaw/ocid-owner-reset
Nov 6, 2026
Merged

jalehman merged 3 commits into
mainfrom
openclaw/ocid-owner-reset

Conversation

@jalehman

@jalehman jalehman commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Related: Linear OCF-319 (owner reset on the machine). This PR covers only the protocol package. The Gateway, CLI, Control UI, Discovery and loader work follows on the OpenClaw ID stack (#192335 → #192345 → #192352) and in the Discovery and loader repositories.

What Problem This Solves

Today an owner who loses or leaks their recovery kit has no way to take back control of the claw except unlinking and relinking it. The approved design (Josh, 2026-11-02) lets the person at the machine reset owner access. The protocol has to let Discovery and pinned browsers tell a reset the machine vouched for apart from a root substitution.

User Impact

This PR has no user-visible change by itself: no Gateway publishes a reset yet. After the follow-ups ship:

  • A browser pinned before a reset shows a calm "access was reset" state instead of the substitution warning.
  • A forged root change still shows the substitution warning.

Deployment order: Discovery and the loader must update their vendored protocol before any Gateway publishes a reset. Readers built before this change refuse the new descriptor field as malformed, so nothing is half-accepted.

Why This Change Was Made

  • New RootReset { claw_id, new_root_pub, binding_seq, issued_at } statement, signed by K_gw from the binding being replaced. A new R'-signed binding with the same claw, hostname, K_srv and K_gw goes with it. No RootRotation, root epochs or frozen state; root_epoch stays the constant 1.
  • Where the reset travels: an optional descriptor field reset: { previous_root_pub, previous_binding, statement }. A browser pinned to the old root reads only the descriptor before it decides anything, and Discovery stores the descriptor as one row. The Gateway includes reset only with the binding the reset created.
  • verifyRootReset(current, reset, next) is the shared continuity check:
    • signed by current's K_gw, for the same claw;
    • binding_seq strictly increasing;
    • names the served root, which must be new;
    • the new binding is signed by the new root and keeps the hostname, K_srv, K_gw and the reset's binding_seq.
  • Discovery: checkDescriptorRootReset(stored, next) accepts a root change only as a reset from the stored binding (the K_gw Discovery already holds). checkDescriptorConsistency also checks reset when it is present.
  • Pin: verifyBindingForPin returns the new failure code owner_reset for an endorsed reset. It returns no pin, so the browser dials nothing and must be set up again with the new kit. Anything else is still root_mismatch.
    • ClawPin gains an optional k_gw (the K_gw of the last binding verified under the pin), and owner_reset requires the reset's predecessor binding to name that key.
    • Without this, a leaked old kit alone could sign a predecessor binding naming the attacker's own K_gw (found in review).
    • Pins without k_gw (fresh pins, or pins stored before this change) get root_mismatch for any new root.
  • Pre-release in-place extension: RootReset is a new value in envelope v1 and reset is a new field in descriptor v1. docs/versioning.md says this normally needs a new version. It is done in place because v1-draft has not shipped, and the new "Owner reset" section in versioning.md records it.
  • Accepted trade-offs:
    • Whoever holds K_gw (the machine) can reset.
    • A browser that missed two resets, or a reset followed by another binding change, sees root_mismatch and is set up again the same way.
  • Docs: statements.md, discovery.md ("Owner reset"), enrollment.md ("Owner reset" replaces the out-of-scope note), versioning.md, README.md, acceptance.md.

Evidence

  • node scripts/run-vitest.mjs packages/openclaw-id-protocol: 24 files, 169 tests passed.
  • New reset.test.ts:
    • The positive path: Discovery accepts the reset, an old pin gets owner_reset, and a browser set up again with the new kit pins and dials.
    • Nine forgeries that all parse, then fail on the signature or consistency check: wrong signer, tampered signature (bad_signature), other claw, non-increasing binding_seq, another root, binding not signed by the new root, changed K_srv, changed K_gw, binding_seq mismatch. Each gives root_mismatch at the pin.
    • The leaked-old-kit regression.
  • Mutation check:
    • Removing the RootReset signature check fails the tampered-signature case.
    • Removing the pinned-K_gw check fails the leaked-kit case and the pin-without-K_gw vector.
  • Vectors were regenerated with the builder. Existing statements and pin inputs are unchanged. Only two existing expected pins gain k_gw; that is intentional. New entries: one valid reset, two invalid resets, three reset pin checks.
  • pnpm tsgo:core, node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json, oxlint on the package, pnpm format:check on changed files, git diff --check: all clean.
  • Test-lines ratchet passes with the justified allocation config/test-lines-allocations/openclaw-id-owner-reset.txt (199).
  • An independent read-only review found:
    • P0 (fixed): leaked old kit → owner_reset.
    • P2 (fixed): no test reached the RootReset signature check.
  • Gap: no end-to-end proof yet. This PR is protocol-only, and the Gateway, Discovery and loader integration land in follow-ups.

…(OCF-319)

Add the K_gw-signed RootReset statement, the descriptor reset evidence, verifyRootReset, Discovery's checkDescriptorRootReset and the owner_reset pin outcome. Docs, vectors and tests.
A leaked old kit could sign a predecessor binding naming its own K_gw. The pin now keeps the K_gw of the last verified binding, and owner_reset requires the reset's predecessor to name it. Adds tampered-signature and leaked-kit regressions.
…y key

OpenClaw-Publication: fe064e55-b294-47cc-8aa7-0703b3ac443b
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds Gateway-signed owner-reset statements, descriptor continuity checks, and a distinct owner_reset result for previously pinned clients.

Example: A browser pinned to studio-k7x2q.crabd.me at binding_seq 2 receives a Gateway-endorsed replacement root at binding_seq 3.

  • Before: The protocol returns root_mismatch for the replacement root.
  • After: With the previously pinned Gateway key and valid reset evidence, it returns owner_reset without returning a replacement pin.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The protocol implementation is coherent and has focused security coverage, but tests alone do not satisfy the required authority-chain behavior proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Partial
User problem: An owner recovering from a lost or leaked kit needs clients to distinguish a machine-endorsed reset from root substitution.
Reason: The supplied maintainer-authored direction authorizes this protocol stage, and the earlier merged design explicitly anticipated it; the PR correctly uses Related rather than claiming completion of runtime recovery.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open as a coherent protocol stage owned by the existing feature contributor; current main lacks this capability, and inspection found no concrete introduced correctness defect.

Priority: P2
Reviewed head: 20aa6b1f11ae696644a765da1fd4b8bf90fede6f

Before merge

  • Add real behavior proof - Authority-chain proof required: supplied evidence composes real protocol functions with synthetic keys, but does not exercise the Gateway reset producer, Discovery persistence, or loader network boundary; show an authorized local reset, a tunnel caller refused before signing or persistence, and old devices or tokens refused after reset, with the loader opening no connection on owner_reset or forgery, using redacted logs or live output. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security review attention item - No concrete signature or pin bypass was identified, but the new reset authority requires verification at its runtime effects.
  • Resolve merge risk - Before merge, the PR owner must establish that only current machine-local authority can produce an effective reset, including rejection of tunnel callers and invalidation of previously authorized remote access.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied run demonstrates local reset publication, tunnel refusal, old-credential rejection, and loader refusal before dialing; reported mutation checks support the protocol regressions but do not establish those effects.
Agent review details

How this fits together

The private protocol package defines contracts shared by Gateway, Discovery, and browser implementations; it consumes signed bindings, reset evidence, and trusted pins and returns verification results without performing persistence or network effects.

flowchart LR
  A[Gateway reset producer] --> B[Signed reset and new binding]
  B --> C[Discovery continuity check]
  C --> D[Published descriptor]
  D --> E[Browser pin verifier]
  F[Stored root and Gateway key] --> E
  E --> G[Reset refusal or substitution refusal]
Loading

Technical review

Best possible solution:

Keep the shared protocol implementation and complete the machine-local reset integration through the existing Gateway, Discovery, and loader owners.

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

This is a protocol feature rather than a reproduced runtime bug; source comparison confirms that current main treats replacement roots as root_mismatch.

Is this the best way to solve the issue?

The scoped implementation reuses existing parsing, signature, descriptor, and pin owners, with one shared continuity verifier and no unnecessary parallel mechanism identified.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2049dfc8e2d5.

Merge-risk options

Maintainer options:

  1. Prove the complete authority boundary (recommended)
    The PR owner supplies production-path evidence for an allowed local reset, refusal of a tunnel caller, and rejection of old remote credentials after reset.
  2. Keep the protocol stage in draft
    Retain this draft until the reset integrations can exercise the contract through their real owners.

Provenance checked

  • Fixed-root pin and authority contract changes intended behavior with a stated reason (ed57ed7: The initial package removed a nonworking rotation mechanism and deferred Gateway-signed reset until machine-local authority could be established.)
  • Strict descriptor and statement versioning changes intended behavior with a stated reason (ec702e8: Strict version-specific schemas prevent old readers from silently accepting unknown authority restrictions; this PR documents its pre-release exception and deployment ordering.)
  • Portable vectors and acceptance catalog keeps the original intent (ed57ed7: The package provides shared deterministic protocol contracts for consumers in multiple runtimes; added reset vectors extend that purpose.)

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete signature or pin bypass was identified, but the new reset authority requires verification at its runtime effects.

Evidence

What I checked:

PR surface

Source +588, Tests +199, Docs +106, Other +2. Total +895 across 20 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 11 623 35 +588
Tests 2 204 5 +199
Docs 6 138 32 +106
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 20 967 72 +895

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This is a scoped improvement to an unshipped remote-access protocol, with no current user-facing regression established.
  • add merge-risk: 🚨 security-boundary: The contract introduces Gateway-key authority to endorse replacement owner roots across Discovery and browser trust boundaries.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: This is a scoped improvement to an unshipped remote-access protocol, with no current user-facing regression established.
  • merge-risk: 🚨 security-boundary: The contract introduces Gateway-key authority to endorse replacement owner roots across Discovery and browser trust boundaries.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof that a tunnel caller cannot trigger reset and that reset invalidates old remote credentials before further I/O.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 5, 2026, 6:09 PM ET / 23:09 UTC.

@jalehman
jalehman marked this pull request as ready for review November 5, 2026 23:30
@jalehman
jalehman merged commit 46491e1 into main Nov 6, 2026
227 of 229 checks passed
@jalehman
jalehman deleted the openclaw/ocid-owner-reset branch November 6, 2026 00:25
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
…y key (openclaw#193777)

* feat(openclaw-id): verify owner reset vouched for by the Gateway key (OCF-319)

Add the K_gw-signed RootReset statement, the descriptor reset evidence, verifyRootReset, Discovery's checkDescriptorRootReset and the owner_reset pin outcome. Docs, vectors and tests.

* fix(openclaw-id): only the pinned K_gw can vouch for an owner reset

A leaked old kit could sign a predecessor binding naming its own K_gw. The pin now keeps the K_gw of the last verified binding, and owner_reset requires the reset's predecessor to name it. Adds tampered-signature and leaked-kit regressions.

* feat(openclaw-id): protocol for owner reset vouched for by the Gateway key

OpenClaw-Publication: fe064e55-b294-47cc-8aa7-0703b3ac443b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL 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.

1 participant