Repository navigation
Description
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
chore(codex): disable generated permission profiles
laptchik commentedon Aug 23, 2026
Confirmed this is still reproducible on
codex-cli 0.149.0on Linux with an npm/NVM installation.In a restricted custom permission profile, app-server
command/execfails before the requested command starts: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 --jsonreportscodex-linux-sandboxunder a path like: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 doctorinvocation is not stable provenance for a later app-server process.Current upstream
mainappears to handle this at the correct ownership boundary by carrying the livecodex_self_exe/codex_linux_sandbox_exeruntime paths into sandbox setup and exposing them as readable roots internally.So from this reproduction:
0.149.0;laptchik commentedon Aug 23, 2026
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.rsis correct, but app-servercommand/execbypassesexec-server::prepare_exec_request. Its direct local execution path therefore never received the samecodex_self_exe/codex_linux_sandbox_exereadable-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:
command/execregression under a restricted profile: PASS (1 passed,1236 skipped).One regression-fixture detail worth noting: a dynamically linked local
codex-app-servertest binary still needs the platform:minimalruntime (ELF loader/shared libraries/sh). Omitting that can also surface asexecvp <app-server>: No such file or directory, even when the executable itself is mounted.Current
mainwas also inspected and still appeared to retain this directcommand/execbypass 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:
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:
fix(flow): grant codex's own runtime in the delegated sandbox profile
laptchik commentedon Sep 2, 2026
Re-tested this on
codex-cli 0.152.1on Linux with the same restricted-filesystemcommand/execgate.The issue is still reproducible unchanged.
Profile generation and activation succeed,
thread/startsucceeds, and the expected workspace/auxiliary roots and disabled-network policy are represented correctly. However, all actualcommand/execattempts still fail before the requested command starts with the same runtime self-visibility error:So as of released
0.152.1, the direct app-servercommand/execpath 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.
Exlonk commentedon Sep 17, 2026
This bug is still alive.
mirumirumi commentedon Sep 19, 2026
I can reproduce this with the new Codex Agent Host integration in VS Code 1.138.
Environment:
With the default restricted permissions, even
pwdfails:The binary exists, is executable, and runs normally outside the sandbox:
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.
Misairu-G commentedon Sep 27, 2026
For ppl using codex through VSCode agent host, here is a verified workaround using a wrapper script that:
.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 pathWork around steps:
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/home/<your-user>/.vscode-server/data/agent-host/sdk-cache/codex/.../bin/codexwith the below contentTL;DR:
~/.codex/config.tomlwon't work since the agent host codex runtime override the default permission explicitly, check viaps aux | grep 'app-server' | grep codexand you'll see all the args vscode passed invscode-workspaceis the permission profile name agent host hard-coded on launching agent host codex runtime.vscode-server/data/agentSessionDatahas 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 yetkdelacruz94 commentedon Oct 4, 2026
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 sandboxfrom 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/trueruns:<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.
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: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.tomlbeneath the current directory, the one-line invocation is:CODEX_HOME="$PWD/repro-config" codex sandbox -P scoped -- /bin/trueA 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 -cwrapper 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.tomlinstead:Run the same one-line invocation:
CODEX_HOME="$PWD/repro-config" codex sandbox -P scoped -- /bin/trueThis 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 bundledzsh, but no bind of the home-installed Codex executable./bin/trueis within the requested readable system paths; the failure names Codex itself.Permission-profile
filesystem,:minimal, andextendsare 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/trueshould 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:[permissions.scoped]configuration,-P scopedfilesystemwith":minimal" = "read",-P scopedfilesystemallowing/usr,/bin,/lib,/lib64,-P scopedfilesystemwith"/" = "read",-P scoped/bin/trueexecutes[permissions.scoped]withextends = ":workspace",-P scoped/bin/trueexecutescodex sandbox -c sandbox_mode=workspace-write -- /bin/true/bin/trueexecutesTherefore 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:
--tmpfs /zsh; Codex executable absent:minimalprofile--tmpfs /zsh; home-installed Codex executable absent--ro-bind / /-c sandbox_mode=workspace-writecontrol--ro-bind / /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/codexissues on 2026-10-03 before reproducing:default_permissions.The closest issue appears to describe the same defect; these findings can be attached there instead of opening a duplicate.