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 newowner.pub, which cleanly resets state on every runner. - Because
allmyramtalks only toSSH_AUTH_SOCK(no direct Keychain/cgo state) and Secretive speaks plainecdsa-sha2-nistp256(no hardware signature counter, unlike FIDO2sk-ecdsa-*keys), the only ways~/.config/allmyramcan go backwards under the sameowner.pubare: - manually restoring just the
~/.config/allmyramdirectory 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:
- If local files roll back (
v5 -> v2), runners atv5rejectv3unless you add multi-runner version discovery. - Worse, bumping the version above
v5from 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-pinnedmarkers, multi-runner set intersection, join-time reconciliation).
3. Recommended Replacement: Stateless ClientPin + Grow-Only Tombstone Union¶
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(orpin/rotate-client-key) enrolls a client SSH public keyK, the owner key signs a one-time, domain-separated grant: - The laptop verifies the agent's returned signature against
owner.pub, savesClientPin(K)beside the client key, and embedsClientPin(K)in an extension onclient-cert(right alongside theday-keycertificate 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
Kasks the owner key to sign a single (~130-byte) domain-separated tombstone: - 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 byssh.Marshal(K), capped at e.g. 256 tombstones / 64 KiBio.LimitReader). - If the 256-tombstone cap is ever reached under a single CA,
allmyram initwith a new owner key +--joinresets the slate cleanly. - Runner check (at SSH handshake and on open connections):
client-certis valid now and signed bydayCert.Key;day-certis valid now (within the 24h ceiling) and signed byowner.pub;ClientPinis signed byowner.pubforowner.pubandclientCert.Key;- Neither
clientCert.KeynordayCert.Keyis in the runner's tombstone set. - When a new tombstone arrives on a runner,
sshsrvrecords it atomically (under the same mutex that registers active connections) and immediately cancels/closes any open connection whoseclientCert.KeyordayCert.Keymatches.
C. Delivery & Sync: Plain Set Union, Zero Version Counters¶
revoke <pubkey>: Refuses to tombstone the laptop's own active client key (points torotate-client-keyinstead). Under the laptop's tombstoneflock, signsTombstone(K), verifies againstowner.pub, adds it to the local tombstone file, and pushes the tombstone set over SSH to every runner inclient.json, reporting any runners not reached.rotate-client-key(single-phase, no waiting on offline runners):- Generates a fresh client key
K_new, asksowner.pubto signClientPin(K_new)(Touch ID), signsK_new'sclient-certwith the currentday-key, atomically switches the laptop's active client key toK_new, and deletesK_oldimmediately. (If~/.config/allmyramitself may have been copied, it can also rotateday-keyand tombstoneD_old, though tombstoningK_oldalone already cuts off an attacker who copied bothK_oldandD_oldbecauseD_oldcannot forgeClientPin.) - Asks
owner.pubto signTombstone(K_old)(Touch ID), saves it locally, and pushes the tombstone set to every reachable runner authenticating asK_new. - Any runner that was offline already accepts
K_newthe moment it comes back online (becauseK_newcarriesClientPin(K_new)in its certificate!) and receivesTombstone(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
--joinunder the sameowner.pub, serialized with the laptop's tombstone lock across step 5 +client.jsonwrite so a concurrentrevokeis included), the laptop and runner merge tombstones by set union. - Bidirectional union is safe: Unlike Round 5 (where adopting a higher-version
PinnedSetfrom a runner could re-admit a revoked key), a runner cannot forge anowner.pubsignature, and a genuineowner.pub-signed tombstone can only revoke a key the owner actually revoked — never grant access or undo a revocation. Verify every incoming tombstone againstowner.pub, enforce the 256-entry / 64 KiB cap, and union. - On
--joinunder a newowner.pub, the runner clears old tombstones (which were scoped to the oldowner.pub) and writes the join's tombstone set for the newowner.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:
PinnedSetversion numbers and monotonic counter rules;- Pre-signature cross-runner set collection and intersection/reconciliation;
- The
re-pinnedfield and join-time "smaug does not trust this laptop's client key; pin it?" prompt; - The separate "unpinned record" alongside a "pinned set" (the tombstone set is the whole state on runners);
- Empty-set checks (impossible when each key carries its own
ClientPin); - Keeping
K_oldalive inrotate-client-keywhile waiting for offline runners to acknowledgeK_new.