Repository navigation
Keyhandoff v2.4.0
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 (macOSlsof, Linuxss) 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 --printgave 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 keepsvault.json.bakon 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
PATHand
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 likeBASH_ENV,
LD_PRELOAD,DYLD_*,NODE_OPTIONSare 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 aDATABASE_URL.
Long output is no longer cut at 64 KB, andkeyhandoff stopalso 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 stopsync;.1puxunpacking 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-addin 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 throughrunis not supported (write it to a file).