Skip to content

[Bug]: macOS repeatedly prompts for login keychain password for "gemini" on Antigravity Gemini Enterprise (oauth-business) #41000

Open

Description

@pfurcode

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

(Note: #39775 reported a similar prompt, but blamed nightly re-signing and was closed as a duplicate of #37587. PR #39485 only bypassed the OS keyring for oauth-personal; oauth-business / Gemini Enterprise still reads the macOS Keychain via @napi-rs/keyring, which triggers this bug on official Developer ID builds even with zero app updates.)

Area

apps/server

Steps to reproduce

  1. On macOS, configure the Antigravity provider with Gemini Enterprise (oauth-business) and sign in (bundled Antigravity CLI 1.5.12).
  2. Wait for T3 Code's Antigravity usage-limits probe (makeAntigravityUsageProbe) to poll quotas.
  3. macOS displays: T3 Code (Nightly) wants to access key "gemini" in your keychain.
  4. Enter the login keychain password and click Always Allow.
  5. Continue using Antigravity for ~1 hour until Google's OAuth access token expires and refreshes.
  6. Wait for the next usage-limits poll.

Expected behavior

T3 Code reads Antigravity's gemini / antigravity Keychain entry without triggering repeated macOS Keychain prompts across hourly OAuth token refreshes.

Actual behavior

Every ~1 hour (after each OAuth access token refresh), macOS pops up the login keychain prompt again — even after clicking Always Allow — because the item's XARA ACL partition list gets reset back to ("apple-tool:").

Root cause

  1. Antigravity CLI 1.5.x stores its oauth-business token in the macOS login Keychain (service="gemini", account="antigravity") using zalando/go-keyring, which shells out to /usr/bin/security (add-generic-password -U -s gemini -a antigravity -w ...). That tags the Keychain item with macOS XARA partition ("apple-tool:").
  2. In apps/server/src/provider/antigravityUsageLimits.ts, readCliKeyringSecret reads that entry on macOS via @napi-rs/keyring (AsyncEntry("gemini", "antigravity").getSecret()), which calls Security.framework directly from the T3 Code (Nightly) process (teamid:ARK85ZXQ4Z).
  3. Clicking Always Allow adds teamid:ARK85ZXQ4Z to the item's XARA partition list.
  4. About an hour later, when the OAuth access token expires, the Antigravity CLI refreshes it via /usr/bin/security (SecKeychainItemModifyContent), which rebuilds the integrity ACL (no previous integrity acl exists; making a new one) back to only ("apple-tool:"), wiping out teamid:ARK85ZXQ4Z.
  5. On the next usage-limits poll, securityd hits ACL partition mismatch: client teamid:ARK85ZXQ4Z ACL ("apple-tool:") and prompts again.

Suggested fix

On darwin, read the "gemini" / "antigravity" Keychain entry in readCliKeyringSecret via /usr/bin/security find-generic-password -s gemini -a antigravity -w (matching zalando/go-keyring's own macOS Get and the apple-tool: XARA partition — the same pattern used for Claude Code's Keychain credentials in #34099).

Impact

Major degradation or frequent failure

Version or commit

0.1.12-nightly.20261122.5085 (official Developer ID signed ARK85ZXQ4Z)

Environment

macOS 27.2.1 (build 26B131), arm64, T3 Code (Nightly) 0.1.12-nightly.20261122.5085, bundled Antigravity CLI 1.5.12 (oauth-business / Gemini Enterprise)

Logs or stack traces

# 16:49 — Antigravity CLI refreshes OAuth token via /usr/bin/security (apple-tool:)
16:49:20.598 security: (Security) SecKeychainItemModifyContent

# 16:50–16:51 — T3 Code server polls limits via @napi-rs/keyring; user clicks "Always Allow"
16:50:54.257 securityd: [com.apple.securityd:integrity] ACL partition mismatch: client teamid:ARK85ZXQ4Z ACL ( "apple-tool:" )
16:51:10.199 securityd: [com.apple.securityd:integrity] ACL partition mismatch: client teamid:ARK85ZXQ4Z ACL ( "apple-tool:" )
16:51:20.305 securityd: [com.apple.securityd:kcacl] user approved 'always allow' for /Applications/T3 Code (Nightly).app(75248)
16:51:20.305 securityd: [com.apple.securityd:integrity] adding XARA partition 'teamid:ARK85ZXQ4Z' to list

# ~1 hour later — OAuth token refreshes via /usr/bin/security, wiping teamid:ARK85ZXQ4Z from ACL
17:50:04.122 security: (Security) SecKeychainItemModifyContent
17:50:54.324 securityd: [com.apple.securityd:integrity] ACL partition mismatch: client teamid:ARK85ZXQ4Z ACL ( "apple-tool:" )
...
18:07:00.212 securityd: [com.apple.securityd:kcacl] user approved 'always allow' for /Applications/T3 Code (Nightly).app(75248)
18:07:00.212 securityd: [com.apple.securityd:integrity] adding XARA partition 'teamid:ARK85ZXQ4Z' to list

# ~1 hour later — same thing again: SecKeychainItemModifyContent creates a fresh integrity ACL
18:49:55.810 security: (Security) SecKeychainItemModifyContent
18:49:55.820 security: (Security) [com.apple.securityd:integrity] no previous integrity acl exists; making a new one
18:49:55.823 security: (Security) [com.apple.securityd:atomicfile] commited .../login.keychain-db.sb-... to .../login.keychain-db
19:20:54.453 securityd: [com.apple.securityd:integrity] ACL partition mismatch: client teamid:ARK85ZXQ4Z ACL ( "apple-tool:" )

Activity

  1. kociubin commented on Nov 24, 2026

    @kociubin

    The serious side effect for me is that when it happens, I'm no longer able to connect to may main host from other ones until I type in the password into the prompt.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions