Codex thinks its running as root

Resolved 💬 1 comment Opened Jan 15, 2026 by lisa-croxford-srtmarine Closed Jan 17, 2026

What version of Codex is running?

codex-cli 0.84.0

What subscription do you have?

enterprise, part of a team

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Linux 6.18.5-arch1-1 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

warp and konsole

What issue are you seeing?

Started getting weird issues running gradle tasks using the the IntelliJ MCP

Codex then tried to work around by trying to write to /root/.gradle which would not work.

If i ask it to run "whoami" it reports itself as root, it is using the build in execut command

› When you ran "whoami" did you use the intellij tool?

• No, I used the shell command tool (functions.shell_command).

When I asked it to use the intellij MCP to execute shell commands it works okay

What steps can reproduce the bug?

Uploaded thread: 019bc20b-dce7-7702-9793-6c8b875480e2

  1. Run as a normal user,
  2. Verify with "whoami" ---> my username (lisa)
  3. Launch codex "code"
  4. Ask codex to run "whoami"
  5. Codex reports "root"

In another shell use ps -aux to verify it is running as "lisa":

lisa      171507  0.0  0.2 748676 268168 ?       Ssl  13:46   0:00 /usr/bin/kate -b /home/lisa/.codex/config.toml
lisa      402133  0.0  0.0 760664 43400 pts/1    Sl+  17:07   0:00 node /home/lisa/.nvm/versions/node/v20.19.0/bin/codex
lisa      402144  0.5  0.0 150140 63436 pts/1    Sl+  17:07   0:04 /home/lisa/.nvm/versions/node/v20.19.0/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex
lisa      417822  0.0  0.0   6956  4228 pts/4    S+   17:22   0:00 grep --colour=auto codex

What is the expected behavior?

It should run shell commands as the user who launched the shell

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