Skip to content

fix(shell): Ad-hoc signed releases re-prompt macOS users for the Director key after every update #283

Open

Description

@omesser

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.

Activity

  1. added this to the V1 milestone on Sep 6, 2026
  2. added
    securitySecurity related - secrets, password, key-chain management, etc
    p0Drop everything: broken for users, or blocking
    on Sep 6, 2026
  3. omesser commented on Sep 9, 2026

    @omesser
    OwnerAuthor

    Looked at this end to end: no change under src-tauri/src/secrets.rs can 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:

    • Developer ID + notarization — the ACL records identifier plus certificate, which survives a rebuild, and Gatekeeper's warning goes with it. Needs the Apple account and a signing key in CI. This is the fix, and it is your call, with Build and distribute macOS and Linux packages #132's follow-up.
    • A stable self-signed certificate in CI — the same ACL effect for no Apple account (what you measured above). Nothing for Gatekeeper, and the private key becomes a repository secret that can sign something the user's Keychain trusts to read their key. Cheaper, strictly weaker.
    • Keychain access group — needs a team prefix and a provisioning profile, so it is Developer ID with extra parts.
    • A wide-open ACL on the item (-A / SecAccess with no trusted app) — dialogs gone today, and any process running as the user then reads the key silently. Not implemented; that trade is yours, and keyring would have to be bypassed to make it.
    • A 0600 file — plaintext at rest, copied by any sync or backup. Worse than all of the above.
    • A different service or item name — no effect; renaming to make the dialog read better would orphan every saved key.

    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.

  4. moved this from 👷 Todo to 🙋 Human Triage in Fidgeton Sep 9, 2026
  5. added
    p1Next up: the default for work that should happen
    needs-triageMaintainer needs to evaluate this issue
    and removed
    p0Drop everything: broken for users, or blocking
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate this issuep1Next up: the default for work that should happenready-for-humanRequires human implementationsecuritySecurity related - secrets, password, key-chain management, etc

    Projects

    • Status
      Ice Box

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions