Skip to content

Windows elevated sandbox fails with "helper_unknown_error", while unelevated works #32855

Open

Description

@cidzanella

What version of Codex CLI is running?

0.144.3

What subscription do you have?

Plus

Which model were you using?

gpt-5.5

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

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

PowerShell

Codex doctor report

codex doctor --json
{
  "schemaVersion": 1,
  "generatedAt": "1783968267s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.144.3",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "C:\\Users\\cidza\\.codex\\app-server-control\\app-server-control.sock",
        "daemon state dir": "C:\\Users\\cidza\\.codex\\app-server-daemon",
        "mode": "ephemeral",
        "pid file": "C:\\Users\\cidza\\.codex\\app-server-daemon\\app-server.pid (missing)",
        "settings": "C:\\Users\\cidza\\.codex\\app-server-daemon\\settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "C:\\Users\\cidza\\.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": "C:\\Users\\cidza\\.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": "C:\\Users\\cidza\\.codex",
        "config.toml": "C:\\Users\\cidza\\.codex\\config.toml",
        "config.toml parse": "ok",
        "cwd": "C:\\90z\\projects\\maestro-perdonato",
        "enabled feature flags": "<redacted>",
        "feature flag overrides": "none",
        "feature flags enabled": "35",
        "log dir": "C:\\Users\\cidza\\.codex\\log",
        "mcp servers": "1",
        "model": "gpt-5.5",
        "model provider": "openai",
        "sqlite home": "C:\\Users\\cidza\\.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.51.0.windows.1",
      "details": {
        ".git entry": "directory",
        "PATH git #1": "C:\\Program Files\\Git\\cmd\\git.exe",
        "PATH git entries": "1",
        "git branch": "main",
        "git build options": "git version 2.51.0.windows.1; cpu: x86_64; built from commit: 4d21a77b98af5cf479d8b6f863c2aa94257cd4e1; sizeof-long: 4; sizeof-size_t: 8; shell-path: D:/git-sdk-64-build-installers/usr/bin/sh; feature: fsmonitor--daemon; libcurl: 8.15.0; OpenSSL: OpenSSL 3.2.4 11 Feb 2025; zlib: 1.3.1; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
        "git exec path": "C:/Program Files/Git/mingw64/libexec/git-core",
        "git version": "git version 2.51.0.windows.1",
        "repo detected": "true",
        "repo root": "C:\\90z\\projects\\maestro-perdonato",
        "selected git": "C:\\Program Files\\Git\\cmd\\git.exe"
      },
      "remediation": null,
      "durationMs": 53
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "C:\\nvm4w\\nodejs\\codex",
        "PATH codex #2": "C:\\nvm4w\\nodejs\\codex.cmd",
        "PATH codex entries": "2",
        "current executable": "C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
        "install context": "npm (package C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path)",
        "managed by bun": "false",
        "managed by npm": "true",
        "managed by pnpm": "false",
        "managed package root": "C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex",
        "npm update target": "C:\\nvm4w\\nodejs\\node_modules\\@openai\\codex"
      },
      "remediation": null,
      "durationMs": 3086
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "MCP configuration is locally consistent",
      "details": {
        "configured servers": "1",
        "disabled servers": "0",
        "stdio servers": "1"
      },
      "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": 124
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 0 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": 603
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on windows-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin\\codex.exe",
        "install method": "npm (package C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc, bin C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\bin, resources C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path)",
        "platform": "windows-x86_64",
        "version": "0.144.3"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "C:\\Users\\cidza\\AppData\\Local\\nvm\\v22.15.0\\node_modules\\@openai\\codex\\node_modules\\@openai\\codex-win32-x64\\vendor\\x86_64-pc-windows-msvc\\codex-path\\rg.exe",
        "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": "none",
        "execve wrapper helper": "none",
        "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": "C:\\Users\\cidza\\.codex (dir)",
        "active rollout files": "37 files, 118665737 total bytes, 3207182 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "C:\\Users\\cidza\\.codex\\goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "C:\\Users\\cidza\\.codex\\logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "C:\\Users\\cidza\\.codex\\log (dir)",
        "memories DB": "C:\\Users\\cidza\\.codex\\memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "C:\\Users\\cidza\\.codex (dir)",
        "state DB": "C:\\Users\\cidza\\.codex\\state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 571
    },
    "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": "37",
        "rollout DB active rows": "37",
        "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=37",
        "rollout DB rows": "37",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=33, vscode=4",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 1187
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language en-US",
      "details": {
        "EDITOR": "not set",
        "VISUAL": "not set",
        "os": "Windows 10.0.26200 (Windows 11 Core) [64-bit]",
        "os language": "en-US",
        "os type": "Windows",
        "os version": "10.0.26200"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "color output": "enabled",
        "console input code page": "437",
        "console output code page": "437",
        "stderr console mode": "0x00000007 (VT processing: true)",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout console mode": "0x00000007 (VT processing: true)",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "120x30"
      },
      "remediation": null,
      "durationMs": 1
    },
    "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": "maestro-perdonato",
        "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.144.3",
        "check for update on startup": "true",
        "last checked at": "2026-07-13T16:43:37.781577200Z",
        "latest version": "0.144.3",
        "latest version status": "current version is not older",
        "npm update target": "C:\\nvm4w\\nodejs\\node_modules\\@openai\\codex",
        "update action": "npm install -g @openai/codex",
        "version cache": "C:\\Users\\cidza\\.codex\\version.json"
      },
      "remediation": null,
      "durationMs": 1231
    }
  }
}

