Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.1007.21434
What subscription do you have?
Not provided
What platform is your computer?
Microsoft Windows NT 10.0.26300.0 x64
What issue are you seeing?
Summary
Codex Desktop on Windows fails to execute native filesystem directory changes inside its normal Workspace Write sandbox, even when the target directory is readable and belongs to an authorized workspace.
The same operations succeed immediately when switching Codex to Full Access.
This is not specific to Flutter. The problem affects CMD, Git, and the Windows native current-directory API. Flutter and Dart failures are downstream consequences.
Actual behavior
Inside Codex with Workspace Write permissions:
Test 1 — Native CMD directory access
cmd.exe /d /c "cd /d C:\Tools\flutter && cd"Result:
Access is denied.
Exit code: 1Test 2 — Native CMD access to an existing project workspace
cmd.exe /d /c "cd /d D:\Projects\<workspace> && cd"Result:
Access is denied.
Exit code: 1Test 3 — Git repository access
git -C C:\Tools\flutter rev-parse HEADResult:
fatal: cannot change to 'C:\Tools\flutter': Permission denied
Exit code: 1Test 4 — Windows native current-directory API
[System.IO.Directory]::SetCurrentDirectory('C:\Tools\flutter')Result:
MethodInvocationException:
Exception calling "SetCurrentDirectory" with "1" argument(s):
"Access to the path 'C:\Tools\flutter' is denied."PowerShell can access the same directory
Interestingly, these operations succeed inside the same sandbox:
Get-ChildItem -LiteralPath 'C:\Tools\flutter' -NameSet-Location -LiteralPath 'C:\Tools\flutter'
Get-Content -LiteralPath 'C:\Tools\flutter.git\HEAD' -TotalCount 1
Git itself launches correctly:
git version 2.56.0.windows.2This suggests that ordinary filesystem reading works, while native directory-handle operations fail.
Impact on Flutter development
Running flutter --version inside Codex produces:
fatal: cannot change to 'C:\Tools\flutter': Permission deniedInvoke-Expression:
C:\Tools\flutter\bin\internal\update_engine_version.ps1:62You cannot call a method on a null-valued expression.
Error: Unable to determine engine version...
Some Flutter and Dart commands also hang until manually terminated.
However, Flutter, Dart, Git, and native CMD directory changes work correctly outside Codex and in Full Access mode.
Process Monitor evidence
Microsoft Sysinternals Process Monitor captured the exact filesystem failures.
First denial — Codex's bundled PowerShell runtime
Process: cmd.exe
Operation: CreateFilePath:
C:\Users<USER>.cache\codex-runtimes
codex-primary-runtime\dependencies\native\powershellResult: ACCESS DENIED
Desired Access: Execute/Traverse, Synchronize
Disposition: Open
Options: Directory, Synchronous IO Non-Alert
Second denial — Flutter SDK
Process: cmd.exe
PID: 23544
Operation: CreateFile
Path: C:\Tools\flutterResult: ACCESS DENIED
Desired Access: Execute/Traverse, Synchronize
Disposition: Open
Options: Directory, Synchronous IO Non-Alert
The captured process sequence:
codex.exe
|
v
pwsh.exe
|
v
cmd.exe
|
v
CreateFile(C:\Tools\flutter)
|
v
ACCESS DENIED (WinError 5)The first access denial involves Codex's own runtime directory, before the Flutter SDK denial.
Therefore, this is not merely a missing Flutter SDK permission.
ProcMon establishes the denied access request but does not identify the precise Windows security rule responsible.
Full Access comparison
Running the identical tests in Codex Full Access mode:
| Command | Workspace Write | Full Access |
|---|---|---|
| CMD change to project directory | FAIL | PASS |
| CMD change to Flutter SDK | FAIL | PASS |
| Git read Flutter revision | FAIL | PASS |
| flutter --version | FAIL | PASS |
| dart --version | FAIL | PASS |
| flutter analyze execution | FAIL / timeout | Completes |
In Full Access, Flutter 3.47.7 and Dart 3.13.5 initialize normally. Static analysis also completes; separate missing-dependency diagnostics are unrelated to this sandbox issue.
The sandbox boundary is the distinguishing factor.
What steps can reproduce the bug?
- Install Codex Desktop on Windows 11.
- Open an existing local development project.
- Select Workspace Write permissions, not Full Access.
- Ask Codex to execute:
cmd.exe /d /c "cd /d C:\Tools\flutter && cd"- Observe:
Access is denied.
Exit code: 1
- Test an existing project workspace:
cmd.exe /d /c "cd /d D:\Projects\<workspace> && cd"- Observe the same error.
- Run:
[System.IO.Directory]::SetCurrentDirectory('C:\Tools\flutter')- Observe a Windows access-denied exception.
- Switch Codex to Full Access.
- Repeat the same CMD and Git tests. They succeed immediately.
The problem reproduces after a complete Codex uninstall, removal of previous generated sandbox/runtime components, and a clean reinstall.
No source-code modification is required to reproduce the issue.
Session ID and token/context-window usage were not captured. The issue is reproducible independently of model context usage.
Additional reproduction: Standalone Codex CLI
I also tested the standalone Codex CLI, launched from normal Windows PowerShell outside Codex Desktop.
The CLI reproduces the same native directory-access failure under Workspace Write sandbox permissions.
Therefore, the issue is not exclusive to the Codex Desktop application. Both Desktop and CLI exhibit the failure, while commands work outside Codex or with Full Access.
This suggests a problem in their shared Windows sandbox implementation or its interaction with the host Windows security environment.
The exact underlying security rule responsible for the denial remains unidentified.
What is the expected behavior?
Codex in Workspace Write mode should be able to execute native Windows commands and change the current working directory to an authorized project workspace or a readable external development SDK.
Basic commands such as these should work without requiring Full Access:
cmd.exe /d /c "cd /d C:\Tools\flutter && cd"
git -C C:\Tools\flutter rev-parse HEAD
flutter --version
dart --version
flutter pub get
flutter analyzeThe sandbox should continue protecting unauthorized filesystem locations and restricting unsafe operations.
Users should not need to disable sandbox isolation just to run standard development tools.
A permanent fix should preserve Workspace Write security rather than require danger-full-access.
Additional information
Environment
- Product: Codex Desktop App for Windows
- OS: Microsoft Windows NT 10.0.26300.0 x64
- Workspace Dependencies version: 26.1009.11318
- Bundled Node.js and Python tools: Enabled
- Subscription: ChatGPT Go
- Flutter: 3.47.7 stable
- Dart: 3.13.5
- Git: 2.56.0.windows.2
- Sandbox permissions: Workspace Write
- Sandboxed process integrity: Low Mandatory Level
Background
Codex previously worked correctly with Flutter and other development tools before an SSD replacement and software environment reinstallation.
After the replacement, Flutter was installed at C:\Tools\flutter.
However, the error also occurs inside a development project on D:, so it is not exclusively related to the Flutter SDK location.
Troubleshooting already attempted
I have extensively investigated this issue.
Sandbox configuration:
- Tested
unelevatedWindows sandbox. - Tested
elevatedWindows sandbox. - Tested the MXC sandbox option.
- Executed the elevated sandbox provisioning procedure.
- Expanded
writable_rootsto include the entire Flutter SDK. - Confirmed the issue persists inside an authorized project workspace.
Windows permissions:
- Verified inherited NTFS directory ACLs.
- Temporarily granted Read & Execute to
Everyone. - Temporarily granted Read & Execute to
CodexSandboxUsers. - Neither change fixed the problem.
- Restored and verified the original NTFS permissions afterward.
The original Flutter directory ACLs include:
BUILTIN\Administrators: Full Control
NT AUTHORITY\SYSTEM: Full Control
BUILTIN\Users: Read & Execute
NT AUTHORITY\Authenticated Users: Modify
Sandbox diagnostics:
- Confirmed the sandbox runs at Low Mandatory Integrity Level.
- Verified PowerShell file listing and reading succeed.
- Verified native
SetCurrentDirectoryfails. - Captured Windows
CreateFilefailures with Process Monitor. - Inspected sandbox setup logs.
- Verified the persisted sandbox ACL-state JSON is syntactically valid.
- Attempted Windows File System failure auditing; no matching Event 4656 was recorded.
The temporary audit rules were removed, and the original audit policy was restored.
Fresh installation:
- Completely uninstalled Codex.
- Removed old runtime files and generated sandbox components.
- Reinstalled Codex.
- Repeated the same tests with a fresh installation.
- The exact permission failure remained.
This suggests the problem is not simply a corrupted project configuration or broken Flutter installation.
Related GitHub issues
- Codex Desktop Windows PowerShell cwd / PSDrive Initialization Bug #29688 — Windows PowerShell cwd / PSDrive initialization bug
- Windows sandbox: native realpath returns EPERM inside writable workspace #52593 — Windows sandbox native path-resolution EPERM
- In sandbox commands like flutter test / flutter analyze have no respond #15038 — Flutter commands fail or hang inside the sandbox
These may be related, but the precise root cause of this reproduction has not been established.
Request to the Codex team
Could you investigate why a sandboxed native Windows process is denied Execute/Traverse, Synchronize when opening directories that should be accessible, including authorized workspaces and Codex's own bundled runtime directory?
Specifically, could this originate from:
- Incorrect restricted-token or sandbox SID access checks?
- Mandatory integrity policies?
- Native subprocess initialization?
- Windows filesystem filter enforcement?
- A regression in Windows sandbox permission handling?
Please provide a supported fix or configuration mechanism that restores these native filesystem operations without requiring Full Access.
This issue blocks ordinary development workflows across Flutter, Dart, Git, and other native Windows tools.
Activity
github-actions commentedon Oct 11, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
RJKRanathunga commentedon Oct 11, 2026
Additional diagnostic: Windows sandbox working-directory mismatch and workspace access denial
I reproduced another failure in Workspace Write mode, without command-rule exemptions.
The command runner was configured to use an existing local Git repository, represented below as
<WORKSPACE>. The exact project path is intentionally redacted.Observed working directories:
Both
C:andD:were registered as PowerShell filesystem drives.Attempts to access the workspace:
Native CMD working directory:
The process-level current directory identifies the intended workspace, but PowerShell and CMD operate from Codex's runtime directory.
The same repository works correctly in ordinary Windows PowerShell and Codex Full Access mode.
Additional reproduction:
npm.cmd run buildin Workspace Write searches forpackage.jsonin the Codex runtime directory instead of the requested website directory.decision = "allow"permit individual failing commands to succeed outside the sandbox, but do not repair general sandbox behavior.This appears to involve both working-directory initialization and native filesystem access restrictions.
The exact cause remains unidentified.
Related issue: #29688.
sikarabbit commentedon Oct 27, 2026
Additional reproduction: authorized workspace reads fail and PowerShell starts in the runtime directory
Summary
Codex Desktop on Windows denies directory listing and file reads inside an explicitly authorized
workspace-writeworkspace.Despite the command runner specifying the workspace as
workdir, PowerShell reports its location as Codex's bundled runtime directory, while[Environment]::CurrentDirectoryidentifies the intended workspace.Previously recorded execution using
require_escalatedsuccessfully listed the workspace and read the same three files. Restarting Codex Desktop did not resolve ordinary sandbox access.Environment
prodworkspace-writesandbox_permissions: "use_default"auto_reviewThe Windows build reported by the author of #53174 is not substituted for this machine's missing build information.
Workspace authorization
The execution environment explicitly included the project directory in its writable roots. The command runner also specified that directory as
workdir.All paths below are anonymized.
F:\Projects\Example Workspacepreserves the original drive letter and presence of spaces without disclosing the private project name.An additional Codex-managed visualization directory was authorized; its identifying components are omitted.
Reproduction
These steps describe already recorded tests; no permission tests were rerun while preparing this report.
workspace-writewith normaluse_defaultexecution.workdirto the authorized workspace.Actual results
Directory listing and all three file reads failed:
Earlier diagnostic records additionally captured:
PowerShell error identifiers:
The post-restart diagnostic recorded:
The diagnostic wrapper caught individual errors and continued, so its overall exit code was
0. That exit code does not indicate successful filesystem access.Historical
require_escalatedcomparisonA prior diagnostic conversation contains a completed command execution and its output, together with the accompanying report explicitly identifying it as
require_escalatedexecution.Relevant commands from that recorded execution are reproduced below with paths anonymized; unrelated process/account and ACL inspection is omitted:
Recorded results:
require_escalatedexecutionPROJECT_STATUS.mdDECISION_LOG.mdPROJECT_HANDOFF.mdGet-LocationThe successful command completed with exit code
0. Private directory names and document-heading contents are omitted.Evidence limitation: The historical conversation viewer exposes the executed command, output and accompanying execution-mode description, but does not expose the original structured
sandbox_permissionsargument in the command summary. This was a per-command escalation comparison, not a documented switch of the entire application to Full Access.Persistence after restart
The user reported restarting Codex Desktop before the October 27 diagnostic. The subsequent normal sandbox execution still failed to list the workspace or read the three files and still showed the directory mismatch.
No Windows restart or clean reinstall was verified in this case.
Expected behavior
Normal
workspace-writeexecution should permit directory listing and file reads within its explicitly authorized workspace.PowerShell should initialize to the command runner's requested working directory, or report a clear initialization failure. Absolute-path reads should not require escalation for an authorized workspace.
Relationship to #53174
The existing issue and its follow-up diagnostic describe authorized-workspace access failures and the same runtime-directory versus process-directory mismatch.
Relevant differences:
The overlap supports adding evidence to #53174 first, but does not establish an identical root cause.
Scope and privacy
This report was prepared from existing diagnostic records, application version metadata and the public issue. No new permission tests, installations, system-setting changes or project-file modifications were performed.
Usernames, machine names, private project paths, media names and session identifiers have been removed. No private document contents are attached.
denelon commentedon Nov 5, 2026
A Microsoft MXC issue may provide useful diagnostic context for the native working-directory and path-resolution failures reported here:
Both reports describe native tools failing to establish or resolve working directories inside a Windows sandbox even though some PowerShell filesystem reads succeed, with Git among the affected tools. The lower-level evidence differs: this Codex report observes
CreateFiledirectory opens being denied, while the MXC issue reports successful handle creation followed by failure during DOS-path translation. The issues may therefore involve adjacent path-handling behavior, but the correlation does not establish a shared root cause.Drafted with GitHub Copilot assistance.