Denying "slash_tmp" breaks Codex

Open 💬 3 comments Opened Aug 21, 2026 by JakubJaskulski

What version of Codex CLI is running?

codex-cli 0.149.0

What subscription do you have?

Business

Which model were you using?

GPT‑5.6

What platform is your computer?

Linux 7.0.0-28-generic x86_64 x86_64

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

kitty 0.32.2

Codex doctor report

~ ❯ codex doctor --json                                                                                                                              16:21:41
{
  "schemaVersion": 1,
  "generatedAt": "1787322162s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.149.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/jja/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/jja/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/jja/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/jja/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/jja/.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/jja/.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/jja/.codex",
        "config.toml": "/home/jja/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/home/jja",
        "enabled feature flags": "shell_tool, view_image, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, unbounded_connection_retries, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_chat, in_app_dictation, in_app_updates, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, item_ids, skill_mcp_dependency_install, skill_search, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "42",
        "log dir": "/home/jja/.codex/log",
        "mcp servers": "0",
        "model": "<default>",
        "model provider": "openai",
        "sqlite home": "/home/jja/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.43.0",
      "details": {
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/bin/git",
        "PATH git entries": "2",
        "git build options": "git version 2.43.0; cpu: x86_64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh",
        "git exec path": "/usr/lib/git-core",
        "git version": "git version 2.43.0",
        "repo detected": "false",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 55
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/home/jja/.local/bin/codex",
        "PATH codex #2": "/home/jja/.local/bin/codex",
        "PATH codex entries": "2",
        "current executable": "/home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/bin/codex",
        "install context": "standalone (unix, package /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl, bin /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/bin, resources /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/codex-resources, path /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed by pnpm": "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": {
        "managed proxy": "not configured",
        "proxy env vars": "none",
        "respect system proxy": "disabled"
      },
      "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 inference URL": "https://chatgpt.com/backend-api/<redacted> reachable (HTTP 405)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 170
    },
    "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",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 707
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running standalone on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/bin/codex",
        "install method": "standalone (unix, package /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl, bin /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/bin, resources /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/codex-resources, path /home/jja/.codex/packages/standalone/releases/0.149.0-x86_64-unknown-linux-musl/codex-path)",
        "platform": "linux-x86_64",
        "version": "0.149.0"
      },
      "remediation": null,
      "durationMs": 1
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/home/jja/.codex/packages/standalone/releases/0.149.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/jja/.codex/tmp/arg0/codex-arg08VmbEq/codex-linux-sandbox",
        "execve wrapper helper": "/home/jja/.codex/tmp/arg0/codex-arg08VmbEq/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "security.endpoint": {
      "id": "security.endpoint",
      "category": "security",
      "status": "ok",
      "summary": "endpoint protection is not inspected on this platform",
      "details": {
        "endpoint products": "not inspected on this platform"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/home/jja/.codex (dir)",
        "active rollout files": "262 files, 92828809 total bytes, 354308 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/home/jja/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/home/jja/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/home/jja/.codex/log (missing)",
        "memories DB": "/home/jja/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "queue DB": "/home/jja/.codex/queue_1.sqlite (file)",
        "queue DB integrity": "ok",
        "sqlite home": "/home/jja/.codex (dir)",
        "standalone release cache": "2 entries in /home/jja/.codex/packages/standalone/releases",
        "state DB": "/home/jja/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok",
        "thread history DB": "/home/jja/.codex/thread_history_1.sqlite (file)",
        "thread history DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 2114
    },
    "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": "262",
        "rollout DB active rows": "262",
        "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=262",
        "rollout DB rows": "262",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "vscode=153, cli=92, subagent:thread_spawn=17",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 290
    },
    "system.disk": {
      "id": "system.disk",
      "category": "disk",
      "status": "ok",
      "summary": "sufficient free disk space (270.1 GiB)",
      "details": {
        "CODEX_HOME available": "270.1 GiB",
        "failure threshold": "1.0 GiB",
        "warning threshold": "5.0 GiB",
        "worktree available": "270.1 GiB"
      },
      "remediation": null,
      "durationMs": 0
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language en",
      "details": {
        "EDITOR": "set",
        "LANG": "en_US.UTF-8",
        "LC_ALL": "en_US.utf8",
        "LESS": "set",
        "PAGER": "set",
        "VISUAL": "not set",
        "os": "Ubuntu 24.4.0 (noble) [64-bit]",
        "os language": "en",
        "os type": "Ubuntu",
        "os version": "24.4.0"
      },
      "remediation": null,
      "durationMs": 14
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORTERM": "truecolor",
        "DISPLAY": "present",
        "TERMINFO": "/usr/lib/kitty/terminfo (dir)",
        "color output": "enabled",
        "effective locale": "en_US.utf8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "kitty",
        "terminal size": "158x49"
      },
      "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": "cwd",
        "terminal title project value": "jja",
        "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.149.0",
        "check for update on startup": "true",
        "last checked at": "2026-08-21T10:58:22.748509757Z",
        "latest version": "0.149.0",
        "latest version status": "current version is not older",
        "update action": "standalone installer",
        "version cache": "/home/jja/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 888
    }
  }
}

