Skip to content

Response: Simplifying Client Revocation

In reply to docs/superpowers/specs/2026-11-24-revocation-problem.md on wip/bootstrap-design.


1. Threat-Model Reality Check: Secure Enclave Keys Cannot Roll Back With a Machine Backup

The six roborev rounds chased variations of "the laptop is restored from an old backup while keeping the same owner.pub."

With the recommended Secretive .biometryCurrentSet Secure Enclave key:

  • A full-laptop restore (Time Machine, Migration Assistant, replaced Mac, wiped OS) never restores the owner key. Secure Enclave private keys are hardware-bound and non-exportable. Restoring a laptop always requires creating a new owner key in Secretive, running allmyram init, and rejoining runners under a new owner.pub, which cleanly resets state on every runner.
  • Because allmyram talks only to SSH_AUTH_SOCK (no direct Keychain/cgo state) and Secretive speaks plain ecdsa-sha2-nistp256 (no hardware signature counter, unlike FIDO2 sk-ecdsa-* keys), the only ways ~/.config/allmyram can go backwards under the same owner.pub are:
  • manually restoring just the ~/.config/allmyram directory onto the same live Mac whose Secure Enclave still holds the key, or
  • choosing a cloud-synced software agent (e.g., 1Password) instead of Secretive.

Even for those two narrow cases, we do not need version counters, cross-runner reconciliation, "re-pinned" flags, or fingerprint re-pin prompts.


2. Root Cause of the State-Machine Explosion

Signing a whole-set snapshot with an integer version counter conflates granting and revoking inside one mutable number on disk:

  1. If local files roll back (v5 -> v2), runners at v5 reject v3 unless you add multi-runner version discovery.
  2. Worse, bumping the version above v5 from stale local files re-signs the stale positive list, turning state recovery into an accidental un-revocation — which forced all six patches (unpinned logs, re-pinned markers, multi-runner set intersection, join-time reconciliation).

Drop the versioned PinnedSet completely. Split positive enrollment from revocation so state only ever merges by set union (\(A \cup B\)):

A. Positive Grant: Per-Key ClientPin Carried on the Client Certificate (Zero Runner State)

  • When allmyram init (or pin / rotate-client-key) enrolls a client SSH public key K, the owner key signs a one-time, domain-separated grant:
    "allmyram-client-pin-v1\x00" || ssh.Marshal(owner.pub) || ssh.Marshal(K)
    
  • The laptop verifies the agent's returned signature against owner.pub, saves ClientPin(K) beside the client key, and embeds ClientPin(K) in an extension on client-cert (right alongside the day-key certificate extension).
  • Runners store no pinned-keys list at all. Adding or rotating to a new client key requires no push to runners before the new key works.

B. Revocation: Permanent Per-Key Tombstone (2P-Set CRDT)

  • Revoking a key K asks the owner key to sign a single (~130-byte) domain-separated tombstone:
    "allmyram-revoke-v1\x00" || ssh.Marshal(owner.pub) || ssh.Marshal(K)
    
  • Revocation is permanent under a given owner.pub. There is no "un-revoke" or "re-pin" operation anywhere in the protocol. Ed25519 keys are free random numbers; if a key was revoked, generate a fresh key pair.
  • Both the laptop and each runner store a flat, deduplicated set of owner.pub-verified tombstones (keyed by ssh.Marshal(K), capped at e.g. 256 tombstones / 64 KiB io.LimitReader).
  • If the 256-tombstone cap is ever reached under a single CA, allmyram init with a new owner key + --join resets the slate cleanly.
  • Runner check (at SSH handshake and on open connections):
  • client-cert is valid now and signed by dayCert.Key;
  • day-cert is valid now (within the 24h ceiling) and signed by owner.pub;
  • ClientPin is signed by owner.pub for owner.pub and clientCert.Key;
  • Neither clientCert.Key nor dayCert.Key is in the runner's tombstone set.
  • When a new tombstone arrives on a runner, sshsrv records it atomically (under the same mutex that registers active connections) and immediately cancels/closes any open connection whose clientCert.Key or dayCert.Key matches.

