Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
ChatGPT desktop (Windows): 26.1002.7124.0; embedded Codex CLI: 0.162.0-alpha.2
What subscription do you have?
Plus
What platform is your computer?
Windows 11 25H2 (build 26200.9457), x64
What issue are you seeing?
The Windows desktop Work/Codex sandbox denies native Windows path resolution even for newly created files inside its authorized writable workspace.
Node.js fs.realpathSync.native() fails with EPERM (errno -4048). A direct Windows API probe confirms that GetFinalPathNameByHandleW returns ERROR_ACCESS_DENIED (Win32 5) when requesting DOS or volume-GUID paths, although opening the same file succeeds.
This prevents Vitest from collecting seven test suites and causes TypeScript dependency-resolution errors. The identical probes, 39 tests, and TypeScript checks pass with narrowly approved execution outside the normal sandbox.
A separate boundary-sensitive SQLite WAL issue was also reproduced with disposable fixtures. An active WAL database outside the writable roots fails with SQLite error 14, while an equivalent fixture inside the writable workspace succeeds.
No durable sandbox correction has been established.
What steps can reproduce the bug?
- Start a normal sandboxed Work/Codex execution on Windows.
- Create a disposable file inside the authorized writable workspace.
- Run the following Node.js code, substituting the disposable file path:
const fs = require("node:fs");
const path = require("node:path");
const file = path.resolve("probe.txt");
fs.writeFileSync(file, "test");
console.log(fs.readFileSync(file, "utf8"));
console.log(fs.realpathSync(file));
console.log(fs.realpathSync.native(file));- Observe that ordinary file access and non-native realpath succeed, but native realpath throws
EPERM. - Run the identical probe using narrowly approved execution. All operations succeed.
Independent Windows API probes reproduce the failure specifically for DOS/GUID final-path resolution, while NT/no-volume formats succeed.
The sanitized reproduction package contains additional evidence and SQLite WAL probes.
What is the expected behavior?
Native path resolution should succeed for ordinary files inside the sandbox's authorized writable workspace, without requiring execution outside the sandbox.
Vitest and TypeScript should be able to resolve installed dependencies and complete normal verification.
Sandbox restrictions should remain enforced for protected locations and unauthorized writes. A fix should preserve isolation rather than require disabling sandbox protections.
Additional information
Environment:
- Windows 11 25H2, build 26200.9457, x64
- Node.js 24.20.0
- Codex CLI 0.162.0-alpha.2
- TypeScript 5.9.3
- Vitest 4.0.18
- SQLite 3.53.4
Normal sandbox execution uses Low Mandatory Level; narrowly approved comparison execution uses Medium Mandatory Level under the same Windows account. The effective sandbox backend was not conclusively identified.
A previous sandbox setup refresh reported a sharing violation (Win32 32), but its relationship to this issue is unproven.
The diagnostic package includes sanitized evidence and scripts. The disposable native-path and SQLite probes were exercised; optional fresh-install TypeScript/Vitest fixtures have not been verified end-to-end.
No source changes, security-policy changes, protected database modifications, or device interactions were made during diagnosis.
Please investigate the effective sandbox backend and the denied DOS/GUID path-resolution operation, and provide a supported correction that preserves sandbox security.
Activity
Wygfgdh-ctrl commentedon Oct 9, 2026
Additional independent reproduction affecting Computer Use local project-module imports on Windows, observed on 2026-10-09.
Versions actually checked
26.1002.52244, build13536, installed release channelprod.0.162.0-alpha.2.v24.21.0; runtime manifest:cua-node 0.0.29/20261003001300-807782c586fc.unavailablebecause Windows Store eligibility checking may download updates. This is not evidence that this installation is up to date.Same-file comparison
The same existing local adapter file was used throughout; its complete bytes and SHA256 matched across checks. The ordinary command runs used the same configured bundled Node executable. The Computer Use REPL runtime association is based on its configured executable and runtime manifest.
readFileand hashfs.realpathfs.realpath.nativefs.promises.realpathRepresentative REPL failure, with path redacted:
Failed to resolve module "file:///<workspace>/scripts/adapter.mjs": EPERM: operation not permitted, realpath '<workspace>\\scripts\\adapter.mjs'Import success in ordinary Node was not treated as restored Computer Use access. No adapter control functions were executed through that alternative context.
Independent read-only Windows API comparison
A fixed-file metadata probe in the normal command sandbox produced:
CreateFileW: succeeds.GetFinalPathNameByHandleWwith DOS/normalized flags (0): returns0; immediateGetLastErroris5.The same probe outside the sandbox succeeds and returns the canonical path. This held for both metadata-only opening modes tested: desired access
0/ sharing0, andFILE_READ_ATTRIBUTES/ sharing read-write-delete. Both usedOPEN_EXISTING; neither requested write access.Impact and request
The existing guarded Windows desktop workflow cannot load its original project adapter in the supported Computer Use session, although the file is readable. An earlier fresh REPL reset did not restore the import.
These results localize the immediate failure to restricted-context canonical-path resolution. They do not conclusively identify the effective sandbox backend or the policy/Windows mechanism producing the denial. We did not modify ACLs, runtime packages, trusted-path configuration or sandbox settings, and did not substitute an outside-sandbox desktop-control path.
Please provide a supported correction for native canonical-path resolution/module loading that preserves existing sandbox and control safeguards. No durable fix or restored Computer Use workflow is claimed.
No real local paths, usernames, account information, credentials, project source, raw logs, session identifiers or attachments are included.
github-actions commentedon Oct 9, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
lhurtadojs-ux commentedon Oct 9, 2026
We independently reproduced this pattern with Node v24.16.0 while building EZChurchApp with Vite. Both ordinary and native realpath succeed in PowerShell launched from Windows Start; native realpath fails with EPERM inside Codex on the identical file. Our application build remains blocked.
MickeyM777 commentedon Oct 10, 2026
I can independently reproduce what appears to be the same underlying Windows sandbox restriction from Node.js on the current ChatGPT/Codex desktop build.
Environment:
Results:
Exact error:
Error: EPERM: operation not permitted, realpath 'C:\CodexSandboxTest'
errno: -4048
code: 'EPERM'
syscall: 'realpath'
path: 'C:\CodexSandboxTest'
The issue was also reproducible on the previous desktop build 26.1002.52244.
This suggests that ordinary file access and non-native realpath resolution still work, while the native Windows final-path resolution path is blocked by the sandbox.
In our development workflow, this affects Node-based tooling such as Vitest and related dependency/path resolution, even though normal file reads, fs.realpathSync(), and fs.lstatSync() succeed.
So this does not appear to be fully resolved in ChatGPT/Codex desktop 26.1007.21434.
lhurtadojs-ux commentedon Oct 10, 2026
song476258323-lgtm commentedon Oct 11, 2026
Independent reproduction on Windows on 2026-10-11 with bundled codex-cli 0.162.0-alpha.17.2 and Node v24.19.0.
Inside the authorized project directory, fs.realpathSync.native fails with EPERM for both package.json and node_modules/react/index.js. On the identical paths, fs.realpathSync succeeds; lstat succeeds and the dependency file is not a symlink. Explicit project read/write grants via request_permissions did not resolve it. Vite 8.0.13 / Vinext production build fails during config dependency resolution.
Minimal read-only probe from the project root:
const fs = require("node:fs");
for (const p of ["package.json", "node_modules/react/index.js"]) {
for (const [label, fn] of [["native", fs.realpathSync.native], ["js", fs.realpathSync]]) {
try { fn(p); console.log(p, label, "OK"); }
catch (e) { console.log(p, label, e.code); }
}
}
Observed:
package.json native EPERM
package.json js OK
node_modules/react/index.js native EPERM
node_modules/react/index.js js OK
Read-only diagnostics also found a historical elevated-sandbox setup failure dated 2026-10-09: runtime read/execute validation could not open node_repl.exe for an ACL update because the file was in use (Windows error 32). That is historical evidence, not proof of the current sandbox backend or the cause of native realpath failures. Doctor was run inside the restricted tool environment, so its other failures were not treated as proof of damaged host state.
Please provide a supported repair preserving sandbox protections. No private paths, project data, credential values, raw logs, or session identifiers are included.
Update later on 2026-10-11: the conversation's effective approval configuration changed so that narrowly scoped require_escalated execution could be reviewed and approved. With that supported approval, the official helper accepted its stdin input and source synchronization succeeded. The production build also succeeded outside the ordinary sandbox, and the Site update was successfully deployed. This completed the user task but does not establish a durable fix for the original granular policy or native path-resolution behavior inside the ordinary sandbox. We did not disable the sandbox or modify security policy files.
lhurtadojs-ux commentedon Oct 12, 2026
@song476258323-lgtm Thank you for sharing the successful build/deployment update. We have the same Vite 8.0.13 / Vinext build blocker, with native realpath failing inside Codex and succeeding in ordinary PowerShell on the identical file.
Could you describe the exact user-facing steps that changed your conversation's effective approval configuration so a narrowly scoped require_escalated request could be reviewed and approved? In our current session, sandbox_approval is false and that category is automatically rejected rather than prompting.
Was this an app permission-mode change, a new conversation, an app restart/update, or another supported action? Please identify the application surface and version you used, and whether this enabled individual per-command approvals without selecting unrestricted Full access or editing security-policy files.
We are looking for a supported, scoped approach that preserves safeguards and keeps publishing credentials out of command arguments and files. Please do not share tokens or private logs. No permanent repair is assumed.
immsaigon commentedon Oct 12, 2026
Additional read-only evidence from a Windows 11 25H2 (build 26200.9457) environment, as of 2026-10-12:
0.162.0-alpha.2, permission profile:workspace,workspace-write, and managed permissions context.pathlib.Path.resolve(strict=True)failed withPermissionError: [WinError 5]on an existing project test-artifact directory. The active Windows sandbox implementation during that historical failure is unknown; a matchingCODEX_HOME/.sandbox/sandbox.logwas unavailable.windows.sandbox=mxc,--include-managed-config,--permission-profile :workspacesuccessfully ran a trivialechocommand (exit code 0).Could maintainers confirm whether this matches the known native
GetFinalPathNameByHandleW/DOS-path resolution behavior; whether a security-preserving fix is planned or available in a particular Desktop/CLI build; and whether there is an official way to obtain active backend/managed-policy diagnostic evidence whensandbox.logis absent? Please do not infer the historical sandbox backend from the separate successful MXC CLI probe.No private source, user paths, credentials, session identifiers, or raw logs are included.
2026-10-12 addendum — effective backend ambiguity narrowed by version-pinned source review:
rust-v0.162.0-alpha.2,mxc-sandbox/README.mddocuments thatwindows.sandbox = "mxc"is strict andfeatures.prefer_mxccan select MXC for local execution even when the legacy Windows sandbox is configured. Desktop may supply-c features.prefer_mxc=truefrom its rollout decision at process launch.config/readshows the configured mode, not necessarily the chosen runtime backend.windowsSandbox/readinessin that exact tag is not unconditionally a read-only operation: under registered-core and legacy-elevated conditions it can invokerefresh_registered_core_via_service. We therefore have not called it merely to infer the historical backend.:workspace/workspace-write/managedandon-request, but does not give a verified per-command MXC/elevated choice or the effective managed requirement set. A separate current-CLI explicit-MXC success is not a substitute for that evidence.Targeted maintainer question: Is there a supported, non-mutating way to retrieve the selected backend for an individual historical Desktop command (or the exact app-server CLI startup overrides / server-side telemetry under the report's feedback ID), along with effective managed constraints and any applicable host audit requirements? We need to preserve the original sandbox boundary and strict path validation, not switch to unrestricted execution or delete the canonicalization check. No additional commands were executed in this addendum.
2026-10-12 follow-up — Live Desktop child-process startup-flag evidence (read-only):
app-serverand a current Codexexec-serverlaunched as children ofChatGPT.exewith command-linefeatures.prefer_mxc=true. The savedconfig.tomlhaswindows.sandbox="elevated", and the feature flag was not explicitly set there. Only these exact flag names/boolean values were extracted; full command lines and private paths are omitted.rust-v0.162.0-alpha.2source documents that the feature can override legacy selection when eligible. To obtain proof for the historical tool invocation, could maintainers specify the supported per-command diagnostic or matching backend telemetry, and whether Desktop offers an authorized rollback to the legacy restricted elevated sandbox, not unrestricted Full Access, without changing managed security requirements? We have not changed any feature flag or executed another realpath probe.2026-10-12 — Desktop log corpus check (non-mutating): We discovered a separate Windows packaged Desktop application log directory (distinct from
CODEX_HOME/.sandbox) and searched all 25 local application log files, 41,639,756 bytes forprefer_mxc,WindowsMxc,windows_mxc,sandbox_backend,sandboxBackend,GetFinalPathNameByHandleW,realpath, andWinError 5: no matches. There were 13windowsSandbox/readinesslog references on other startup dates/times, but none in the original 2026-10-12 03:09 UTC error minute. There are Desktop log events around that minute, but they do not identify the selected per-command Windows sandbox backend. A bounded read-only inspection of a local Codex SQLite schema also found no obvious execution/sandbox/telemetry table. We have not changed settings, restarted the app, run readiness/setup, or repeated the failed realpath probe.This narrows the unresolved requirement to an authoritative per-command backend and effective managed-policy evidence path (or a security-preserving fix), not a request to run additional undirected filesystem commands. Please advise whether the original Desktop command's runtime backend/managed constraints can be retrieved using supported diagnostics or service-side telemetry, without lowering filesystem isolation or modifying audit controls. Absence from these local files is not proof that no other platform records exist. No raw logs or private paths are posted.
immsaigon commentedon Oct 12, 2026
Potentially relevant separate Windows AppContainer/lowbox canonical-path investigation: #45871.
That report isolates a DOS-device namespace behavior:
CreateFileWandGetFinalPathNameByHandleW(VOLUME_NAME_NT)can succeed whileGetFinalPathNameByHandleW(VOLUME_NAME_DOS)fails with access denied in a restricted Windows token, despite correct directory read/write ACLs. It also demonstrates a native-path resolution failure without ordinary file read failure.This is a hypothesis for comparison, not a confirmed root cause for #52593 or the independently reported Python
Path.resolve(strict=True)symptoms. In particular, the effective sandbox implementation/managed policy for the reported Desktop sessions is not known. If maintainers are investigating #52593, comparing the NT-versus-DOSGetFinalPathNameByHandleWbehavior and the device-namespace access policy may help narrow whether the denial is caused by the Windows sandbox boundary rather than directory ACLs.No security changes or additional reproductions are proposed here.
Ahlabeeb commentedon Oct 13, 2026
Same on CLI 0.162.1 with
[windows] sandbox = "mxc"on Windows 11 build 26200.9457.The root cause appears to be in the MXC/PSEC token rather than in Codex (details in microsoft/mxc#1464). Both the mount manager and
QueryDosDeviceWare denied, so libuvrealpath(NoderealpathSync.native) and Ruststd::fs::canonicalize(Deno) fail with EPERM / os error 5.VOLUME_NAME_NTstill works.Repro:
Result: EPERM.
Findings that matter Codex-side:
registryRead), the filesystem read/write/deny lists and the network policy. A user has no setting that can reach this.elevatedfallback is unusable while the desktop app is open. Setup refresh fails on every run withvalidate runtime read/execute access on ...\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe: ... (os error 32), because each Codex session keepsnode_repl.exerunning.:workspace, elevated setup grants the sandbox-users group read on every top-level item in%USERPROFILE%that isn't on the small secret-dir denylist (AppData, Desktop, Documents, Downloads, OneDrive, ...). That deserves a prominent note in the Windows sandbox docs.unelevatedstill allows outbound public TCP and still fails withspawn EPERMfor esbuild, so it isn't a substitute.Lookwright commentedon Oct 23, 2026
Additional Windows 10 reproduction: Native realpath EPERM despite authorized writable root
Environment:
Windows 10, build 19045
ChatGPT Desktop: 26.1016.62342
Microsoft Store package: 26.1016.8622.0
Bundled Codex CLI: 0.163.0-alpha.11.2
Node.js: v24.19.0
Execution: Local Codex/Work, restricted workspace permissions
An authorized development task requires canonical path validation before producing its next test artifact.
Node.js fs.realpathSync.native fails with:
EPERM: operation not permitted, realpath 'C:\Users<user>'
errno: -4048
syscall: realpath
The validation succeeds for C:\ and C:\Users but fails at the user-profile directory, before reaching the intended task output directory.
The intended descendant directory was registered in the Codex Project's saved roots and confirmed in the session's declared writable roots. The same native failure persisted.
A new bounded Work session was also created after registration, with the same result.
No source files or personal data were modified during the latest failed attempt. No ACL changes, sandbox disabling, permission escalation, alternate writers, or path-transformation bypasses were used.
The effective per-command Windows sandbox backend and underlying native Windows access-denial cause have not yet been established.
This appears closely related to #23483 and #52111, and to the native canonicalization behavior reported in this issue.
Could maintainers clarify: