Skip to content

Windows desktop: Python Path.resolve(strict=True) fails with WinError 5 despite successful file reads #52639

Open

Description

@ncomb005-crypto

What version of the Codex App are you using (From “About Codex” dialog)?

26.1002.52244 (build 13536)

What subscription do you have?

Pro- $200

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Python strict path resolution fails inside Codex’s Windows command environment for an existing workspace file.

Recorded error:
PermissionError: [WinError 5] Access is denied

Failing call:
pathlib.Path.resolve(strict=True) -> ntpath.realpath

Ordinary file reads, stat operations and SHA256 hashing succeeded. I ran the same strict-resolution check using the same Python interpreter outside Codex in normal Windows PowerShell, where it returned the resolved path successfully.

Restarting Codex and granting read access to the exact workspace did not resolve the problem.

The saved configuration specifies windows.sandbox = "elevated", but the active sandbox implementation and setup completion remain unconfirmed. No administrator setup prompt appeared.

Additional recorded diagnostics found that QueryDosDeviceW("C:") failed with Windows error 5, while ordinary file access succeeded.

This prevents an integrity verifier from running successfully. The verifier’s strict path checks have not been weakened or bypassed.

Observations were recorded on October 8, 2026.

What steps can reproduce the bug?

  1. Open the affected workspace in Codex on Windows.
  2. Select an existing file within that workspace.
  3. Ask Codex to execute the following read-only command, replacing both placeholders with the actual Python executable and existing file paths:

& '<PYTHON_EXE>' -B -c "from pathlib import Path; print(Path(r'<EXISTING_FILE_ABSOLUTE_PATH>').resolve(strict=True))"

  1. Observe PermissionError: [WinError 5] Access is denied, originating in ntpath.realpath.
  2. Run the same command using the same interpreter in normal Windows PowerShell outside Codex.
  3. In my external PowerShell test, it returned the resolved path successfully.

The failure was observed on a specific existing workspace JSON file. Reproducibility on arbitrary files or other machines has not been established.

What is the expected behavior?

Strict resolution of an existing workspace file that Codex has permission to read should return its resolved absolute path successfully.

If sandbox setup or permissions prevent this, Codex should provide an actionable explanation and a supported recovery procedure without requiring sandbox disablement, broad ACL changes or removal of strict verification.

Additional information

App version: 26.1002.52244 (build 13536)
Platform: Windows NT 10.0.26200.0, x64

Diagnostic observations recorded on October 8, 2026:

  • Ordinary file reads, stat operations, and SHA256 hashing succeeded inside Codex.
  • The same strict-resolution check, using the same Python interpreter and existing file, succeeded in normal Windows PowerShell outside Codex.
  • Restarting Codex and granting read access to the exact workspace did not resolve the failure.
  • The saved configuration specifies windows.sandbox = "elevated", but the active sandbox backend and setup completion remain unconfirmed. No administrator setup prompt appeared.
  • QueryDosDeviceW("C:") also failed with Windows error 5.
  • The expected CODEX_HOME/.sandbox/sandbox.log file was absent when checked.

The integrity verifier’s strict path checks remain unchanged; no fallback or bypass has been applied. Reproducibility on arbitrary files or other machines has not been established.

Please advise how to confirm the active sandbox backend and recover through a supported procedure.

OPENAI_SUPPORT_REQUEST_DRAFT_20261009.txt

Activity

  1. added
    app
    on Oct 9, 2026
  2. added
    bug
    windows-os
    sandbox
    on Oct 9, 2026
  3. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor
  4. alitiridvan-cmyk commented on Oct 17, 2026

    @alitiridvan-cmyk

    Additional sanitized evidence from an independent Python 3.12.10 (64-bit) / Windows 11 / Codex Windows sandbox case, relevant to this issue:

    • An isolated synthetic SQLite migration fixture was created and committed. During its subsequent snapshot-sealing step, maintenance.connect_readonly() → pathlib.Path.resolve(strict=True) → ntpath.realpath raised PermissionError: [WinError 5] Access is denied, before that read-only SQLite connection was opened.
    • The failing fixture path was lexically within the controller's declared read/write root. This does not establish effective Windows authorization or exclude a reparse-point/path-namespace issue.
    • The historical Python process identity was recorded, but its Windows access token, SID/capabilities, integrity level, and effective launcher/sandbox policy were not captured. Consequently, the historical root cause remains unknown.
    • A later, different PowerShell process was observed running as Low integrity / AppContainer. Eleven handle-backed canonical directory checks passed. An existing same-handle comparison of GetFinalPathNameByHandleW(VOLUME_NAME_DOS) and VOLUME_NAME_NT succeeded for both variants in that PowerShell context. This is not a reproduction of the historical Python failure and does not prove the cause described in microsoft/mxc#1464.
    • NetworkIsolationGetAppContainerConfig returned ERROR_ACCESS_DENIED (5) during read-only observation of that PowerShell context. This did not establish the loopback exception list or the future Python process's policy, and is not evidence of the historical filesystem denial. No new Python filesystem test was launched because the required execution-policy evidence was unavailable.

    Questions for maintainers:

    1. What is the supported, read-only way to identify the effective Windows sandbox backend and launcher/managed policy for a specific desktop Codex child process (not merely the saved config), including the process/thread token and applicable filesystem boundary?
    2. If an unrelated network-policy introspection API returns access denied, how should a strictly offline, single-file path-resolution diagnostic establish its mandatory execution gates without weakening the sandbox?
    3. Is there a confirmed version-specific fix or supported, narrowly scoped recovery procedure for Python Path.resolve(strict=True) returning WinError 5 inside an otherwise readable/writable workspace?

    We are not requesting disabled sandboxing, broader ACLs, removal of strict canonicalization, or unaudited outside-sandbox execution. No user identity, project name, private filesystem paths, credentials, or logs are included.

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

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions