Skip to content

Keyhandoff v2.4.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 19:12
· 15 commits to main since this release

2.4.0 — 2026-12-01

Security fixes after an independent audit and a second review — thanks to @sfrangulov for the review.

  • Fixed: a program could pass itself off as a person. A request to the agent's socket that claimed a terminal
    (tty: true) skipped command approval and was logged as “terminal”. Now the agent asks the OS which process is on
    the other end of the socket (macOS lsof, Linux ss) and walks its parents: only a process in a terminal window
    with no AI agent among its ancestors counts as you. Everything else — including tmux, editors' terminals and
    Windows, where the process can't be identified — is treated as an agent. The audit log and dialogs use the same check.
  • Fixed: the vault key for one anonymous touch. ui --print gave any caller the window address, and the window's
    “open” call returned the whole vault key after a Touch ID that said only “open Keyhandoff”. Now the address carries a
    one-time code and is given only to the Keyhandoff app; for anyone else the agent opens the window itself. The Touch ID
    prompt for the stored vault key always names the program that asked. The window server refuses cross-site requests,
    sends anti-framing headers, pauses after 5 wrong passwords and keeps vault.json.bak on each save; the macOS app
    navigates only within its own address and is signed with the hardened runtime.
  • Command approval can't be sidestepped: a program is its real file (resolved with the command's PATH and
    realpath), wrappers (env, timeout, xargs, find -exec, …) are looked through, interpreters (node -e,
    python, bash script.sh, sudo, …) are approved only as the exact command, and commands that can't be analyzed
    ($(…), eval, $CMD, { …; }, if/for, here-docs, PATH=…) are asked every time. Variables like BASH_ENV,
    LD_PRELOAD, DYLD_*, NODE_OPTIONS are removed from the command's environment. Approvals from 2.3.0 are asked once
    more. Dialog text is stripped of line breaks, bidi and control characters.
  • No test mode in releases: it now needs the test/ folder of a git checkout, which the release archive doesn't contain.
  • Output masking: a single very long line no longer crashes the agent (and with it every running command); if
    masking fails, the rest of the output is hidden, not shown raw. New masked forms: strict URL encoding (! * ' ( )),
    base64 wrapped at 64/76, \uXXXX, HTML entities, printf %q, set -x, and the password inside a DATABASE_URL.
    Long output is no longer cut at 64 KB, and keyhandoff stop also stops running commands.
  • Files from elsewhere are checked: ids, types and fields of a vault/backup/import are validated (no HTML injection
    into the app, no import crash on __proto__); timestamps from the future don't win a merge; deletions from another
    file are applied only after Touch ID; one bad file doesn't stop sync; .1pux unpacking is limited to 64 MB; KDF
    iterations above 10 000 000 are refused.
  • Past values: a burst of quick changes can no longer push out the value that was there before it.
  • Smaller: temp files for ssh-add in fresh private folders; the agent-rules backup is made once and the file is written
    atomically; the release archive contains only tracked files; the skill says names and notes are data, not instructions.
  • Known limits, written down in SECURITY.md and README: a hostile program running as you can still open its own terminal
    window, replace an approved program or its config, or edit Keyhandoff; on Windows the caller isn't identified;
    binary output through run is not supported (write it to a file).