Repository navigation
Description
What happens
On macOS, reading the saved Director API key raises two Keychain dialogs at
launch — "ai-buddy wants to use your confidential information stored in
ai-buddy" and "ai-buddy wants to access key ai-buddy" — after any build that is
not the one which saved the key.
Why
tauri.conf.json sets "signingIdentity": "-", so every release is ad-hoc
signed (#132 shipped it that way deliberately; notarization was the follow-up).
An ad-hoc signature has no stable identity, so when the app first writes the
key macOS records the app in the item's access control list by cdhash, in two
places:
entry 0: authorizations: decrypt derive export_clear export_wrapped mac sign
applications (1):
0: .../ai-buddy
requirement: cdhash H"b51b028e9edd..."
entry 3: authorizations (1): partition_id
description: cdhash:b51b028e9edd...
Every release has a different cdhash, so an updated app matches neither entry
and both gates prompt. Always Allow re-pins the hash the next update replaces,
which means the prompt returns on every version — and trains users to click
through a Keychain dialog, which is the opposite of what storing the key in the
Keychain was for.
What fixes it
Signing with a Developer ID certificate. The ACL then records the designated
requirement (identifier plus certificate) rather than a hash, and a new version
of the same app matches it. Measured locally with a self-signed certificate: the
entry became identifier ... and certificate root = H"...", and a rebuilt
binary with a different cdhash read the item with no prompt at all.
This needs an Apple Developer account and belongs with notarization, which #132
already named as the follow-up. Until then the prompts are the cost of an
unsigned distribution, and worth saying out loud in the README.
Adjacent, already done on fix/keychain-prompt-per-launch: the startup read is
skipped when AI_BUDDY_DIRECTOR_API_KEY is exported, and scripts/dev-sign.sh
gives local builds a stable identity so the dev loop stops prompting.
— Cursor agent, on @omesser's behalf.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsIce Box
Activity
omesser commentedon Sep 9, 2026
Looked at this end to end: no change under
src-tauri/src/secrets.rscan remove the two dialogs. The ACL is per item and bound to the cdhash, #290 already deleted every read whose answer was known in advance, and the settings window caches the fingerprint — the launch is down to the one read the feature exists for.So the ways out, and what each costs:
-A/SecAccesswith no trusted app) — dialogs gone today, and any process running as the user then reads the key silently. Not implemented; that trade is yours, andkeyringwould have to be bypassed to make it.0600file — plaintext at rest, copied by any sync or backup. Worse than all of the above.Meanwhile #576 puts the explanation in the README's macOS section, beside the Gatekeeper paragraph it shares a cause with. Leaving this open: it is the signing decision, not the copy.
— Claude Code, on @omesser's behalf.