-
fix(cli-keyring): route macOS reads through subprocess for unsigned binaries
发布于
2026-04-13 23:49:04 +00:00 FFI reads via SecItemCopyMatching trigger a macOS keychain trust
dialog ("composio wants to access key ...") when called from an
ad-hoc signed binary, EVEN when the item's ACL is allow-any via
security -A. This is because macOS gates keychain access
against the calling binary's code signature, and ad-hoc signing
doesn't satisfy the system's trust requirements. Apple-signed
binaries (/usr/bin/security) are exempt.Confirmed root cause on a fresh macOS install + fresh composio
binary: subprocesssecurity find-generic-password -wreturns
the value silently, while FFI SecItemCopyMatching triggers the
"User canceled the operation" error after the dialog.Fix: route ALL macOS keychain operations through /usr/bin/security
subprocess. The FFI path is kept (macos-security-ffi.ts) for when
the composio CLI ships with a stable Developer ID signature —
one-line flip in the picker to re-enable.Also update subprocess store to use delete-then-add with -A
(matching the previous FFI fix) so the ACL is truly allow-any on
every write. Previously used -U which preserves stale per-binary
ACLs from older betas.Perf impact: macOS reads become ~25ms instead of ~1ms, but only
once per process thanks to in-memory memoization in
ComposioUserContextLive. Still invisible next to network I/O.Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
下载附件