Skip to content

Restricted filesystem profiles can block Codex's own runtime binary #29049

Open

Description

@alma-iceee

What version of Codex CLI is running?

codex-cli 0.141.0

What subscription do you have?

plus

Which model were you using?

Not model-related

What platform is your computer?

Linux 7.0.0-22-generic x86_64 unknown

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

Not terminal-related

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1781849955s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.141.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/progse/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/progse/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/progse/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/progse/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/progse/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/home/progse/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/home/progse/.codex",
        "config.toml": "/home/progse/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/home/progse/Projects/platform",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_suggest, plugins, in_app_browser, browser_use, browser_use_external, computer_use, plugin_sharing, image_generation, skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "29",
        "log dir": "/home/progse/.codex/log",
        "mcp servers": "0",
        "model": "gpt-5.4",
        "model provider": "openai",
        "sqlite home": "/home/progse/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.53.0",
      "details": {
        ".git entry": "directory",
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/bin/git",
        "PATH git entries": "2",
        "git branch": "main",
        "git build options": "git version 2.53.0; cpu: x86_64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; rust: disabled; gettext: enabled; libcurl: 8.18.0; zlib: 1.3.1; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
        "git exec path": "/usr/lib/git-core",
        "git version": "git version 2.53.0",
        "repo detected": "true",
        "repo root": "/home/progse/Projects/platform",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 75
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/home/progse/.local/bin/codex",
        "PATH codex #2": "/home/progse/.local/bin/codex",
        "PATH codex #3": "/home/progse/.local/bin/codex",
        "PATH codex entries": "3",
        "current executable": "/home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/bin/codex",
        "install context": "standalone (unix, package /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl, bin /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/bin, resources /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/codex-resources, path /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed package root": "not set"
      },
      "remediation": null,
      "durationMs": 1
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "no MCP servers configured",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 203
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv4",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 1618
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running standalone on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/bin/codex",
        "install method": "standalone (unix, package /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl, bin /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/bin, resources /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/codex-resources, path /home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/codex-path)",
        "platform": "linux-x86_64",
        "version": "0.141.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/home/progse/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "/home/progse/.codex/tmp/arg0/codex-arg0QbNeW4/codex-linux-sandbox",
        "execve wrapper helper": "/home/progse/.codex/tmp/arg0/codex-arg0QbNeW4/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/home/progse/.codex (dir)",
        "active rollout files": "19 files, 52922558 total bytes, 2785397 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/home/progse/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/home/progse/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/home/progse/.codex/log (missing)",
        "memories DB": "/home/progse/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/home/progse/.codex (dir)",
        "standalone release cache": "4 entries in /home/progse/.codex/packages/standalone/releases",
        "state DB": "/home/progse/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 882
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "ok",
      "summary": "rollout files and state DB thread inventory agree",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "19",
        "rollout DB active rows": "19",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "0",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=19",
        "rollout DB rows": "19",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=19",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 810
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language en-US",
      "details": {
        "EDITOR": "not set",
        "LANG": "en_US.UTF-8",
        "VISUAL": "not set",
        "os": "Ubuntu 26.4.0 (resolute) [64-bit]",
        "os language": "en-US",
        "os type": "Ubuntu",
        "os version": "26.4.0"
      },
      "remediation": null,
      "durationMs": 33
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "DISPLAY": "present",
        "WAYLAND_DISPLAY": "present",
        "color output": "enabled",
        "effective locale": "en_US.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "Apple Terminal",
        "terminal size": "219x32"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "git repo root",
        "terminal title project value": "platform",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.141.0",
        "check for update on startup": "true",
        "last checked at": "2026-06-19T04:37:45.871871341Z",
        "latest version": "0.141.0",
        "latest version status": "current version is not older",
        "update action": "standalone installer",
        "version cache": "/home/progse/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 852
    }
  }
}

What issue are you seeing?

When using a custom filesystem profile with restricted permissions, Codex may fail to read files from explicitly allowed directories because it loses access to its own internal runtime binary inside the sandbox.

I hit an error like this:

bwrap: execvp /home/user/.codex/packages/standalone/releases//bin/codex: No such file or directory

The binary did exist on disk.

What steps can reproduce the bug?

Example setup

A profile allowed:

  • read access to a limited project subdirectory such as agents/
  • write access to a subdirectory such as agents/inbox/

Example:

approval_policy = "never"
default_permissions = "restricted_agent"
web_search = "disabled"
allow_login_shell = false

project_root_markers = ["agents/PROJECT_CONTEXT.md"]
model_instructions_file = "/home/user/projects/sample-app/agents/ROLE.md"

[permissions.restricted_agent.filesystem]
":minimal" = "read"

