Skip to content

Windows MXC: a deny entry under a missing parent directory stops every command (0x80070003) #53576

Open

Description

@sushiHex

What version of Codex CLI is running?

codex-cli 0.162.1

What platform is your computer?

lWindows 11 Pro, 10.0.26200.9550, x64

What issue are you seeing?

Under windows.sandbox = "mxc", a permission profile that denies a path whose parent directory does not exist stops every command from starting:

MXC launcher: failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070003)

A denied path that is missing while its parent exists works fine, and so does a denied directory that exists. Only a missing parent fails, and it fails the whole sandbox, not just that entry.

That makes a deny list fragile in exactly the case it exists for. A tool that denies the places a secret may live (%APPDATA%\GitHub CLI, ~/.config/gh, a relocated CODEX_HOME) can't know in advance which of them exist on a given machine, and neither bubblewrap nor Seatbelt refuses there.

What steps can reproduce the bug?

From any directory, with C:\tmp\exists an existing directory:

# exit 0: missing file, parent exists
codex sandbox -c 'windows.sandbox="mxc"' -c 'default_permissions="repro"' -c 'permissions.repro.extends=":read-only"' -c 'permissions.repro.filesystem={"C:\\tmp\\exists\\missing.txt"="deny"}' -- cmd.exe /d /c "exit 0"

# exit 1, HRESULT 0x80070003: missing parent
codex sandbox -c 'windows.sandbox="mxc"' -c 'default_permissions="repro"' -c 'permissions.repro.extends=":read-only"' -c 'permissions.repro.filesystem={"C:\\tmp\\missing-dir\\child.txt"="deny"}' -- cmd.exe /d /c "exit 0"

Measured results:

Denied path Result
an existing directory exit 0
a missing file, parent exists exit 0
a missing file, parent missing exit 1, 0x80070003

What is the expected behavior?

A deny entry for a path that does not exist should be a no-op, or deny it as Linux and macOS do, whether or not its parent exists. It should not prevent the sandbox from starting.

Additional information

Workaround we use: deny the topmost missing ancestor instead of the path itself. That ancestor's parent always exists, so MXC accepts it.

Related but different: #53564 reports 0x80070003 with a different message ("cannot locate required Windows platform directory") from the browser runtime.

Activity

  1. added
    bug
    CLI
    windows-os
    sandbox
    on Oct 13, 2026
  2. denelon commented on Nov 5, 2026

    @denelon

    A Microsoft MXC issue appears closely related to this report:

    Both reports use Codex CLI 0.162.1 and observe CreateProcessSecurityEnvironment failing with 0x80070003 when a deny rule targets a path beneath a nonexistent parent directory. The MXC issue states that its reproduction was observed through Codex CLI. The reported Windows builds differ slightly, so this link identifies the matching failure mode without asserting that every occurrence necessarily has the same underlying cause.

    Drafted with GitHub Copilot assistance.
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