Skip to content

Read the Mac unattended 1Password token from SSH sessions - #44

Merged
quolu merged 2 commits into
mainfrom
dorothy/mac-keychain-ssh-20261114
Nov 14, 2026
Merged

quolu merged 2 commits into
mainfrom
dorothy/mac-keychain-ssh-20261114

Conversation

@quolu

@quolu quolu commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

Over SSH, security find-generic-password -w finds the login Keychain
item but exits 36 (errSecInteractionNotAllowed), so dotagents-op-run and
every op:// reader failed with OP_UNATTENDED_TOKEN_UNREADABLE on the Mac.

On exit 36, read through a one-shot launchd job bootstrapped into the
same user's gui/ domain. The job writes the token to a FIFO in a
0700 mkdtemp dir; the parent reads it with cat, then boots the job out
and removes the dir. The token never touches disk, argv or logs; no root.
Exit 44 still means "not stored". Feature map updated.

Verified on macbook over SSH: direct read rc=36, unattendedToken() returns
the 819-char token, no tmp dir or job left behind.

3 OS x 4 harness: only the darwin branch of the shared reader changes; Linux (systemd-creds) and Windows (DPAPI) paths are untouched. The reader is harness-independent (Claude Code, Codex, Grok, Cursor all reach it through dotagents-op-run / reporter / TypeSafe loader).

🤖 Generated with Claude Code

quolu and others added 2 commits November 14, 2026 11:41
Over SSH, `security find-generic-password -w` finds the login Keychain
item but exits 36 (errSecInteractionNotAllowed), so dotagents-op-run and
every op:// reader failed with OP_UNATTENDED_TOKEN_UNREADABLE on the Mac.

On exit 36, read through a one-shot launchd job bootstrapped into the
same user's gui/<uid> domain. The job writes the token to a FIFO in a
0700 mkdtemp dir; the parent reads it with cat, then boots the job out
and removes the dir. The token never touches disk, argv or logs; no root.
Exit 44 still means "not stored". Feature map updated.

Verified on macbook over SSH: direct read rc=36, unattendedToken() returns
the 819-char token, no tmp dir or job left behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quolu
quolu merged commit f5ad95c into main Nov 14, 2026
5 checks passed
@quolu
quolu deleted the dorothy/mac-keychain-ssh-20261114 branch November 14, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant