From 9bf25cd5097c7bd8cc43af781de191e2b5dad3f2 Mon Sep 17 00:00:00 2001 From: flash2do Date: Fri, 6 Nov 2026 11:11:20 -0800 Subject: [PATCH 1/4] Release 0.17.0 Twelve PRs landed since 0.16.0: the relay doorbell, six security fixes from the 2026-11-05/06 audits and CI and test reliability work. The changelog describes them and tells users to redeploy their relay Worker, since the doorbell lives in Relay/src/worker.js. The app, plugin, MCPB, registry and cask versions move to 0.17.0 together, and server.json carries the hash of the deterministic Keysrs.mcpb rebuilt for the new manifest version. --- CHANGELOG.md | 10 ++++++++++ Sources/KeysCore/AppVersion.swift | 2 +- docs/agents.md | 2 +- packaging/homebrew/keysrs.rb | 2 +- packaging/mcpb/manifest.json | 2 +- plugins/keysrs/.claude-plugin/plugin.json | 2 +- plugins/keysrs/.codex-plugin/plugin.json | 2 +- server.json | 6 +++--- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34d9200..99fc842 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.17.0 — 2026-11-06 + +- **A remote agent can ask the Mac to turn the relay on.** The relay stays off until you turn it on, and an agent on another machine whose calls got 503 `mac_offline` had no way to tell the Mac. `keys relay doorbell on` (one Touch ID, off by default, stays on across launches) opens a second socket to your Worker that carries no request, key or token. An agent then rings with the client token it already has, `POST https:///.keysrs/doorbell` (plus `X-KSF-Pair` if the Mac requires pairing). The Worker forwards only SHA-256 hashes of that credential and takes at most one ring every ten seconds from each address. The Mac checks that the token or pairing is live, that the screen is unlocked and that it is within its prompt limits, then shows a Touch ID prompt naming who rang (`turn on the relay: "hetzner box" asked through `). Approving turns the relay on as `keys relay on` would; nothing turns it on without that prompt, and the MCP server still has no relay-on tool. `keys relay doorbell off`, `keys relay reset`, `keys revoke --all` and `keys purge` delete the doorbell key. The doorbell lives in `Relay/src/worker.js`, so **redeploy your relay Worker to use it** (`cd Relay && npx wrangler deploy`, no new secret); against an older Worker, `keys relay status` shows the doorbell retrying with the Worker's answer. A relay socket the old Worker accepted keeps working through the redeploy. `docs/relay.md` now also says the upload deadline bounds each request, not each sender. +- **Touch ID prompts name where a key goes, and agent text can't hide it.** The `test_keys` prompt named only the keys, although the secret goes to each key's gateway host, which a metadata edit can change without a prompt. It now names the host and provider for each key, host first, as the probe dials it. Agent-chosen text in a prompt (a grant's task, an `import_and_wrap` project label, file, pairing, share and held-token labels) is cleaned before it is shown: line breaks become spaces, bidi, zero-width and other invisible characters are dropped and long text is cut. Grant and renew prompts now put the task last, so it can't push or fake the key, host and duration clauses. Hosts show as the gateway dials them, so a lookalike domain shows its `xn--` form. +- **`check_exposure` no longer runs commands from the scanned repo's git config.** It ran git from PATH with the MCP process's whole environment, so a folder whose `.git/config` came from someone else could run a command as you through `core.fsmonitor` or a signature program, and a relative PATH entry could pick a `git` shipped in the project. git now runs with those settings and hooks off, network protocols refused, stdin closed, only absolute PATH entries and a short fixed environment (no API-key variables). Your own global config, such as `safe.directory` and `core.excludesFile`, still applies. +- **The dashboard and gateway refuse framing and malformed requests.** HTML answers now send `frame-ancestors 'none'` and `X-Frame-Options: DENY`, so another page can't frame the dashboard's one-click controls. A request head with a bare CR, a bare LF or a NUL, or a method or header name that isn't an RFC 9110 token, is answered 400 on both the dashboard and the gateway instead of relying on CFNetwork to drop it. The gateway drops `X-HTTP-Method-Override` and its variants, so a POST-only grant can't reach DELETE or PATCH at APIs that honour them. +- **Wrap backups no longer hold your keys.** `import_and_wrap` and `keys wrap` saved a full copy of the original env file, key values included, under Application Support, and unwrap, rm, rotate and purge left it there for any process running as you (and Time Machine) to read. Backups now keep only the `*_BASE_URL` lines unwrap needs, and a failed rewrite rolls back from memory. A complete unwrap removes that file's backups. `keys rm` and rotate cut the full copies older versions wrote down to those lines, and purge removes the whole backups folder; each reports an error rather than success if it can't. The backups folder is excluded from Time Machine. +- **The CLI sends secrets only to a running Keysrs it can prove.** A `control.json` left by a crash or Force Quit counted as live while its pid existed, so a recycled pid could receive `keys wrap`'s key values and the control token on the recorded port. The CLI and `keys mcp` now send nothing, not even the token, unless that pid is yours and holds the listener on `127.0.0.1:`; otherwise they launch the app as if no file existed. Reading a held client token and the MCP vault-match and feedback routes also need a second per-launch secret that only the owner-only `control.json` holds, never the dashboard page, which other accounts on the Mac could read over loopback. A 0.17.0 `keys` talking to an older running app refuses those routes and asks you to update Keysrs and reopen it. +- **Tests and CI are faster and steadier.** Pull requests run CI once per commit and only for the areas they touch, with one required alls-green check. Swift tests that sat through real timeouts and the dashboard UI suite's waits are shorter (the UI suite from about 3 minutes to 1:20), and the update-retry and menu bar recovery tests no longer flake. + ## 0.16.0 — 2026-11-05 - **A program that starts on its own can get a scoped token after one Touch ID.** A cron job or an agent framework's startup hook can't show Touch ID, and `keys` printed a client token only once, so the only way to hand such a program a token was to write it into a file. `keys client issue --label --hold` now mints a client token under one Touch ID (the prompt names the label and the number of days) and the app keeps it in its own Keychain item instead of printing it. `keys client token --label --json` hands it back with no prompt while it is live, with `base_url`, `expires_at`, the scope and `gateway_on`; it exits 2 when the token is missing, expired or revoked and 6 when the app can't be reached. A new held token under the same label replaces the old one, and every revoke path (single, key-wide, the kill switch, key removal, purge) deletes the held copy. Reads are audited, at most once per token per hour. While a held token is live, any process running as you can read it without Touch ID, the same exposure as a token `keys wrap` writes into an env file, so keep its scope and days small. No MCP tool exposes held tokens. The Hermes Agent plugin (gshost1/keysrs-hermes) is built on this. diff --git a/Sources/KeysCore/AppVersion.swift b/Sources/KeysCore/AppVersion.swift index df32961..d55f42c 100644 --- a/Sources/KeysCore/AppVersion.swift +++ b/Sources/KeysCore/AppVersion.swift @@ -1,5 +1,5 @@ /// The release version, bumped at release time; `scripts/build-app.py` reads the /// bundle version from this line, so keep its shape. enum AppVersion { - static let current = "0.16.0" + static let current = "0.17.0" } diff --git a/docs/agents.md b/docs/agents.md index e1163c3..0fd4833 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -106,7 +106,7 @@ Probe with the cheapest call first. `keys version --json` needs no running site and no Touch ID: ```sh -keys version --json # {"version":"0.16.0"} — one line, exit 0 +keys version --json # {"version":"0.17.0"} — one line, exit 0 ``` An install old enough to answer exit 64 here does not know this surface yet; diff --git a/packaging/homebrew/keysrs.rb b/packaging/homebrew/keysrs.rb index fa7d5d5..8fc9212 100644 --- a/packaging/homebrew/keysrs.rb +++ b/packaging/homebrew/keysrs.rb @@ -4,7 +4,7 @@ # placeholder; scripts/prepare-release.py rewrites it (and the version line) # from the release DMG at release time — see docs/release.md. cask "keysrs" do - version "0.16.0" + version "0.17.0" sha256 :no # The frozen DMG name and the versioned release-download URL the app's own diff --git a/packaging/mcpb/manifest.json b/packaging/mcpb/manifest.json index da07b2a..11278d3 100644 --- a/packaging/mcpb/manifest.json +++ b/packaging/mcpb/manifest.json @@ -2,7 +2,7 @@ "manifest_version": "0.3", "name": "keysrs", "display_name": "Keysrs", - "version": "0.16.0", + "version": "0.17.0", "description": "Starts the `keys mcp` server of Keysrs, the local Mac API-key vault: Touch ID-approved, scoped grants for agents instead of keys. Needs Keysrs.app on macOS (brew install --cask gshost1/keysrs/keysrs, or keysrs.com).", "long_description": "Keysrs keeps provider API keys in the macOS Keychain behind Touch ID and hands agents scoped, expiring gateway grants instead of keys. This bundle only starts the `keys mcp` server of the installed app; it contains no app, no key and no setting. It needs Keysrs.app in /Applications on macOS (brew install --cask gshost1/keysrs/keysrs, or keysrs.com).", "author": { "name": "Keysrs", "url": "https://keysrs.com" }, diff --git a/plugins/keysrs/.claude-plugin/plugin.json b/plugins/keysrs/.claude-plugin/plugin.json index bd353a1..e9ecc73 100644 --- a/plugins/keysrs/.claude-plugin/plugin.json +++ b/plugins/keysrs/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "keysrs", "displayName": "Keysrs", - "version": "0.16.0", + "version": "0.17.0", "description": "Agent surface for Keysrs, the local Mac API-key vault: the keysrs skill and the `keys mcp` server. Needs Keysrs.app on macOS (brew install --cask gshost1/keysrs/keysrs, or keysrs.com).", "author": { "name": "Keysrs", "url": "https://keysrs.com" }, "homepage": "https://keysrs.com", diff --git a/plugins/keysrs/.codex-plugin/plugin.json b/plugins/keysrs/.codex-plugin/plugin.json index 24989f4..763ec3e 100644 --- a/plugins/keysrs/.codex-plugin/plugin.json +++ b/plugins/keysrs/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "keysrs", - "version": "0.16.0", + "version": "0.17.0", "description": "Agent surface for Keysrs, the local Mac API-key vault: the keysrs skill and the `keys mcp` server. Needs Keysrs.app on macOS (brew install --cask gshost1/keysrs/keysrs, or keysrs.com).", "author": { "name": "Keysrs", "url": "https://keysrs.com" }, "homepage": "https://keysrs.com", diff --git a/server.json b/server.json index 449a373..bd6ebd2 100644 --- a/server.json +++ b/server.json @@ -3,14 +3,14 @@ "name": "io.github.gshost1/keysrs", "title": "Keysrs", "description": "Local Mac API-key vault: Touch ID-approved, scoped grants for agents, not keys. Needs Keysrs.app.", - "version": "0.16.0", + "version": "0.17.0", "websiteUrl": "https://keysrs.com", "repository": { "url": "https://github.com/gshost1/Keysreallysafe", "source": "github" }, "packages": [ { "registryType": "mcpb", - "identifier": "https://github.com/gshost1/Keysreallysafe/releases/download/v0.16.0/Keysrs.mcpb", - "fileSha256": "c28056af77aa7f4fcb748f0218b315fa2304e379050fb89f0462fb951fb9d3ed", + "identifier": "https://github.com/gshost1/Keysreallysafe/releases/download/v0.17.0/Keysrs.mcpb", + "fileSha256": "5ba68c7b8d338daed0fd4637eb69ac739e55f72b6c939c18c6f1b511b37314f0", "transport": { "type": "stdio" } } ] From 60eb8aea2973ef13e03f5a378a40f32f613b619d Mon Sep 17 00:00:00 2001 From: flash2do Date: Fri, 6 Nov 2026 11:11:20 -0800 Subject: [PATCH 2/4] Mention the relay doorbell on keysrs.com The relay section and its FAQ said a call fails when the Mac can't serve it, which no longer covers the case where only the relay is off: from 0.17.0 an agent can ring the doorbell and the Mac asks for Touch ID. --- Site/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Site/index.html b/Site/index.html index 716c0a0..ccccee6 100644 --- a/Site/index.html +++ b/Site/index.html @@ -241,7 +241,7 @@