What issue are you seeing?

When starting codex there is an error:

~ ❯ codex                                                                                                                                            16:24:07
Error: Failed to start a fresh session through the app server: thread/start failed during TUI bootstrap: thread/start failed: error creating thread: Fatal error: Failed to initialize session: failed to load AGENTS.md instructions for environment `local`: fs sandbox helper failed with status exit status: 1: bwrap: Can't mkdir /tmp/codex-bwrap-synthetic-mount-targets-1000: Read-only file system (code -32603)`

What steps can reproduce the bug?

/etc/codex/requirements.toml:

default_permissions = "repro"

[allowed_permission_profiles]
"repro" = true

[permissions.repro]
extends = ":workspace"

[permissions.repro.filesystem]
":minimal" = "read"
":slash_tmp" = "deny"

[permissions.repro.filesystem.":workspace_roots"]
"." = "write"

What is the expected behavior?

Codex CLI starts.

Additional information

Issue was introduced after upgrading to v0.149.0.

View original on GitHub ↗

3 Comments

laptchik · 5 days ago

Independent reproduction from a downstream integration using Codex CLI 0.149.0 on Linux.

Observed behavior:

  • A read-only permission profile completes sandbox startup successfully.
  • A writable workspace profile that intentionally denies both :tmpdir and :slash_tmp fails before thread creation with:

bwrap: Can't mkdir /tmp/codex-bwrap-synthetic-mount-targets-1000: Read-only file system

  • Direct bwrap works on the same host, unprivileged user namespaces are available, and the packaged AppArmor bwrap-userns-restrict profile is loaded/usable.
  • We separately isolated and fixed an unrelated systemd PrivateTmp=yes incompatibility; after that, the read-only path succeeds while the writable profile still fails specifically on the synthetic-mount registry path above.

The failure appears to be in Codex's internal bubblewrap bootstrap for protected writable-workspace metadata: the helper registry is created under std::env::temp_dir() and then mounted into the sandbox, but denying /tmp leaves no writable parent for bubblewrap to create that internal mount target. This occurs before the repository command itself asks for any temporary-directory access.

For our use case, granting :tmpdir/:slash_tmp, relocating TMPDIR, pre-creating protected metadata, or forcing a weaker sandbox would all broaden or change the intended command policy, so we are keeping those as non-workarounds.

A fix that keeps helper-internal scratch/bootstrap separate from command-visible /tmp permissions would resolve the blocker without weakening the permission profile.

scrameustache · 3 days ago

Additional independent reproduction with a clean A/B comparison across two consecutive VS Code Codex extension builds.

