Codex shell execution does not match real user session (1Password/op + glab), causing auth mismatches

Resolved 💬 2 comments Opened Mar 1, 2026 by dzwicker Closed Mar 1, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

I’m reporting a reproducible workflow issue that makes Codex unreliable for real developer automation.

In my normal terminal, zsh + op + glab work correctly (same directory, same hooks, same token resolution).
In Codex-run commands, even with login/interactive zsh attempts, the environment is different:

1Password desktop app integration is not reliably available
op://-based secret loading behaves differently
glab resolves to a different auth context than in my actual terminal
group/project access checks fail in Codex while succeeding locally
This leads to repeated failures and manual copy/paste fallbacks, which defeats the purpose of agent automation.

Expected behavior

Codex should be able to run in the exact same effective shell/session context as the user’s terminal (including keychain/app bridges and shell hooks), or
clearly expose a “true user session mode” for auth-sensitive developer workflows.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 6 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #12095

Powered by Codex Action

etraut-openai contributor · 5 months ago

The difference you're seeing are likely due to the limitations imposed by the sandbox. You'll need to investigate this further yourself if you want to diagnose why your particular tools behave differently within the sandbox. It's likely that they need to access some resource (networking, writes to files outside of your project, or other system calls that are restricted by the sandbox). It's also possible that this is related to environment variables defined in your environment.

In any case, this is probably not something that we will be able to investigate because we won't be able to repro your exact environment.