What issue are you seeing?

Environment

  • OS: Windows 11
  • Codex CLI: 0.144.3
  • Installed via npm

Problem

After upgrading to Codex CLI 0.144.3, the default Windows sandbox is no longer able to perform write operations inside my workspace.

The problem is reproducible and happens before the command is actually executed.

Reproduction

Start Codex with:

codex --sandbox workspace-write --ask-for-approval never

Then ask it to perform any simple write operation, for example:

Create file codex-write-test.txt in the repository root with the content "hello".

Actual behavior

The operation fails immediately with:

windows sandbox: helper_unknown_error: setup refresh had errors

During previous attempts I also received:

missing field sandboxPolicy

No file is created.

The same happens when Codex tries to:

  • apply_patch
  • create files
  • edit files
  • delete files

Reading files and running git status still work normally.

Expected behavior

Codex should be able to create and modify files inside the workspace when using:

codex --sandbox workspace-write --ask-for-approval never

Workaround

Starting Codex with:

codex -c windows.sandbox="unelevated" --sandbox workspace-write --ask-for-approval never

completely fixes the issue.

Using the unelevated sandbox I can:

  • create files
  • modify files
  • delete files
  • run builds
  • continue normal development

Additional information

I initially suspected my repository, but I was able to isolate the issue.

The same repository:

  • fails with the default elevated Windows sandbox;
  • works correctly with the unelevated Windows sandbox.

I also verified that creating and modifying files outside the repository works, so the problem appears to be specific to the elevated Windows sandbox initialization.

This looks like a regression, because the same repository worked correctly before updating to Codex CLI 0.144.3.

What steps can reproduce the bug?

  1. On Windows 11, install Codex CLI 0.144.3.

  2. Open a PowerShell terminal.

  3. Navigate to any existing project directory.

cd C:\path\to\your\project
  1. Start Codex:
codex --sandbox workspace-write --ask-for-approval never
  1. Ask Codex to create a simple file:
Create file test.txt containing hello
  1. The write operation fails before execution with:
windows sandbox: helper_unknown_error: setup refresh had errors

In some attempts I also received:

missing field sandboxPolicy
  1. Repeat the exact same test using:
codex -c windows.sandbox="unelevated" --sandbox workspace-write --ask-for-approval never
  1. Ask again:
Create file test.txt containing hello

The operation succeeds normally.