Environment

  • VS Code Remote SSH
  • Remote server: Debian 12 Bookworm, x86_64
  • Remote user UID: 1014
  • Host /tmp is normally writable (drwxrwxrwt; direct touch /tmp/test-codex succeeds)

Broken build:

  • extension: openai.chatgpt-26.818.41705-linux-x64
  • bundled CLI: codex-cli 0.149.0-alpha.4.1

Working build:

  • extension: openai.chatgpt-26.814.41407-linux-x64
  • bundled CLI: codex-cli 0.148.0-alpha.15

Reproduction with 0.149.0-alpha.4.1

Running the sandbox directly, outside the VS Code UI:

codex sandbox linux -- /bin/bash -lc '
  echo "uid=$(id -u)"
  touch /tmp/codex-sandbox-test
'

fails before the command is executed:

bwrap: Can't mkdir /tmp/codex-bwrap-synthetic-mount-targets-1014: Read-only file system

The real host /tmp is writable, and the corresponding /tmp/codex-bwrap-synthetic-mount-targets-1014 directory can be created by the user outside the sandbox.

Installing Debian's distribution-provided Bubblewrap (/usr/bin/bwrap, version 0.8.0) does not change the failure; the same error occurs.

Legacy Landlock fallback

Testing:

-c 'features.use_legacy_landlock=true'

with the 0.149 CLI produces:

permission profiles requiring direct runtime enforcement are incompatible with --use-legacy-landlock

so that fallback is not usable with the current permission profile.

A/B test with the previous CLI

After downgrading the VS Code extension to 26.814.41407 / CLI 0.148.0-alpha.15, Codex works again in VS Code Remote SSH.

The old CLI also passes a direct workspace-write sandbox test on the exact same host/user:

codex -c 'sandbox_mode="workspace-write"' sandbox -- /bin/bash -lc '
  set -e
  echo "uid=$(id -u)"
  echo "pwd=$(pwd)"
  touch .codex-sandbox-test
  echo "WORKSPACE WRITE OK"
  rm .codex-sandbox-test
  touch /tmp/codex-sandbox-test
  echo "TMP WRITE OK"
  rm /tmp/codex-sandbox-test
'

Output:

uid=1014
WORKSPACE WRITE OK
TMP WRITE OK

So, on the same Debian host and same user:

  • 0.148.0-alpha.15 -> workspace-write sandbox works
  • 0.149.0-alpha.4.1 -> sandbox initialization fails on /tmp/codex-bwrap-synthetic-mount-targets-<uid> before command execution

This strongly suggests a regression introduced in the 0.149 sandbox/bootstrap path rather than a host /tmp permission or Bubblewrap installation problem.

Downgrading the extension from 26.818.41705 to 26.814.41407 immediately restored normal Codex operation and access to the existing conversation history.

_This report was prepared and posted via ChatGPT after reproducing and troubleshooting the issue interactively with the user._

laptchik · 1 day ago

Follow-up from the same downstream integration, now tested on codex-cli 0.149.1.

We tried relocating TMPDIR away from /tmp into a dedicated, existing, canonical task-authorized write root outside any Git repository. The generated permission profile explicitly attests that exact path as write, and the app-server starts with TMPDIR bound to it.

Codex correctly moves its synthetic registry there, but sandbox bootstrap still fails before the workload starts:

bwrap: Can't mkdir /home/.../runtime-temp/codex-bwrap-synthetic-mount-targets-1000: Read-only file system

So this is not specific to the registry living under /tmp: moving std::env::temp_dir() to an exact writable non-/tmp root does not resolve the 0.149.x bootstrap failure under the restrictive permission profile.

In this reproduction:

  • generated permission profile loaded successfully;
  • effective profile attestation confirmed the runtime-temp path as write;
  • network remained disabled;
  • the failure occurred before any test executable/workload started.

This further suggests the helper-internal synthetic-mount bootstrap needs to be made compatible with the permission-profile mount ordering itself, rather than requiring command-visible :slash_tmp/broader temp write authority.