Repository navigation
Signed self-update for machines and the hub - #12
Merged
Merged
Conversation
The new update verb (only with --allow-self-update on the machine's own command line) verifies a release bundle with ssh-keygen -Y verify against the pinned ~/.config/switchboard-remote/release_signers, checks every file against the signed manifest, refuses versions not newer than any installed before, self-tests the staged files and installs them atomically with .prev copies. Serve mode exits 77 after an update; --rollback swaps .prev back. remote/release.py builds and reads bundles with the dispatcher's own checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Reads back both versions and the signing key, needs risky_ok in a later turn, sends only the bundle bytes read back, records every attempt as an incident log event and an audit line, and notes older dispatchers in list_remote_sessions and remote_status. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
…e additions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
release publish verifies a bundle against the hub's own root-owned pinned signers file (remote.releaseSignersFile) with the dispatcher's ssh-keygen check and every file's size and SHA-256, and stores nothing unverified. remote_update verifies the stored bundle again, so a bundle swapped on disk is not offered, and the read-back names the signer verified on the hub. Refusals are release_refused events of the hub. The machine's own check stays the gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner request (2026-11-27): a self-update API for Switchboard, for switchboard-remote and generally, with updates signed by a private key that stays on the WSL machine and verified by every machine before it applies one. Reason: a machine still on dispatcher 0.6.0 could not clear the input field.
Design
ssh-keygen -Y sign/-Y verify(OpenSSH 8.1+, namespaceswitchboard-release). No custom crypto, no new dependency on machines.manifest.json(format, product, version (always the dispatcher file's ownVERSION),minVersion, created, per file target, size, sha256) plus the three programs, as JSON lines (manifest as base64 + armored signature, then 256 KiB base64 chunks per file, thendone); at most 1 MiB of files, 1.5 MiB in all, so it fits the 2 MiB serve frame.release build [--source deploy/remote],release sign --key ~/.ssh/switchboard_release <dir>(ssh-keygen prompts for the passphrase on the terminal itself),release verify --signers <file> <bundle>. Hub:release publish <bundle>verifies the signature withssh-keygen -Y verifyagainst the hub's own root-owned pinned signers file (remote.releaseSignersFile, default/etc/voice-coding-mcp/release_signers) plus every file's size and sha256, and stores nothing unverified (no signers file: nothing is published; refusals arerelease_refusedincident events).release list,remote-update <machine> [--yes].updateverb, only with the new--allow-self-updatefrom the machine's own command line (refused with--policy-from-hub, unknown in a policy file). Order: size cap; install location checks (installed under its own name, dir/files not group/other writable, no symlinks); per-user lock; update record and the pinned~/.config/switchboard-remote/release_signers(regular, user/root owned, not g/o writable, parents too); strict bundle parse with fixed target names only; namespace, OpenSSH version,ssh-keygen -Y verifywith a fixed argv, private copies of signers and signature, minimal env, timeout; manifest + per-file size/sha256; strictly newer than the running version and than the highest version ever installed (survives rollback);minVersion; staged files (O_EXCL|O_NOFOLLOW, 0755, fsync) self-tested (compile, new dispatcher answersversionwith the manifest version, connector--version, hookversion); then per file.prevcopy + atomic rename, dispatcher last, restore on failure. All from bytes in memory after the hash check (no TOCTOU re-read).execs itself if its own file was replaced (a 0.12 connector just reconnects after backoff).switchboard-remote --rollbackat the machine (refused under sshd) swaps.prevfiles; no hub verb (that would be a downgrade).remote_update(machine): re-verifies the stored bundle against the hub's signers file (a bundle swapped on disk after publish is refused), then reads back "update switchboard-remote on laptop from X to Y, signed by the release key SHA256:..., verified on the hub", newupdateconfirmation kind, always risky (risky_ok, later turn), bound to the bundle's sha256; refuses old dispatchers with the bootstrap hint, self-update off, up to date, local machine. Every attempt is an incident-log event (update_installed/update_refused/update_unknown) and an audit line.list_remote_sessions/remote_statusmention an older dispatcher than the published release;remote-checkshowsself-update allowed|off. CLIremote-update --yesworks for agent machines through the hub's control socket (sha256-bound).deploy/hub-update(stdlib, byte-identical tovoice_coding_mcp/hub_update.py), run by hand: fetch one tag without forcing, annotated, tag object's own name equals the ref, points at a commit,git verify-tagwith pinned/etc/voice-coding-mcp/release_signers(gpg.minTrustLevel=fully, no global/system git config), newer than the last installed tag, all by object id; checkout by commit hash,uv sync --frozen(back to previous commit on failure), restart. No automatic hub restart from a voice call.Threat model (summary, full table in docs/SWITCHBOARD.md)
updatewithout a confirmation, but can only install the newest signed release on machines with--allow-self-update, never an older, modified or its own one. The hub never writes the signers file.minVersion.release_signerson each machine and on the hub..prev, self test before any rename.Tests
New:
tests/remote/test_dispatcher_update.py(real ssh-keygen, temp keys: accepted install with.prev, tampered manifest, tampered file, wrong namespace, wrong key, key without the namespace, unsigned/garbled, same/older version, replay after update, rollback keeps refusing, min_version, damaged record, unknown targets incl. traversal names, cut/reordered/padded bundles, short chunks, oversize, duplicate keys, signers file/dir permissions and symlink, missing signers, OpenSSH < 8.1 and missing, flag absent, flag refused from hub/policy file, not installed under its name, unsafe install dir/files/symlink, self test failures, failed rename restores, lock, forced command subprocess incl.--rollback, serve mode exit 77 and refused update),test_update_tools.py(read-back text, early / risky_ok / single use, bundle changed, old dispatcher, self-update off, up to date, local, list note, unknown outcome, incident events and audit),test_release_cli.py, agent end to end intest_agent_tools.py(update over the relay, exit 77, reconnect on the new version,remote-update --yesthrough the control socket), connector tests,tests/test_hub_update.py(temp git repo: signed, dry run, unsigned, foreign key, lightweight, renamed tag, downgrade, signers perms, dirty tree, missing git namespace, bad names). Tests skip with a message when ssh-keygen is missing or older than 8.1.Gate (after the hub-verification follow-up):
uv sync --locked,ruff check,ruff format --check,mypy --strict src testsclean;pytest(no -n): 2535 passed, 14 failed, 11 skipped under load average around 19; all 14 failures passed when rerun alone (13 in one rerun, the last one three times in a row), none in self-update code.Bootstrap (once per machine, e.g. the one still on 0.6.0)
Exact commands are in docs/SETUP-AGENTS.md "Updating to 0.13.0: signed self-update". In short, on the machine as its user, from the owner's verified checkout:
Then on the hub
remote-check <machine>shows 0.13.0 withself-update allowed, and later releases go by voice ("update ").Not merged; the hub must be updated before machines rely on the new verb (an older hub ignores it).
🤖 Generated with Claude Code
https://claude.ai/code/session_011moV3EPNNknRWZQ686AChh