One Touch ID, and the repo is clean.

Cloud VMs

Remote agents hold a token.
The key stays on loopback.

-

A VM, a GitHub Actions runner or a cloud coding session can't reach 127.0.0.1. You deploy the relay Worker into your own Cloudflare account; the Mac dials out wss://<worker>/connect with a relay secret, and the Worker pins that one socket in a Durable Object. keys wrap --relay points the env file's base URL at the Worker, and keys share <machine> --key <name>… sets up a whole machine with one Touch ID: one token for several keys, and the env lines to paste there. Nothing on the Mac listens on a new port.

+

A VM, a GitHub Actions runner or a cloud coding session can't reach 127.0.0.1. You deploy the relay Worker into your own Cloudflare account; the Mac dials out wss://<worker>/connect with a relay secret, and the Worker pins that one socket in a Durable Object. keys wrap --relay points the env file's base URL at the Worker, and keys share <machine> --key <name>… sets up a whole machine with one Touch ID: one token for several keys, and the env lines to paste there. Nothing on the Mac listens on a new port. If the relay is off and you turned its doorbell on, the agent can ring with the token it holds, and you turn the relay on with one Touch ID.

@@ -467,7 +467,7 @@

Keysrs for Mac

What happens when the 30 days are up?

The token stops working and you get a notification about three days before. Ask your agent to set the project up again; it's one Touch ID.

