codex icon indicating copy to clipboard operation
codex copied to clipboard

Repeated "sudo: The 'no new privileges' flag is set" printed before every command

Open pforques opened this issue 3 weeks ago • 1 comments

What version of Codex is running?

codex-cli 0.64.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.1-codex-max

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 unknown

What issue are you seeing?

  • Any command executed through the Codex CLI prints multiple lines: sudo: The "no new privileges" flag is set, which prevents sudo from running as root... before the real output.
  • Example:
    • pwd → warning repeats 3x, then /home/orbisu
    • ls → warning repeats 3x, then apps, Downloads, projects, projects - Shortcut.lnk
    • codex --version → warning repeats 3x, then codex-cli 0.64.0

What steps can reproduce the bug?

  1. Start a Codex CLI session on WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2).
  2. Run any simple command (e.g., pwd, ls, codex --version).
  3. Observe that three sudo “no new privileges” warnings print before the actual command output.

What is the expected behavior?

  • Commands should run normally without sudo warnings when they don’t invoke sudo.

Additional information

The warnings appear even though the commands don’t call sudo explicitly. Environment is WSL2; sandbox mode workspace-write, network restricted.

Image

pforques avatar Dec 04 '25 09:12 pforques

The flag disappear when running sudo codex But of course I don't want to run codex as sudo. So I really need help on this one.

pforques avatar Dec 04 '25 09:12 pforques