C. Delivery & Sync: Plain Set Union, Zero Version Counters

  • revoke <pubkey>: Refuses to tombstone the laptop's own active client key (points to rotate-client-key instead). Under the laptop's tombstone flock, signs Tombstone(K), verifies against owner.pub, adds it to the local tombstone file, and pushes the tombstone set over SSH to every runner in client.json, reporting any runners not reached.
  • rotate-client-key (single-phase, no waiting on offline runners):
  • Generates a fresh client key K_new, asks owner.pub to sign ClientPin(K_new) (Touch ID), signs K_new's client-cert with the current day-key, atomically switches the laptop's active client key to K_new, and deletes K_old immediately. (If ~/.config/allmyram itself may have been copied, it can also rotate day-key and tombstone D_old, though tombstoning K_old alone already cuts off an attacker who copied both K_old and D_old because D_old cannot forge ClientPin.)
  • Asks owner.pub to sign Tombstone(K_old) (Touch ID), saves it locally, and pushes the tombstone set to every reachable runner authenticating as K_new.
  • Any runner that was offline already accepts K_new the moment it comes back online (because K_new carries ClientPin(K_new) in its certificate!) and receives Tombstone(K_old) on that first connection. No compromised old key ever has to be kept around waiting for offline runners.
  • Sync on connect and on --join:
  • On normal connections (and during --join under the same owner.pub, serialized with the laptop's tombstone lock across step 5 + client.json write so a concurrent revoke is included), the laptop and runner merge tombstones by set union.
  • Bidirectional union is safe: Unlike Round 5 (where adopting a higher-version PinnedSet from a runner could re-admit a revoked key), a runner cannot forge an owner.pub signature, and a genuine owner.pub-signed tombstone can only revoke a key the owner actually revoked — never grant access or undo a revocation. Verify every incoming tombstone against owner.pub, enforce the 256-entry / 64 KiB cap, and union.
  • On --join under a new owner.pub, the runner clears old tombstones (which were scoped to the old owner.pub) and writes the join's tombstone set for the new owner.pub.

4. How Every Failure Case Behaves Under This Design

Scenario Behavior
Client key K_old copied off laptop rotate-client-key switches to K_new, deletes K_old at once, and pushes Tombstone(K_old) to all reachable runners -> instant cutoff; offline runners get Tombstone(K_old) on next connect using K_new.
Replay of old cert, old ClientPin, or old tombstone list Cannot remove any tombstone (T ∪ T_old = T). K_old stays rejected forever.
Partial restore of ~/.config/allmyram on same Mac (active key still valid, tombstones stale) First connect to any runner unions the runner's owner.pub-verified tombstones back onto the laptop and preserves every runner's tombstones. Zero prompts, zero rejoins.
Partial restore of ~/.config/allmyram on same Mac (active key K_old was already revoked) Runners holding Tombstone(K_old) refuse K_old (no silent un-revocation). Running rotate-client-key once on the laptop mints (K_new, ClientPin(K_new)), which every runner immediately accepts without rejoining.
Fresh allmyram init with same owner.pub (e.g., 1Password / wiped config) Mints a fresh random K_new + ClientPin(K_new). Rejoining or connecting unions tombstones; old revoked keys stay revoked and K_new works immediately without a "re-pin?" prompt.
Full laptop restore / lost Secure Enclave key New owner key in Secretive -> allmyram init -> --join each runner under the new owner.pub.
Touch ID prompt budget init: 2 (ClientPin + first day-key). Daily background use: 1 (day-key). join: 0 extra. revoke: 1. rotate-client-key: 2 (ClientPin(K_new) + Tombstone(K_old)).

5. What Can Be Deleted From 2026-11-23-join-by-invite-design.md

Replacing PinnedSet with ClientPin + Tombstone union removes:

  1. PinnedSet version numbers and monotonic counter rules;
  2. Pre-signature cross-runner set collection and intersection/reconciliation;
  3. The re-pinned field and join-time "smaug does not trust this laptop's client key; pin it?" prompt;
  4. The separate "unpinned record" alongside a "pinned set" (the tombstone set is the whole state on runners);
  5. Empty-set checks (impossible when each key carries its own ClientPin);
  6. Keeping K_old alive in rotate-client-key while waiting for offline runners to acknowledge K_new.