How do I undo it?

keys unwrap puts the original lines back in the env file and revokes the project's tokens, after one Touch ID. Uninstalling offers to do this first.

Where's the window?

Keysrs runs in the background. Open it from Applications or Spotlight, or run keys dashboard, to see your keys, grants, activity and usage. The menu bar item can be turned back on in Settings.

-
How does a VM get a dummy key?

Run keys wrap on the project's env file with your Worker's URL. Copy that file to the VM. Each call goes Worker, your Mac, provider, with the real key added on your Mac. If your Mac is off, nothing is served: a call waits up to a minute, then gets a retryable 503.

+
How does a VM get a dummy key?

Run keys wrap on the project's env file with your Worker's URL. Copy that file to the VM. Each call goes Worker, your Mac, provider, with the real key added on your Mac. If your Mac is off, nothing is served: a call waits up to a minute, then gets a retryable 503. If only the relay is off and you turned its doorbell on, the agent can ring to ask for it, and the Mac shows you a Touch ID prompt naming who rang.

Does the Worker see my keys?

No. It's a pipe you deploy from the repo into your own Cloudflare account; Keysrs hosts none. It holds one relay secret that lets your Mac connect and never has a provider key.

Is the dollar figure real?

Tokens are real: they're what your Mac measured. Dollars are an estimate from a published list-price table. Anything unpriced reads as unknown, not $0.