[permissions.restricted_agent.filesystem.":workspace_roots"]
"agents" = "read"
".claude" = "read"
"agents/inbox" = "write"

[permissions.restricted_agent.network]
enabled = false

Then asking Codex to read a file from the allowed directory, such as:

/home/user/projects/sample-app/agents/AGENTS.md

failed with the error above.

What is the expected behavior?

Codex should automatically retain access to its own internal runtime/binary paths when applying a custom filesystem profile.

Users should not need to manually whitelist internal .codex/.../releases/... paths just to make basic file reads work.

Additional information

Workaround

The problem went away only after explicitly granting read access to Codex?s own release path, for example:

[permissions.restricted_agent.filesystem]
":minimal" = "read"
"/home/user/.codex/packages/standalone/releases/" = "read"

Why this seems like a bug

The target project directory was explicitly allowed, and the target file existed. The failure only happened because Codex apparently could not access its own runtime binary inside the sandbox. That feels like an internal dependency Codex should preserve automatically.

Activity

  1. added
    bug
    on Jun 19, 2026
  2. added
    CLI
    sandbox
    on Jun 19, 2026
  3. laptchik commented on Aug 23, 2026

    @laptchik

    Confirmed this is still reproducible on codex-cli 0.149.0 on Linux with an npm/NVM installation.

    In a restricted custom permission profile, app-server command/exec fails before the requested command starts:

    bwrap: execvp /home/<user>/.nvm/.../@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex: No such file or directory
    

    The native binary exists and is executable on the host. This looks closely related to #20906 as well.

    One additional detail from investigating a possible workaround: codex doctor --json reports codex-linux-sandbox under a path like:

    ~/.codex/tmp/arg0/codex-arg0XXXXXX/codex-linux-sandbox
    

    That helper path is process-lifetime temporary state. The arg0 temp directory is retained only for the lifetime of that Codex process, so a helper path obtained from a separate codex doctor invocation is not stable provenance for a later app-server process.

    Current upstream main appears to handle this at the correct ownership boundary by carrying the live codex_self_exe / codex_linux_sandbox_exe runtime paths into sandbox setup and exposing them as readable roots internally.

    So from this reproduction:

    • still present in released 0.149.0;
    • reproducible with npm/NVM, not only standalone installs;
    • manually whitelisting an externally discovered helper path is not a robust workaround because the arg0 helper is ephemeral.
  4. laptchik commented on Aug 23, 2026

    @laptchik

    Follow-up with a proven root cause and local fix against rust-v0.149.0.

    The existing runtime-readable-root augmentation in exec-server/process_sandbox.rs is correct, but app-server command/exec bypasses exec-server::prepare_exec_request. Its direct local execution path therefore never received the same codex_self_exe / codex_linux_sandbox_exe readable-root augmentation.

    I implemented the minimal fix locally by extracting that augmentation into a shared helper and applying it from both exec-server and direct app-server command/exec. The direct path takes the live executor-owned runtime paths, adds only those exact files as read-only roots, does not grant their parent directories or runtime write access, and preserves enforcement/network semantics.

    Validation on Linux:

    • focused runtime-permission regression: PASS — both runtime executables readable, neither writable, parent directories remain denied, network semantics unchanged;
    • production app-server JSON-RPC command/exec regression under a restricted profile: PASS (1 passed, 1236 skipped).

    One regression-fixture detail worth noting: a dynamically linked local codex-app-server test binary still needs the platform :minimal runtime (ELF loader/shared libraries/sh). Omitting that can also surface as execvp <app-server>: No such file or directory, even when the executable itself is mounted.

    Current main was also inspected and still appeared to retain this direct command/exec bypass at the time of testing.

    I can provide the exact seven-file experimental diff/regression shape if useful; OpenAI's contributing guidance says external PRs are not accepted, so I kept this as local proof rather than opening one.

    Patch shape:

    • exec-server/src/runtime_permissions.rs
      Extract the existing runtime-readable-root augmentation into a shared helper
      taking the effective PermissionProfile plus:

      • codex_self_exe
      • optional codex_linux_sandbox_exe
    • exec-server/src/process_sandbox.rs
      Replace the local augmentation with the shared helper.

    • app-server/src/request_processors/command_exec_processor.rs
      For local command/exec, obtain the live executor-owned runtime paths from the
      selected Environment and apply the same helper before build_exec_request.

    • Regression coverage:

      • exact runtime files readable
      • runtime files not writable
      • parent directories remain denied
      • network semantics unchanged
      • production JSON-RPC command/exec starts successfully under a restricted profile
  5. laptchik commented on Sep 2, 2026

    @laptchik

    Re-tested this on codex-cli 0.152.1 on Linux with the same restricted-filesystem command/exec gate.

    The issue is still reproducible unchanged.

    Profile generation and activation succeed, thread/start succeeds, and the expected workspace/auxiliary roots and disabled-network policy are represented correctly. However, all actual command/exec attempts still fail before the requested command starts with the same runtime self-visibility error:

    bwrap: execvp /home/<user>/.nvm/.../@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex: No such file or directory
    

    So as of released 0.152.1, the direct app-server command/exec path still appears unable to re-execute Codex's own native runtime under the restricted filesystem profile.

    No permission broadening or workaround was used for this re-test.

  6. Exlonk commented on Sep 17, 2026

    @Exlonk

    This bug is still alive.

  7. mirumirumi commented on Sep 19, 2026

    @mirumirumi

    I can reproduce this with the new Codex Agent Host integration in VS Code 1.138.

    Environment:

    • Windows 11 with WSL2
    • VS Code 1.138
    • ChatGPT subscription
    • Agent Host bundled Codex CLI 0.153.0

    With the default restricted permissions, even pwd fails:

    bwrap: execvp /home/<user>/.vscode-server/data/agent-host/sdk-cache/codex/0.153.0/linux-x64/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex: No such file or directory
    

    The binary exists, is executable, and runs normally outside the sandbox:

    Access: (0755/-rwxr-xr-x)
    
    $ "$BIN" --version
    codex-cli 0.153.0
    

    Switching the session permissions to Full Access makes commands work immediately.

    The native Codex CLI and the official Codex VS Code extension both work correctly in the same WSL environment. Only VS Code's built-in Codex Agent Host integration fails.

    This suggests that the restricted filesystem profile hides the Agent Host-downloaded Codex runtime from the bubblewrap namespace.

  8. Misairu-G commented on Sep 27, 2026

    @Misairu-G

    For ppl using codex through VSCode agent host, here is a verified workaround using a wrapper script that:

    1. give explicit read permission for codex runtime
    2. give explicit read permission for .vscode-server/data/agentSessionData, since I believe many ppl use agent host for auto-attach context, where is passed through here instead of using actual workspace path

    Work around steps:

    1. rename the original codex to something else, e.g. mv /home/<your-user>/.vscode-server/data/agent-host/sdk-cache/.../bin/codex mv /home/<your-user>/.vscode-server/data/agent-host/sdk-cache/.../bin/real-codex
    2. create a script and make it executable as /home/<your-user>/.vscode-server/data/agent-host/sdk-cache/codex/.../bin/codex with the below content
    #!/usr/bin/env bash
    set -euo pipefail
    
    REAL_CODEX="/home/<your-user>/.vscode-server/data/agent-host/sdk-cache/.../bin/real-codex"
    
    exec "$REAL_CODEX" \
      "$@" \
      -c 'permissions.vscode-workspace.filesystem./home/<your-user>={ 
        ".vscode-server/data/agent-host/sdk-cache/codex/.../x86_64-unknown-linux-musl/bin" = "read", 
        ".vscode-server/data/agentSessionData" = "read" 
      }'

    TL;DR:

    1. the regular ~/.codex/config.toml won't work since the agent host codex runtime override the default permission explicitly, check via ps aux | grep 'app-server' | grep codex and you'll see all the args vscode passed in
    2. vscode-workspace is the permission profile name agent host hard-coded on launching agent host codex runtime
    3. .vscode-server/data/agentSessionData has subfolder that's session based, however the session name is only determined on chat execution, where codex sandbox is already spawned with permission attached, and I haven't found a way to only pass session specific data yet
    4. my env: codex 0.153.0, vscode 1.139.1, Ubuntu 24.04 WSL, Windows 11
  9. kdelacruz94 commented on Oct 4, 2026

    @kdelacruz94

    Adding a zero-model-call reproduction of this on Linux with codex-cli 0.159.x (native Linux and WSL2): codex sandbox -P <profile> cannot re-exec Codex itself when the profile's readable roots exclude the install prefix.

    Summary

    A named permission profile without root read access can prevent codex sandbox from executing its own Codex binary inside bubblewrap. The executable exists on the host, but is absent from the generated sandbox filesystem. The command fails before /bin/true runs:

    bwrap: execvp <codex-install>/bin/codex: No such file or directory
    

    <codex-install> replaces the installation prefix for privacy. The failure has been observed on native Linux and WSL2. This report concerns the CLI sandbox helper; it does not assert that all profiles or agent execution modes fail.

    Environment

    Both installations use the npm-distributed Linux Codex executable.

    Environment Codex CLI OS Linux kernel System bubblewrap Evidence
    A 0.159.1 CachyOS, rolling, native Linux 7.2.8-2-cachyos 0.13.0 Fresh confirmation on 2026-10-03; previously reproduced on 2026-10-01
    B 0.159.0 Linux under WSL2 on Windows 11 6.18.33.2-microsoft-standard-WSL2 0.13.0 Previous investigation on 2026-10-01; not rerun for this draft

    The WSL distribution name/version was not recorded; the kernel and WSL2 execution environment above are recorded evidence. No model, authentication, or API request is required for these commands.

    Original minimal configuration — reproduced on both environments

    In an isolated CODEX_HOME, the original reproduction used:

    [permissions.scoped]
    sandbox_mode = "workspace-write"
    approval_policy = "never"

    These nested legacy keys are accepted by the tested CLI, but are not documented permission-profile fields. Consequently, this configuration alone must not be interpreted as a correctly defined workspace-write profile. The documented-schema reproduction below avoids that ambiguity.

    With this configuration saved as repro-config/config.toml beneath the current directory, the one-line invocation is:

    CODEX_HOME="$PWD/repro-config" codex sandbox -P scoped -- /bin/true

    A self-contained, shell-portable invocation of the same original case follows. Run it from a writable directory; it creates and removes only its own scratch directory, and leaves the usual Codex configuration untouched. The explicit bash -c wrapper also permits invoking it from fish.

    bash -c 'd=$(mktemp -d "$PWD/.codex-sandbox-repro.XXXXXX") || exit; trap "rm -rf -- \"$d\"" EXIT; printf "[permissions.scoped]\nsandbox_mode = \"workspace-write\"\napproval_policy = \"never\"\n" > "$d/config.toml"; cd "$d" || exit; CODEX_HOME="$d" codex sandbox -P scoped -- /bin/true'

    The original profile/invocation was confirmed on A and B in the earlier investigation. Both displayed command forms were rechecked on A for this draft; the self-contained packaging was not rerun on B.

    Reproduction with documented permission-profile syntax — environment A

    Use this as the complete isolated config.toml instead:

    [permissions.scoped.filesystem]
    ":minimal" = "read"

    Run the same one-line invocation:

    CODEX_HOME="$PWD/repro-config" codex sandbox -P scoped -- /bin/true

    This also exits 1 with the same missing-Codex error. A captured bubblewrap invocation includes read-only binds of /bin, /etc, /lib, /lib64, /sbin, and /usr, plus bundled zsh, but no bind of the home-installed Codex executable. /bin/true is within the requested readable system paths; the failure names Codex itself.

    Permission-profile filesystem, :minimal, and extends are described in the official configuration reference.

    Expected behavior

    A supported restricted-readable-root profile should retain the internal runtime access needed to enter the sandbox and execute an allowed command, without requiring users to track and whitelist versioned Codex installation paths or grant root read access. For the documented profile above, /bin/true should complete with exit status 0.

    If the original legacy-key configuration is unsupported, it should receive a clear configuration diagnostic rather than proceeding to a misleading missing-binary error.

    Actual behavior and controls

    Fresh results on environment A, each with its own isolated CODEX_HOME:

    Configuration / command Exit status Result
    Original [permissions.scoped] configuration, -P scoped 1 Codex self-exec fails inside bubblewrap
    Documented filesystem with ":minimal" = "read", -P scoped 1 Same failure
    Documented filesystem allowing /usr, /bin, /lib, /lib64, -P scoped 1 Same failure
    Documented filesystem with "/" = "read", -P scoped 0 /bin/true executes
    [permissions.scoped] with extends = ":workspace", -P scoped 0 /bin/true executes
    Empty config, codex sandbox -c sandbox_mode=workspace-write -- /bin/true 0 /bin/true executes

    Therefore this is not a general bubblewrap installation failure or a failure of every named profile. Working profiles here grant broader reads; they do not demonstrate a working restricted-read allowlist.

    Bubblewrap evidence

    A temporary PATH shim recorded bubblewrap's arguments and then delegated unchanged to the system bubblewrap binary. Relevant mount differences:

    Case Root mount Relevant visible runtime paths
    Original profile --tmpfs / Only bundled zsh; Codex executable absent
    Documented :minimal profile --tmpfs / System directories and bundled zsh; home-installed Codex executable absent
    Root-read profile --ro-bind / / Codex executable visible
    Legacy -c sandbox_mode=workspace-write control --ro-bind / / Codex executable visible

    All cases invoke the inner Codex stage with --apply-seccomp-then-exec -- /bin/true. The restricted cases never reach that stage. The measured argument differences support the diagnosis that sandbox construction does not preserve the required inner executable under a restricted read set; this is a runtime observation, not a source-code audit.

    Existing reports / duplicate search

    Searched open and closed openai/codex issues on 2026-10-03 before reproducing:

    The closest issue appears to describe the same defect; these findings can be attached there instead of opening a duplicate.

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

    CLILinuxbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions