codex - 💡(How to fix) Fix Windows sandboxed sessions cannot access valid gh keyring auth that works in full-access mode

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

On Windows, gh auth status fails in a sandboxed Codex shell session with an invalid token error, but succeeds in a full-access session on the same machine for the same user and the same gh binary.

Code Example

gh auth login -h github.com

---

gh auth status

---

gh auth status

---

where.exe gh
   cmdkey /list

---

github.com
  X Failed to log in to github.com account <account> (default)
  - Active account: true
  - The token in default is invalid.

---

github.com
  ? Logged in to github.com account <account> (keyring)
RAW_BUFFERClick to expand / collapse

Description

On Windows, gh auth status fails in a sandboxed Codex shell session with an invalid token error, but succeeds in a full-access session on the same machine for the same user and the same gh binary.

This appears to be a sandbox/session integration issue with Windows Credential Manager or keyring visibility, not a GitHub CLI auth problem.

Environment

  • OS: Windows
  • Codex CLI: 0.129.0-alpha.15
  • GitHub CLI installed and already authenticated
  • gh binary path in both contexts: C:\Program Files\GitHub CLI\gh.exe

Steps to reproduce

  1. Authenticate GitHub CLI on Windows:

    gh auth login -h github.com
  2. Confirm auth works in a normal or full-access context:

    gh auth status
  3. Run the same command from a sandboxed Codex shell session:

    gh auth status
  4. Compare diagnostics in both contexts:

    where.exe gh
    cmdkey /list

Expected behavior

A sandboxed Codex session should be able to use the same valid GitHub CLI login as a full-access session for the current Windows user.

gh auth status should succeed in both contexts.

Actual behavior

In the sandboxed session:

github.com
  X Failed to log in to github.com account <account> (default)
  - Active account: true
  - The token in default is invalid.

In the full-access session:

github.com
  ? Logged in to github.com account <account> (keyring)

Additional difference:

  • In sandboxed session, cmdkey /list did not show the expected GitHub CLI credential targets.
  • In full-access session, cmdkey /list showed entries like:
    • LegacyGeneric:target=gh:github.com:<account>
    • LegacyGeneric:target=gh:github.com:

Notes

  • The same gh binary was used in both contexts.
  • GitHub CLI host metadata was present at %APPDATA%\GitHub CLI\hosts.yml.
  • This looks like the sandboxed session cannot access the same Windows credential/keyring context that full-access can.

Impact

This breaks GitHub-dependent Codex workflows on Windows in sandboxed mode even when gh auth is valid outside sandbox.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING