Antigravity Remote Session: Fix "Secret Keyring is Locked" & Headless OAuth Bugs
Google Antigravity provides powerful AI agentic coding capabilities directly in your terminal and editor. When developers attempt to run Antigravity remotely over SSH or on headless Mac Mini / cloud servers, they frequently hit two immediate walls:
failed to retrieve token: secret keyring is locked- An endless OAuth loop where the CLI asks to open a local browser that cannot launch in a headless environment.
Here is why these authentication and daemon errors occur, how to unlock your keyring over SSH, and the cleanest way to control Antigravity remotely from your iPhone, iPad, or laptop.
| Error | Underlying Cause | Direct Fix |
|---|---|---|
| Secret keyring is locked | SSH session lacks interactive macOS Keychain access | Unlock login keychain via CLI or use native GUI session |
| OAuth callback hangs on localhost | Browser redirect attempts to hit loopback port on headless machine | Forward local port via SSH tunnel or use screen sharing |
Fix 1: Resolving “Secret Keyring is Locked” Over SSH
When you connect via standard SSH, macOS places your shell into a non-interactive security domain where the default login keychain remains locked.
How to unlock macOS Keychain inside SSH:
security unlock-keychain ~/Library/Keychains/login.keychain-dbmacOS will prompt for your Mac password, keeping the keychain unlocked for that SSH session.
Fix 2: Fixing the Headless OAuth Browser Loop
When authenticating on a headless machine without a display, forward the callback port to your local machine before starting the flow:
ssh -L 8085:localhost:8085 user@your-mac-ipFix 3: Running Antigravity as a Persistent Daemon
Instead of running interactive mode, start the managed background daemon:
agy remote-control start agy remote-control statusThe Clean Fix: Native Mac Remote via Macky
With Macky, you connect to your active, authenticated macOS user session.
- No Keyring Lockouts: Your macOS Keychain is already unlocked because you are logged in.
- 1-Tap OAuth Verification: When a browser popup opens, switch from Macky's Terminal to Desktop Screen tab, tap “Authorize”, and return to terminal in seconds.
- Persistent Shell: Your agent runs uninterrupted on your Mac hardware.
Related Guides & Comparisons
Try Macky
Connect to your Mac terminal from your iPhone. Free to start, no configuration required.