Skip to content

Windows sandbox: Path.resolve(strict=True) fails with WinError 5 in default execution, succeeds in approved outside execution #51989

Open

Description

@LySIvK

What issue are you seeing?

Scope

This report concerns Windows filesystem access/path resolution. E01 is the primary evidence; E02 is supporting evidence. E03 concerns permission-mode changes and existing subagents and will be reported separately as product-behavior feedback. A shared root cause is UNKNOWN.

E01 — strict path resolution on D: (primary)

Two retained probe receipts record the same:

  • Python executable path and version string: Python 3.14.4, 64-bit AMD64.
  • Account string, cwd, and target path.
  • Operation: Path.resolve(strict=True).
  • Target, redacted: D:\<WORK_ROOT>\<CASE>\owner\archive.db.
Execution context Retained result
Default sandbox, according to the recovery report REFUSED; PermissionError [WinError 5]
Recorded approved outside-sandbox execution RESOLVED; same resolved path string; exit_code=0

The default probe already reached Python. Its traceback points to:

path_probe.py: source.resolve(strict=True)
pathlib/__init__.py:938: os.path.realpath(self, strict=strict)
<frozen ntpath>:694: realpath
PermissionError: [WinError 5] <localized text / target redacted>

An original helper failure receipt independently records the exception at source.resolve(strict=True). The success receipt records exec_command require_escalated, approved read-only probe. The original approval/reviewer event has not been inspected.

The target is under the currently declared D: work root. The failure-time effective policy has not been recovered. This should not be classified as an out-of-project restriction without checking that policy.

E02 — formal-source hash read on G: (supporting)

A retained failure report records Get-FileHash -LiteralPath <G: source path> -Algorithm SHA256 returning Access to the path is denied.

The surrounding script then called ToLowerInvariant on null and incorrectly emitted FORMAL_SOURCE_DRIFT. The retained report explicitly corrects this: failure to obtain a hash does not establish source drift.

The user reports a subsequent approved outside-sandbox read. A final seal receipt records nine G: source paths as FORMAL_REVIEW_BASELINE_UNCHANGED. The failure report and final seal receipt both match their existing delivery-manifest SHA-256 entries, rechecked during the investigation. No live source or separate review baseline was reread.

E02 supports investigating the default/approved access boundary. It does not prove the same underlying mechanism as E01.

What steps can reproduce the bug?

This is a historical minimal operation reconstructed from retained receipts/tracebacks, not a newly executed reproduction:

from pathlib import Path
target = Path(r"D:\<WORK_ROOT>\<CASE>\owner\archive.db")
print(target.resolve(strict=True))
  1. The retained default execution uses the recorded Python executable, account, cwd and target and fails inside strict resolution with WinError 5.
  2. A retained approved outside-sandbox execution records the same executable/version, account, cwd and target and resolves successfully.
  3. Compare the effective permission policy, Windows token/capabilities, path namespace and path-resolution access between those executions.

All paths above are placeholders. The original probe script was not read during this investigation, so a byte-for-byte comparison of executed scripts is not established. Same executable/version strings are not a binary-hash comparison. Same account/path strings do not establish identical effective tokens or underlying file identities.

No probe was rerun, no ACL/security settings were changed, and no database or formal-source content was read during the diagnostic investigation. Whether an ordinary harmless fixture reproduces the issue is UNKNOWN.

What is the expected behavior?

If the effective policy permits access to this path, strict resolution should succeed or expose which permission/path operation is denied. Please help distinguish:

  • policy application or intended restriction;
  • effective-token/capability and filesystem-permission interaction;
  • final-path/reparse behavior;
  • a Windows sandbox implementation defect.

The requested outcome is an explanation and correction of the effective access behavior where appropriate. This report does not request disabling the sandbox.

Additional information

Environment and provenance

  • Historical E01 receipts: Python 3.14.4, 64-bit AMD64.
  • Later diagnostic snapshot: Microsoft Windows NT 10.0.26300.0; PowerShell 7.6.6.
  • Related E03 parent/child session metadata: cli_version=0.160.1, originator=Codex Desktop. The exact D/G execution version and installed desktop package version remain UNKNOWN.
  • Current declared mode: workspace-write. The user reports a current Windows elevated configuration; the failure-time Windows backend/effective policy is UNKNOWN.

Timeline and evidence limits

Dates are Asia/Hong_Kong (UTC+08:00).

  • E01 retained receipt mtimes: 2026-10-08 approximately 10:18–10:19.
  • E02 retained failure/seal mtimes: 2026-10-08 approximately 13:51; delivery manifest approximately 13:56.
  • These are file modification times, not exact execution timestamps.
  • The user reports more frequent permission interruptions since early October. Only the 2026-10-07/08 evidence was reviewed; onset, frequency and regression version are unverified.
  • Default E01 exit code 1 is user-reported; it is not a field in the specified stdout receipt. The successful receipt directly contains exit code 0.
  • The default receipt's localized error text contains replacement characters; the error code and relevant stack are legible.
  • D/G original client approval events and failure-time policy snapshots remain missing.
  • Matching delivery hashes establish current consistency of retained E02 artifacts, not immutable historical sealing or live source equality.

Related product feedback (E03 — UNKNOWN association)

The user reported changing the parent conversation's permissions, followed by a default parent E: write refusal; an already-running child later recorded a restricted policy. A confirmed successful client permission change and an independent post-confirmation child write failure are not established. Existing-subagent inheritance and client messaging are being reported separately, with this issue cross-referenced to avoid duplicate investigation.

Account/machine names, real project paths, session/call identifiers, business code/data, raw logs and private artifact hashes are omitted.

Activity

  1. added
    bug
    on Oct 8, 2026
  2. added
    app
    windows-os
    sandbox
    on Oct 8, 2026
  3. Zakcar1979 commented on Oct 11, 2026

    @Zakcar1979

    I observed similar symptoms in Codex desktop on Windows on 9 October 2026.

    Using the same Python 3.12.14 virtual-environment interpreter with -I -B, strict resolution of my workspace directory failed inside Codex with PermissionError: [WinError 5] Access is denied.

    The same command succeeded in a separately opened Windows PowerShell window. Reading specific named files inside Codex succeeded.

    Restarting the desktop app and granting narrow read access did not resolve the failure.

    The bundled Codex CLI reported version 0.160.1 during these diagnostics. My desktop app version has not yet been collected.

    Feedback was successfully submitted through the desktop app:
    01a05259-53d3-7821-a276-16ea14e2d886

    I have not established whether the underlying cause is the same.

    Please advise on a supported recovery procedure that preserves sandbox protections and strict path checks.

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