Is it really free?

Yes. Keysrs is MIT-licensed open source with no trial, license key or paid tier.

From 39e708e53b42bd063f383efbf2645c909bd921b4 Mon Sep 17 00:00:00 2001 From: flash2do Date: Fri, 6 Nov 2026 11:14:14 -0800 Subject: [PATCH 3/4] Keep release notes precise about doorbell credentials and test coverage The doorbell authenticates its signal socket with a derived credential, and the updater change strengthens a regression test rather than fixing a timing flake. State both behaviors accurately in the release notes. --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99fc842..6fa5803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,13 @@ ## 0.17.0 — 2026-11-06 -- **A remote agent can ask the Mac to turn the relay on.** The relay stays off until you turn it on, and an agent on another machine whose calls got 503 `mac_offline` had no way to tell the Mac. `keys relay doorbell on` (one Touch ID, off by default, stays on across launches) opens a second socket to your Worker that carries no request, key or token. An agent then rings with the client token it already has, `POST https:///.keysrs/doorbell` (plus `X-KSF-Pair` if the Mac requires pairing). The Worker forwards only SHA-256 hashes of that credential and takes at most one ring every ten seconds from each address. The Mac checks that the token or pairing is live, that the screen is unlocked and that it is within its prompt limits, then shows a Touch ID prompt naming who rang (`turn on the relay: "hetzner box" asked through `). Approving turns the relay on as `keys relay on` would; nothing turns it on without that prompt, and the MCP server still has no relay-on tool. `keys relay doorbell off`, `keys relay reset`, `keys revoke --all` and `keys purge` delete the doorbell key. The doorbell lives in `Relay/src/worker.js`, so **redeploy your relay Worker to use it** (`cd Relay && npx wrangler deploy`, no new secret); against an older Worker, `keys relay status` shows the doorbell retrying with the Worker's answer. A relay socket the old Worker accepted keeps working through the redeploy. `docs/relay.md` now also says the upload deadline bounds each request, not each sender. +- **A remote agent can ask the Mac to turn the relay on.** The relay stays off until you turn it on, and an agent on another machine whose calls got 503 `mac_offline` had no way to tell the Mac. `keys relay doorbell on` (one Touch ID, off by default, stays on across launches) opens a second signal socket to your Worker. It uses a separate derived credential and carries rings and credential hashes, never provider requests or API-key values. An agent then rings with the client token it already has, `POST https:///.keysrs/doorbell` (plus `X-KSF-Pair` if the Mac requires pairing). The Worker forwards only SHA-256 hashes of that credential and takes at most one ring every ten seconds from each address. The Mac checks that the token or pairing is live, that the screen is unlocked and that it is within its prompt limits, then shows a Touch ID prompt naming who rang (`turn on the relay: "hetzner box" asked through `). Approving turns the relay on as `keys relay on` would; nothing turns it on without that prompt, and the MCP server still has no relay-on tool. `keys relay doorbell off`, `keys relay reset`, `keys revoke --all` and `keys purge` delete the doorbell key. The doorbell lives in `Relay/src/worker.js`, so **redeploy your relay Worker to use it** (`cd Relay && npx wrangler deploy`, no new secret); against an older Worker, `keys relay status` shows the doorbell retrying with the Worker's answer. A relay socket the old Worker accepted keeps working through the redeploy. `docs/relay.md` now also says the upload deadline bounds each request, not each sender. - **Touch ID prompts name where a key goes, and agent text can't hide it.** The `test_keys` prompt named only the keys, although the secret goes to each key's gateway host, which a metadata edit can change without a prompt. It now names the host and provider for each key, host first, as the probe dials it. Agent-chosen text in a prompt (a grant's task, an `import_and_wrap` project label, file, pairing, share and held-token labels) is cleaned before it is shown: line breaks become spaces, bidi, zero-width and other invisible characters are dropped and long text is cut. Grant and renew prompts now put the task last, so it can't push or fake the key, host and duration clauses. Hosts show as the gateway dials them, so a lookalike domain shows its `xn--` form. - **`check_exposure` no longer runs commands from the scanned repo's git config.** It ran git from PATH with the MCP process's whole environment, so a folder whose `.git/config` came from someone else could run a command as you through `core.fsmonitor` or a signature program, and a relative PATH entry could pick a `git` shipped in the project. git now runs with those settings and hooks off, network protocols refused, stdin closed, only absolute PATH entries and a short fixed environment (no API-key variables). Your own global config, such as `safe.directory` and `core.excludesFile`, still applies. - **The dashboard and gateway refuse framing and malformed requests.** HTML answers now send `frame-ancestors 'none'` and `X-Frame-Options: DENY`, so another page can't frame the dashboard's one-click controls. A request head with a bare CR, a bare LF or a NUL, or a method or header name that isn't an RFC 9110 token, is answered 400 on both the dashboard and the gateway instead of relying on CFNetwork to drop it. The gateway drops `X-HTTP-Method-Override` and its variants, so a POST-only grant can't reach DELETE or PATCH at APIs that honour them. - **Wrap backups no longer hold your keys.** `import_and_wrap` and `keys wrap` saved a full copy of the original env file, key values included, under Application Support, and unwrap, rm, rotate and purge left it there for any process running as you (and Time Machine) to read. Backups now keep only the `*_BASE_URL` lines unwrap needs, and a failed rewrite rolls back from memory. A complete unwrap removes that file's backups. `keys rm` and rotate cut the full copies older versions wrote down to those lines, and purge removes the whole backups folder; each reports an error rather than success if it can't. The backups folder is excluded from Time Machine. - **The CLI sends secrets only to a running Keysrs it can prove.** A `control.json` left by a crash or Force Quit counted as live while its pid existed, so a recycled pid could receive `keys wrap`'s key values and the control token on the recorded port. The CLI and `keys mcp` now send nothing, not even the token, unless that pid is yours and holds the listener on `127.0.0.1:`; otherwise they launch the app as if no file existed. Reading a held client token and the MCP vault-match and feedback routes also need a second per-launch secret that only the owner-only `control.json` holds, never the dashboard page, which other accounts on the Mac could read over loopback. A 0.17.0 `keys` talking to an older running app refuses those routes and asks you to update Keysrs and reopen it. -- **Tests and CI are faster and steadier.** Pull requests run CI once per commit and only for the areas they touch, with one required alls-green check. Swift tests that sat through real timeouts and the dashboard UI suite's waits are shorter (the UI suite from about 3 minutes to 1:20), and the update-retry and menu bar recovery tests no longer flake. +- **Tests and CI are faster and steadier.** Pull requests run CI once per commit and only for the areas they touch, with one required alls-green check. Swift tests that sat through real timeouts and the dashboard UI suite's waits are shorter (the UI suite from about 3 minutes to 1:20), the update-retry test now proves that an old schedule cannot run a lookup, and menu bar recovery tests wait for the actual replacement. ## 0.16.0 — 2026-11-05 From 4b1237a36ef27cfcad6b67a3af54481c1f067bb0 Mon Sep 17 00:00:00 2001 From: flash2do Date: Fri, 6 Nov 2026 11:26:15 -0800 Subject: [PATCH 4/4] Synchronize the relay test socket closed-state reads Post-merge ThreadSanitizer CI caught FakeRelaySocket.close writing its flag while revoke-all assertions read it without the lock. Protect both sides so the test double follows the same synchronization contract as its other recorded state. --- Tests/KeysreallysafeTests/RelayTests.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/KeysreallysafeTests/RelayTests.swift b/Tests/KeysreallysafeTests/RelayTests.swift index d5e53dd..d04bbd0 100644 --- a/Tests/KeysreallysafeTests/RelayTests.swift +++ b/Tests/KeysreallysafeTests/RelayTests.swift @@ -10,7 +10,8 @@ final class FakeRelaySocket: RelaySocket, @unchecked Sendable { private var texts: [String] = [] private var iterator: AsyncStream.Iterator private let feed: AsyncStream.Continuation - private(set) var closed = false + private var closedState = false + var closed: Bool { lock.withLock { closedState } } /// When set, every keepalive text send fails as a dead transport would. var failPings = false @@ -50,7 +51,7 @@ final class FakeRelaySocket: RelaySocket, @unchecked Sendable { /// Like URLSession's cancel: a pending receive fails once the socket is closed. func close() { lock.lock() - closed = true + closedState = true lock.unlock() feed.finish() }