Skip to content

ChatGPT Linux bundled 0.155.0-alpha.16.4 sandbox cannot re-exec Codex inside bwrap #47941

Open

Description

@TaskPuppyNatani

What version of the Codex App are you using?

ChatGPT Linux desktop with bundled:

codex-cli 0.155.0-alpha.16.4

Bundled binary:

/usr/lib/chatgpt/resources/codex

What subscription do you have?

Plus

What platform is your computer?

Native Linux x86_64 desktop.

What issue are you seeing?

After updating to the ChatGPT-bundled codex-cli 0.155.0-alpha.16.4, the previous mountinfo path is not absolute failure no longer reproduces, but the Linux sandbox is still unusable.

The bundled Codex binary now gets far enough to invoke Bubblewrap, but Bubblewrap cannot re-execute Codex inside the generated sandbox namespace:

bwrap: execvp /usr/lib/chatgpt/resources/codex: No such file or directory

The binary definitely exists and is executable on the host:

$ /usr/lib/chatgpt/resources/codex --version
codex-cli 0.155.0-alpha.16.4

$ ls -l /usr/lib/chatgpt/resources/codex
-rwxr-xr-x 1 root root 280952392 Sep 23 14:29 /usr/lib/chatgpt/resources/codex

System Bubblewrap itself works:

$ bwrap --ro-bind / / /bin/true
$ echo $?
0

The standalone Codex CLI on the same machine also has a working sandbox. To avoid config-version incompatibility with the installed older CLI, I tested it with a clean CODEX_HOME:

$ which codex
/home/natani/.local/bin/codex

$ codex --version
codex-cli 0.147.0

$ mkdir -p ~/codex-test-home

$ CODEX_HOME=~/codex-test-home codex sandbox /bin/true
$ echo $?
0

By contrast, the ChatGPT-bundled CLI fails:

$ /usr/lib/chatgpt/resources/codex sandbox /bin/true
bwrap: execvp /usr/lib/chatgpt/resources/codex: No such file or directory

$ echo $?
1

I also copied the exact bundled binary into the home directory to test whether this was specific to /usr/lib/chatgpt/resources:

$ cp --reflink=auto /usr/lib/chatgpt/resources/codex ~/codex-sandbox-test
$ chmod +x ~/codex-sandbox-test
$ ~/codex-sandbox-test sandbox linux -- /bin/true
bwrap: execvp /home/natani/codex-sandbox-test: No such file or directory

$ echo $?
1

So this does not appear to be specific to the original install directory. The sandbox is attempting to re-exec the current Codex binary, but the generated Bubblewrap filesystem does not expose that executable path.

What steps can reproduce the bug?

  1. On ChatGPT Linux desktop with bundled codex-cli 0.155.0-alpha.16.4, confirm the bundled version:
/usr/lib/chatgpt/resources/codex --version
  1. Run a minimal sandbox command:
/usr/lib/chatgpt/resources/codex sandbox /bin/true
echo $?
  1. Observe:
bwrap: execvp /usr/lib/chatgpt/resources/codex: No such file or directory
1
  1. Confirm Bubblewrap itself works:
bwrap --ro-bind / / /bin/true
echo $?

Expected result:

0

What is the expected behavior?

/usr/lib/chatgpt/resources/codex sandbox /bin/true should successfully construct the Linux sandbox, execute /bin/true, and exit with status 0.

The sandbox should ensure that the Codex executable/helper path it needs to re-exec remains visible inside the Bubblewrap namespace.

Additional information

This appears to be a follow-on failure after the fix for #47345.

On the previous bundled 0.155.0-alpha.16, this machine failed earlier with:

error building bubblewrap command: mountinfo path is not absolute

With 0.155.0-alpha.16.4, that specific error no longer appears. Sandbox setup proceeds farther and now fails at self-exec with ENOENT instead.

The symptom is similar to older reports where the Codex runtime path exists on the host but is omitted from the Bubblewrap namespace, including #17367 and #20906.

The A/B comparison on the same host is:

system bwrap                         works
standalone codex-cli 0.147.0        works
ChatGPT bundled 0.155.0-alpha.16.4  fails self-exec inside bwrap

No system mounts, Bubblewrap configuration, or sandbox protections were changed to obtain these results.