This demonstrates that the problem is specific to the default elevated Windows sandbox, since the same workspace and the same write operation work correctly with windows.sandbox="unelevated".

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bug
    on Jul 13, 2026
  2. added
    CLI
    windows-os
    sandbox
    on Jul 13, 2026
  3. github-actions commented on Jul 13, 2026

    @github-actions
    Contributor
  4. pabrown00 commented on Jul 30, 2026

    @pabrown00

    Same failure class on codex-cli 0.144.6, Windows 11 (Hyper-V guest), reproducible 100%.

    With [windows] sandbox = "elevated" in config.toml (the value appeared after a Codex desktop app update on this machine), every command under codex exec --sandbox read-only fails in 0ms with:

    windows sandbox: helper_unknown_error: apply deny-read ACLs
    

    A/B on the same machine, same session:

    • --sandbox workspace-write under elevated: works
    • --sandbox read-only with -c windows.sandbox="unelevated": works

    So it is specifically elevated + read-only. Two notes for triage:

    1. The docs say Codex falls back to unelevated automatically when elevated setup fails — that fallback does not happen here; it hard-fails instead.
    2. This silently breaks headless/CI-style integrations that run read-only by design (in our case, an automated review pipeline invoked from another tool).

    Release notes through 0.146.0 don't appear to mention this; not yet retested on newer than 0.144.6.

  5. skyhi69 commented on Sep 1, 2026

    @skyhi69

    Still present on 0.152.0, and I have a clean version bisect plus what looks like a concrete cause: the helper copy step puts the wrong binary in the cache.

    Environment matches the original report almost exactly — Windows 10.0.26200 x64, Plus, gpt-5.5, PowerShell, npm install, sandbox backend: elevated.

    Version bisect (same machine, same config, same auth, nothing else changed)

    0.152.0  ->  x sandbox   elevated Windows sandbox provisioning recorded a structured failure
                             sandbox provisioning  failed
                             error code            helper_unknown_error
                             filesystem sandbox    restricted
                             network sandbox       restricted
    
    0.136.0  ->  v sandbox   restricted fs + restricted network - approval OnRequest
    

    Only the version differs. npm i -g @openai/[email protected] fixes it immediately; reinstalling 0.152.0 reproduces it.

    The part I have not seen reported: the wrong binary is copied into .sandbox-bin

    ~/.codex/.sandbox-bin/ is where the version-stamped helper gets cached. Working vs broken:

    0.136.0 — correct. After a run, the cache holds a command-runner that is byte-identical to the vendor source:

    ~/.codex/.sandbox-bin/codex-command-runner-0.136.0.exe        1,154,352 bytes
    <install>/codex-resources/codex-command-runner.exe            1,154,352 bytes   (source, matches)
    

    0.152.0 — wrong. I deleted .sandbox-bin entirely and let 0.152.0 recreate it. It produced only this, and no command-runner at all:

    ~/.codex/.sandbox-bin/codex.exe                             293,066,544 bytes
    

    That is the full CLI binary written into the helper slot — ~254x the size of the ~1.1 MB helper that belongs there. The correct source helpers do exist in the 0.152.0 install and are not being used:

    <install>/codex-resources/codex-command-runner.exe            8,198,960 bytes
    <install>/codex-resources/codex-windows-sandbox-setup.exe     15,412,016 bytes
    

    So this is not a missing-file or a corrupt-download problem — the copy step selects the wrong source.

    Clearing the cache does NOT work around it

    Worth saying explicitly, since it is the obvious first thing to try: deleting ~/.codex/.sandbox-bin does not help. 0.152.0 simply recreates the same broken state on the next invocation.

    Downstream symptoms, in case others are searching for these instead

    The sandbox failure does not surface as a sandbox error to the user. What you actually see:

    1. Interactive TUI hangs on model: loading forever and silently queues every message you type under "Queued follow-up inputs". No error is shown. /usage reported a usage-limit reset available, and consuming it changed nothing — this is not quota.
    2. codex exec writes a 0-byte output file and exits 0. No session rollout is created under ~/.codex/sessions/<YYYY>/<MM>/<DD>/ at all, which is a useful way to distinguish this from a quota refusal (a quota refusal does write a session and puts ERROR: You've hit your usage limit in the output).
    3. Session start fails with a misleading error:
      Failed to initialize session: failed to load AGENTS.md instructions for
      environment `local`: The filename or extension is too long. (os error 206)
      
      This one sent me down a long dead end. It is not an AGENTS.md problem and not a MAX_PATH problem — LongPathsEnabled is 1, the longest path on the machine is 260 chars, and all three AGENTS.md files load fine on 0.136.0 unchanged. It appears to be the sandbox helper failure surfacing at instruction-load time.

    codex doctor also reports auth is configured, reachability: active provider endpoints are reachable over HTTP, and network: no proxy env vars throughout — so auth and plain HTTP connectivity are fine. It is specifically the sandboxed path that dies, and network sandbox: restricted with server model present: false lines up with the wss://chatgpt.com/backend-api socket never completing.

    Workaround

    npm i -g @openai/[email protected]
    

    and, since the CLI auto-updates on startup and will otherwise re-break itself (mine went 0.136 -> 0.151 -> 0.152 in two days), add this as a top-level key in ~/.codex/config.toml, before any [table]:

    check_for_update_on_startup = false

    codex doctor then confirms startup update check: false.

    Possibly relevant

    codex doctor reports Microsoft Defender can interfere with Codex. Verify Codex exclusions. with Codex exclusions: not verified on both versions — so if Defender is involved it is not sufficient on its own to explain the difference, since 0.136.0 provisions the sandbox successfully under identical Defender state.

    Happy to provide full codex doctor --json output for either version, or the ~/.codex/.sandbox/sandbox.<date>.log files, if useful.

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

    CLIbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions