# \[Bug\] Antigravity CLI (agy) fails to persist authentication state in WSL 2 environment

**URL:** <https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059>\
**Category:** Google Antigravity\
**Tags:** wsl2, bug\
**Created:** [May 20, 2026, 7:41am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059 "2026-05-20T07:41:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Criss\_Anger](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/criss_anger/32/91460_2.png) [@Criss\_Anger](https://discuss.ai.google.dev/u/Criss_Anger)\
**Post date:** [May 20, 2026, 7:41am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/1 "2026-05-20T07:41:56Z")

</div>

#### Description

When using the Antigravity CLI (`agy`) inside a WSL 2 (Windows Subsystem for Linux 2) instance, the authentication session fails to persist. Every single execution of the `agy` command triggers a fresh authentication prompt instead of maintaining the logged-in state, causing significant friction in the development workflow.

#### Steps to Reproduce

1. Open a WSL 2 terminal (e.g., Ubuntu).

2. Execute the base command: `agy`

3. Complete the authentication flow via the browser on the host Windows machine. Then exit.

4. Run `agy` again.

5. The CLI immediately requests authentication again instead of recognizing the active session.

#### Expected Behavior

The CLI should securely persist the session state within the Linux environment after the initial authentication, allowing subsequent `agy` commands to run without repeatedly triggering the login prompt.

#### Environment

- **OS** : Windows (Host)

- **Subsystem** : WSL 2 (Ubuntu 22.04.5 LTS)

- **Tool** : Antigravity CLI (`agy`)

---

<div class="post-metadata">

**Author:** ![nobodie](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/nobodie/32/123414_2.png) [@nobodie](https://discuss.ai.google.dev/u/nobodie)\
**Post date:** [May 20, 2026, 9:46am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/2 "2026-05-20T09:46:34Z")

</div>

I have the same problem. When I paste the login code from the browser into the Antigravity CLI, it gets stuck on ‘Signing In…’

---

<div class="post-metadata">

**Author:** ![Alex\_Hagdahl](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/alex_hagdahl/32/31627_2.png) [@Alex\_Hagdahl](https://discuss.ai.google.dev/u/Alex_Hagdahl)\
**Post date:** [May 21, 2026, 7:54am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/3 "2026-05-21T07:54:38Z")

</div>

I had the same issue too.

Antigravity itself told me its because WSL is headless and is missing the OS keyring to save the CLI tokens in.

I managed to fix it by installing gnome-keyring.

`sudo apt update && sudo apt install -y dbus-x11 libsecret-1-0 gnome-keyring`

And then adding this to my `.bashrc` to start the keyring service

```auto
if [-n "$BASH_VERSION"]; then
    export $(dbus-launch)
    eval "$(echo "" | gnome-keyring-daemon --unlock)"
    eval "$(gnome-keyring-daemon --start)"
    export SSH_AUTH_SOCK
fi

```

---

<div class="post-metadata">

**Author:** ![John\_Karter](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/john_karter/32/31744_2.png) [@John\_Karter](https://discuss.ai.google.dev/u/John_Karter)\
**Post date:** [May 21, 2026, 6:20pm UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/4 "2026-05-21T18:20:51Z")

</div>

In a headless WSL environment, `gnome-keyring` creates an encrypted `login.keyring` file by default. Because there is no graphical display manager (GDM) to unlock it automatically during login, the keyring becomes locked, and your user/root password will not work to open it. This causes the CLI to hang or prompt for an unreachable password on subsequent restarts.

**The Solution (Create an Unencrypted Keyring for WSL):**  
Since WSL runs inside an already secure Windows environment, the easiest fix is to wipe the encrypted keyring and force `gnome-keyring` to save tokens without an extra password.

1. **Delete the current encrypted files:**

2. **Completely restart WSL** (run this in Windows PowerShell, not WSL):

3. **Open your WSL terminal again** and force initialize an unencrypted keyring:

4. **Log back.**

The CLI will now save your session tokens in a blank-password keyring. It will work flawlessly across WSL restarts without ever asking for a password again.

---

<div class="post-metadata">

**Author:** ![Su\_Mark](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/su_mark/32/124879_2.png) [@Su\_Mark](https://discuss.ai.google.dev/u/Su_Mark)\
**Post date:** [May 22, 2026, 3:19am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/5 "2026-05-22T03:19:38Z")

</div>

How proud Google is, to make such a low-level mistake

---

<div class="post-metadata">

**Author:** ![chunduriv](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@chunduriv](https://discuss.ai.google.dev/u/chunduriv)\
**Post date:** [May 23, 2026, 2:09am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/6 "2026-05-23T02:09:14Z")

</div>

Hey All,

This issue has been resolved in version 1.0.1. Please restart the `agy` to apply the update or manually run the `agy update`.

---

<div class="post-metadata">

**Author:** ![ghanta1996](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ghanta1996/32/136038_2.png) [@ghanta1996](https://discuss.ai.google.dev/u/ghanta1996)\
**Post date:** [July 9, 2026, 6:50am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/7 "2026-07-09T06:50:18Z")

</div>

I’m using v1.1.0 in Ubuntu 22. I have the same issue. Every time I open `agy` it asks me to log in.