Activity

  1. added
    bug
    CLI
    sandbox
    on Sep 24, 2026
  2. TaskPuppyNatani commented on Sep 25, 2026

    @TaskPuppyNatani
    Author

    Confirmed workaround/root cause evidence on native Linux.

    I was able to make the exact ChatGPT-bundled Codex binary succeed without changing Bubblewrap or the system by adjusting the active Codex permission profile so the sandbox can read Codex's own runtime directory.

    Broken state:

    $ /usr/lib/chatgpt/resources/codex sandbox /bin/true
    bwrap: execvp /usr/lib/chatgpt/resources/codex: No such file or directory
    $ echo $?
    1

    Minimal isolated test that succeeds:

    default_permissions = "project-edit"
    
    [permissions.project-edit]
    extends = ":workspace"
    
    [permissions.project-edit.filesystem]
    "/usr/lib/chatgpt/resources" = "read"

    With that disposable config:

    $ CODEX_HOME=~/codex-bundled-only-test \
      /usr/lib/chatgpt/resources/codex sandbox /bin/true
    $ echo $?
    0

    I then applied the equivalent settings to the real active profile:

    [permissions.project-edit]
    extends = ":workspace"
    
    [permissions.project-edit.filesystem]
    "/usr/lib/chatgpt/resources" = "read"

    After that, the real bundled binary also succeeds:

    $ /usr/lib/chatgpt/resources/codex sandbox /bin/true
    $ echo $?
    0

    I fully restarted ChatGPT Desktop and verified normal GUI Codex tool execution again. A read-only prompt successfully ran pwd and git status in the project without modification.

    Additional finding: current standalone Codex 0.156.1 showed the same class of failure at its own runtime path:

    bwrap: execvp /home/natani/.codex/packages/standalone/releases/0.156.1-x86_64-unknown-linux-musl/bin/codex: No such file or directory
    

    Granting read access to /home/natani/.codex/packages/standalone in the same style of permission profile made the standalone sandbox test return 0 as well.

    One intermediate failure was also informative: after adding the runtime read rule to my real project-edit profile but before adding extends = ":workspace", Codex could see itself but then panicked trying to exec /bin/true:

    Failed to execvp /bin/true: No such file or directory (os error 2)
    

    Adding extends = ":workspace" restored the normal filesystem baseline while keeping the explicit runtime read permission.

    This strongly suggests the generated Linux sandbox filesystem policy is omitting the Codex runtime path itself. Explicitly exposing that runtime path fixes both the ChatGPT-bundled binary and current standalone 0.156.1 on this host.

  3. TaskPuppyNatani commented on Sep 25, 2026

    @TaskPuppyNatani
    Author

    Thanks for taking a look! My observed failure was ENOENT during Codex's self-exec, rather than EPERM while creating a nested namespace. Explicitly granting read access to Codex's runtime directory within the existing permission profile resolves the issue without changing the sandbox architecture. Both the bundled and standalone versions now pass the sandbox test on this host.

  4. Q2Q8-Project commented on Oct 9, 2026

    @Q2Q8-Project

    Additional confirmation on Linux ARM64 (aarch64) — both sandbox failures resolved

    I reproduced both failures on Linux ARM64 using:

    • ChatGPT-bundled Codex CLI 0.162.0-alpha.2
    • Standalone Codex CLI 0.157.0
    • Bubblewrap 0.9.0

    Finding 1 — Legacy Landlock

    With features.use_legacy_landlock=true, sandboxed execution consistently panicked:

    filesystem-restricted execution requires bubblewrap to isolate app-server sockets

    Setting this option to false eliminated that panic.

    Finding 2 — Permission profile inheritance

    With legacy=false, a custom empty profile (permissions.test={}) caused the Bubblewrap self-execution error (ENOENT).

    Adding extends=":workspace" resolved it. On this ARM64 installation, an additional explicit read rule for the Codex runtime directory was not required.

    Final verification

    After updating the main configuration and restarting the ChatGPT GUI, sandboxed command execution succeeded.

    Local tests confirmed:

    • Writing inside the authorized workspace: PASS
    • Writing outside the workspace: DENIED
    • Writing into the home directory or /etc: DENIED
    • Network namespace: loopback only, no routes observed

    No external network egress test was performed.

    Conclusion: Both failures were resolved locally without modifying system AppArmor settings, disabling the sandbox, or granting full filesystem access.

    These results confirm the workaround on ARM64, although they do not establish that the underlying issue is fixed upstream.

    Thanks to everyone who contributed to this thread, especially @TaskPuppyNatani and @shleder. @TaskPuppyNatani, your careful reproduction and permission-profile workaround were key to resolving the self-exec failure on this ARM64 installation. @shleder, thank you for the additional technical explanation of sandbox filesystem visibility, self-exec paths, and for helping clarify the distinction between ENOENT and namespace-related EPERM failures. The discussion was genuinely helpful in isolating the two issues without weakening the sandbox.

  5. lachesis commented on Oct 9, 2026

    @lachesis

    Okay... but did you test reading random directories from your home? The :workspace permissions allow global read, including files like ~/.ssh.

    I'm experiencing this same issue on latest codex. Someone probably ought to fix it to use /usr/bin/codex or to add the proper sub-directories of ~/.codex to minimal (though ideally not all transcripts, as I wouldn't want one codex session to read transcripts for a different one).

    Broken: codex-cli 0.162.1

    Worked: codex-cli 0.154.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions