You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows sandbox denies writes inside a workspace configured as writable #51476
appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems
Hello. I’m using the Codex desktop app on Windows with a local project at C:\jarvis.
This workspace is configured for writing (workspace-write), but write attempts inside the project fail with “Access to the path is denied.” I reproduced this when trying to create a new file with both Set-Content and the patch tool. The Windows ACL lists Modify access for Authenticated Users.
I fully restarted Codex and tried again, but the error persists. The Windows sandbox setting in my Codex config is:
[windows]
sandbox = "unelevated"
What is the supported way to diagnose or repair the sandbox so Codex can write to its configured workspace? I do not want to change Windows security policies.
Additional reproduction: write access denied with elevated Windows sandbox
I am seeing a similar write-denial symptom on Windows, but with a different sandbox configuration. I am sharing the observations here in case they are related; I have not established that the root cause is the same.
Environment
Codex CLI: codex-cli 0.164.0
Windows version/build: not yet recorded
User configuration previously observed: [windows] sandbox = "elevated"
Active agent execution metadata: workspace-write, with the project workspace reported as the writable root.
Observed behavior
Read-only access to the test workspace succeeded.
The inspected ACLs showed inherited Modify permissions for CodexSandboxUsers and Authenticated Users. This ACL output does not establish effective sandbox authorization.
The runner attempted to create a missing tests\fixtures\runs directory and reported Access to the path ... is denied.
A separate one-time temporary-file probe, executed through the same Codex agent command path inside the existing tests\fixtures directory, failed during .NET File.WriteAllText with:
The temporary file was confirmed absent after cleanup.
The probe printed PROBE_RESULT=FAIL, but the execution tool returned exit code 0 because the script caught the exception and did not explicitly exit nonzero. This was a probe exit-status handling issue, not a successful write.
The runner startup handler requests exit code 78, while the earlier execution tool reported 1; the propagation path remains unverified.
A direct codex sandbox read-only command succeeded. An MXC compatibility probe failed with native MXC is unavailable on this executor. No relevant sandbox denial log was available, so the denying layer could not be identified.
The test workspace path and project files have been omitted from this report for privacy. No ACLs, sandbox settings, or security settings were changed, and the 11-case test batch was not rerun.
Current assessment: The observed write-denial behavior is reproducible through the Codex agent execution path, but the root cause remains inconclusive. I have not established whether Windows filesystem authorization, the Codex sandbox, or another execution layer denied the operation. I also have not performed an equivalent write test outside Codex to compare the behavior.
Could the maintainers advise which non-destructive diagnostic is supported for distinguishing these possibilities under the Windows elevated sandbox, without disabling sandbox protection or switching to Full Access?
.NET File.WriteAllText failed with UnauthorizedAccessException and Access to the path ... is denied.
The temporary file was confirmed absent afterward.
Overall: PROBE_RESULT=FAIL
The host-side test used a unique temporary filename, created it without overwriting an existing file, verified its contents, and removed it successfully. Neither test modified the project source, ACLs, or sandbox configuration.
Additional read-only inspection found:
The workspace root is owned by the interactive Windows user.
tests and tests\fixtures are owned by CodexSandboxOffline.
The displayed ACLs contain inherited Modify allow rules.
The latest available sandbox log shows repeated SetFileAttributesW failures for C:\Users\Default, but the subsequent setup-refresh entries report errors=[]. I found no log record that directly links that warning to the write failure in tests\fixtures.
Assessment: Host-side file creation, readback, and deletion succeed, while the equivalent write through the Codex agent path fails. This strongly suggests a difference in effective execution permissions or sandbox enforcement, but does not establish the exact cause. The owner difference is an observation, not a confirmed cause.
Could maintainers recommend the supported diagnostic for identifying the effective Windows security context and the specific layer denying the Codex agent's write, without disabling the sandbox or switching to unrestricted access?
Environment detail: Windows version/build confirmed
I have now recorded the Windows environment details that were missing from my earlier report:
Windows product: Windows 10 Pro
Windows release: 22H2, based on OS build 19045
OS build number reported by Get-ComputerInfo: 19045
Architecture: 64-bit
Get-ComputerInfo reports WindowsVersion = 2009; I am including this as the raw property value rather than interpreting it as the marketing release.
The previously reported A/B result remains unchanged: a temporary-file create/read/delete probe succeeds in the ordinary VS Code PowerShell terminal but fails with UnauthorizedAccessException through the Codex agent execution path.
No ACLs, ownership, sandbox settings, or project files have been changed during this additional environment check. The underlying cause remains undetermined.
appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems
Activity
github-actions commentedon Oct 6, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
dngtech commentedon Oct 25, 2026
Additional reproduction: write access denied with elevated Windows sandbox
I am seeing a similar write-denial symptom on Windows, but with a different sandbox configuration. I am sharing the observations here in case they are related; I have not established that the root cause is the same.
Environment
codex-cli 0.164.0[windows] sandbox = "elevated"workspace-write, with the project workspace reported as the writable root.Observed behavior
Modifypermissions forCodexSandboxUsersandAuthenticated Users. This ACL output does not establish effective sandbox authorization.tests\fixtures\runsdirectory and reportedAccess to the path ... is denied.tests\fixturesdirectory, failed during.NET File.WriteAllTextwith:System.Management.Automation.MethodInvocationExceptionFullyQualifiedErrorId:UnauthorizedAccessExceptionAccess to the path ... is denied0x80131501PROBE_RESULT=FAIL, but the execution tool returned exit code0because the script caught the exception and did not explicitly exit nonzero. This was a probe exit-status handling issue, not a successful write.78, while the earlier execution tool reported1; the propagation path remains unverified.codex sandboxread-only command succeeded. An MXC compatibility probe failed withnative MXC is unavailable on this executor. No relevant sandbox denial log was available, so the denying layer could not be identified.The test workspace path and project files have been omitted from this report for privacy. No ACLs, sandbox settings, or security settings were changed, and the 11-case test batch was not rerun.
Current assessment: The observed write-denial behavior is reproducible through the Codex agent execution path, but the root cause remains inconclusive. I have not established whether Windows filesystem authorization, the Codex sandbox, or another execution layer denied the operation. I also have not performed an equivalent write test outside Codex to compare the behavior.
Could the maintainers advise which non-destructive diagnostic is supported for distinguishing these possibilities under the Windows
elevatedsandbox, without disabling sandbox protection or switching to Full Access?dngtech commentedon Oct 25, 2026
Follow-up: Host PowerShell write test succeeds, Codex agent write test fails
I performed a one-time A/B comparison against the same existing
tests\fixturesdirectory.Outside Codex — ordinary VS Code PowerShell Extension terminal
DESKTOP-DCE4NA1\AdminWRITE_OK,READBACK_OK,CLEANUP_OK; TEMP_FILE_ABSENTPROBE_RESULT=PASSThrough the Codex agent command-execution path
.NET File.WriteAllTextfailed withUnauthorizedAccessExceptionandAccess to the path ... is denied.PROBE_RESULT=FAILThe host-side test used a unique temporary filename, created it without overwriting an existing file, verified its contents, and removed it successfully. Neither test modified the project source, ACLs, or sandbox configuration.
Additional read-only inspection found:
testsandtests\fixturesare owned byCodexSandboxOffline.SetFileAttributesWfailures forC:\Users\Default, but the subsequent setup-refresh entries reporterrors=[]. I found no log record that directly links that warning to the write failure intests\fixtures.Assessment: Host-side file creation, readback, and deletion succeed, while the equivalent write through the Codex agent path fails. This strongly suggests a difference in effective execution permissions or sandbox enforcement, but does not establish the exact cause. The owner difference is an observation, not a confirmed cause.
Could maintainers recommend the supported diagnostic for identifying the effective Windows security context and the specific layer denying the Codex agent's write, without disabling the sandbox or switching to unrestricted access?
dngtech commentedon Oct 25, 2026
Environment detail: Windows version/build confirmed
I have now recorded the Windows environment details that were missing from my earlier report:
Get-ComputerInfo:19045Get-ComputerInforeportsWindowsVersion = 2009; I am including this as the raw property value rather than interpreting it as the marketing release.The previously reported A/B result remains unchanged: a temporary-file create/read/delete probe succeeds in the ordinary VS Code PowerShell terminal but fails with
UnauthorizedAccessExceptionthrough the Codex agent execution path.No ACLs, ownership, sandbox settings, or project files have been changed during this additional environment check. The underlying cause remains undetermined.