Windows Codex App: authenticated SMB/UNC workspaces fail in both sandbox modes
What version of the Codex App are you using (From “About Codex” dialog)?
26.721.4979.0
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64 / Windows 11 Pro
What issue are you seeing?
Codex Desktop cannot reliably access projects located on a normal authenticated SMB share through UNC paths.
Example redacted writable roots:
\\server.example.local\\domains\\PROJECT_A<br>\\server.example.local\\domains\\PROJECT_B
With:
\[windows\]<br>sandbox = "elevated"
every sandboxed command fails before PowerShell starts. This also happens when the command is executed from a local TEMP directory because the sandbox setup refresh processes all configured UNC writable roots.
setup_error.json contains:
{"code":"helper_unknown_error","message":"setup refresh had errors"}
The sandbox log contains messages equivalent to:
granting write ACE to \\?\\UNC\\server.example.local\\domains\\PROJECT_A for sandbox group and capability SID<br>write ACE grant failed: SetNamedSecurityInfoW failed: 5<br>setup refresh completed with errors
After changing the configuration to:
\[windows\]<br>sandbox = "unelevated"
and restarting Codex, local sandboxed commands work. However, the allowed UNC repositories remain inaccessible.
The following was verified from inside the unelevated sandbox:
- The process runs under the same Windows user as the host.
- DNS resolves the SMB server correctly.
- TCP port 445 is reachable.
net useshows the mapped network share.- Windows Credential Manager contains the SMB credential.
Get-Itemagainst the UNC path returns Access denied.git -C <UNC path> statusreturns Access denied.- A requested UNC working directory is not used and PowerShell starts in its installation directory instead.
- The internal apply_patch operation can create a new file on the UNC share, but immediately fails to read or update that same file with os error 5.
Host PowerShell outside the Codex sandbox can access the same repositories normally.
What steps can reproduce the bug?
- On Windows 11, connect to an authenticated SMB share available through a UNC path.
- Open a Codex Desktop project located on that share and configure the UNC directory as an allowed writable root.
- Set:
\[windows\]<br>sandbox = "elevated"
- Restart Codex and run any sandboxed PowerShell command.
- Observe that sandbox setup refresh fails before the command starts with SetNamedSecurityInfoW error 5.
- Run the same test with a local TEMP directory as the working directory.
- Observe that setup still fails because all configured UNC writable roots are processed.
- Change the configuration to:
\[windows\]<br>sandbox = "unelevated"
- Restart Codex.
- Verify that local sandboxed commands work.
- Run Get-Item or git status against the explicitly allowed UNC project.
- Observe Access denied.
- Use apply_patch to create a file on the share and then attempt to update it.
- Observe that creation succeeds but reading or updating the file fails.
What is the expected behavior?
An explicitly allowed authenticated UNC workspace should remain accessible in at least the unelevated sandbox, which derives its restricted token from the current Windows user.
A failure to configure permissions for one UNC writable root should not prevent unrelated sandboxed commands from running from local directories.
File operations should behave consistently: if the sandbox can create a file, it should be able to read and update that file.
If authenticated SMB/UNC paths are not supported, Codex should detect them before setup and display a clear actionable message instead of the generic helper_unknown_error.
Additional information
Switching to the unelevated sandbox removes the repeated global setup-refresh failure, but UNC access still requires running commands outside the sandbox.
This appears related to issue openai/codex#25422, but differs because this is a normal authenticated SMB share rather than a Cryptomator virtual filesystem, and both elevated and unelevated sandbox modes are affected.
Related issue:<br>[https://github.com/openai/codex/issues/25422](<https://github.com/openai/codex/issues/25422>)
Feedback ID:<br>019f9dbb-8f86-7d01-8949-935b52c5b7c6
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I don’t believe this report should be closed as a duplicate of https://github.com/openai/codex/issues/35380. The similar errors may indicate that both cases are caused by the same underlying bug in the application, but https://github.com/openai/codex/issues/35476 reproduces it in a very different context: a normal authenticated SMB share rather than a \wsl.localhost workspace. It also provides additional diagnostics and demonstrates different behavior in elevated and unelevated sandbox modes. I believe keeping this report open gives the developers an important additional perspective for identifying the root cause and designing a complete fix.
Follow-up: source-level findings, credential isolation, and a possible secure SMB sandbox design
I performed additional controlled testing and reviewed the current public Codex Windows sandbox source with assistance from OpenAI Codex.
The results suggest that this problem consists of at least three layers:
The source observations below are investigation leads rather than confirmed root causes. The public
mainbranch may not exactly match the implementation bundled with Codex App26.721.4979.0.Verified behavior
The following behavior was reproduced in the affected environment:
Access deniedfor the UNC path.apply_patchcan create a file on the share in one path, but subsequently fails to read or update that file with error 5.CodexSandboxOnlineaccount can access the same SMB share when logged into Windows interactively after the NAS credential has been stored for that account.CodexSandboxOnlinestill cannot access the share.The short hostname and FQDN resolve to the same NAS. The issue does not appear to be caused by DNS or TCP reachability.
1. Elevated setup treats remote writable roots like local ACL-capable roots
The setup helper iterates through every configured write root, checks its ACL, and attempts to grant access to the local Codex sandbox group and generated workspace capability SIDs:
https://github.com/openai/codex/blob/8e271dc02b23d42827875019924be0f5005642b0/codex-rs/windows-sandbox-rs/src/bin/setup_main/win.rs#L830-L909
I could not find an early classification that separates:
\\?\UNC\...paths;A separate NAS cannot normally resolve locally generated Codex capability SIDs. Attempting to install those identities into a remote ACL is therefore a plausible explanation for:
Even if full SMB sandbox enforcement is not currently possible, one unsupported remote root should not cause every local sandbox command to fail during global setup refresh.
A safe implementation should not simply skip enforcement and run the remote path unsandboxed. However, Codex could at least:
helper_unknown_error;This is also relevant because the current Codex permissions documentation describes native Windows drive-letter and UNC paths as supported absolute paths.
2. The elevated runner deliberately does not load the sandbox user's profile
The current public source starts the elevated command runner using
CreateProcessWithLogonW, but passesdwLogonFlags = 0:https://github.com/openai/codex/blob/8e271dc02b23d42827875019924be0f5005642b0/codex-rs/windows-sandbox-rs/src/elevated/runner_client.rs#L331-L364
The source comment states:
Microsoft documents that
CreateProcessWithLogonWdoes not load the specified user's profile by default.LOGON_WITH_PROFILEor an explicitLoadUserProfilecall is required:https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithlogonw
Windows credentials are associated with the user's credential set and profile/logon context:
https://learn.microsoft.com/en-us/windows-server/security/windows-authentication/credentials-processes-in-windows-authentication
This provides a plausible explanation for the otherwise surprising result:
CodexSandboxOnlinelogin: the stored SMB credential works;CodexSandboxOnlinerunner: the same account name is used, but its normal profile state is deliberately not loaded.This appears to make storing an SMB credential interactively for
CodexSandboxOnlineineffective for the actual runner.The absence of profile loading may be an intentional security boundary. Therefore, globally changing the existing online runner to
LOGON_WITH_PROFILEshould probably be treated as a diagnostic experiment, not automatically as the preferred production fix.3. Loading an unrestricted profile globally would introduce persistent state
Loading a Windows profile makes the user's
HKEY_CURRENT_USER, profile configuration, application state, user certificate store, environment configuration, and other per-user state available to processes.This can create task-to-task persistence. For example, one task could modify:
A later task using the same loaded profile could inherit those changes.
Profile loading itself is not equivalent to a complete interactive Windows desktop login, and it does not automatically execute every Windows startup mechanism. However, applications may consume profile-specific configuration after launch. For example, PowerShell executes current-user profile scripts unless it is started with
-NoProfile:https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles
This is why I do not think the existing
CodexSandboxOnlineidentity should simply gain a normal persistent profile globally.4. A separate credential-enabled sandbox identity may preserve the security boundary
A safer product design could introduce a third, explicitly selected sandbox identity in addition to the current online and offline identities, for example:
CodexSandboxOffline: no network access;CodexSandboxOnline: network access without persistent user credentials;CodexSandboxCredentialed: an explicitly selected, dedicated identity for user-authorized authenticated network resources.This would be selective rather than global:
The NAS credential should be entered by the user through Windows, outside the model conversation. I would prefer this over a Codex-managed SMB credential store.
Codex should not need to receive, serialize, encrypt, log, or otherwise store the NAS password in:
config.toml;Windows already provides a credential boundary for this use case.
5. A Windows SMB credential is usable without normally exposing its plaintext password
For a credential stored as
CRED_TYPE_DOMAIN_PASSWORD, Microsoft documents that the credential blob contains the password, but the blob can only be read by the Windows authentication packages. NTLM, Kerberos, and Negotiate can automatically use the credential for the named target:https://learn.microsoft.com/en-us/windows/win32/api/wincred/ns-wincred-credentialw
Therefore, an ordinary sandbox process should be able to receive the capability to authenticate to the selected SMB target without being able to retrieve the plaintext password through normal credential APIs.
This is materially different from giving the password to the model or placing it in Codex-owned storage.
Generic Credential Manager entries have different read semantics and should not be used for this design. The implementation should require or document a target-specific
CRED_TYPE_DOMAIN_PASSWORD.The remaining security risk is intentional authorization rather than plaintext disclosure: the agent can use the permissions granted to the dedicated NAS account. The user should therefore remain responsible for assigning a suitably restricted NAS identity and share permission set.
6. A mandatory-profile-style baseline could limit task-to-task persistence
Windows supports Mandatory User Profiles. A mandatory profile is a preconfigured profile whose baseline cannot be permanently changed by the assigned user. Changes may be visible during the active session, but are discarded when the profile is properly logged off or unloaded:
https://learn.microsoft.com/en-us/windows/win32/shell/mandatory-user-profiles
This mechanism is assigned selectively to specific users; it is not inherently a machine-global setting.
A possible credential-enabled sandbox lifecycle would be:
-NoProfileand CMD with AutoRun disabled.A Mandatory Profile is not a complete filesystem snapshot. It would not revert:
Those areas still require normal sandbox enforcement and cleanup.
It also remains to be tested whether a target-specific
CRED_TYPE_DOMAIN_PASSWORDstored in a Mandatory Profile works reliably when that profile is loaded non-interactively by the Codex runner. I could not find Microsoft documentation covering this exact combination.If the native Mandatory Profile mechanism is incompatible with Credential Manager in this scenario, Codex could use an equivalent product-managed immutable profile baseline while still leaving the NAS credential itself under Windows protection.
7. Suggested safeguards for a credential-enabled sandbox
Possible safeguards include:
CRED_TYPE_DOMAIN_PASSWORDentries;pwsh -NoProfile;8. Unelevated mode requires a separate token-level investigation
The unelevated backend creates a restricted token from the current user's token and adds locally generated workspace capability SIDs:
https://github.com/openai/codex/blob/8e271dc02b23d42827875019924be0f5005642b0/codex-rs/windows-sandbox-rs/src/token.rs#L448-L505
The token uses
WRITE_RESTRICTED. Microsoft documents that restricting SIDs participate in an additional access check for write operations:https://learn.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-createrestrictedtoken
A remote NAS cannot normally resolve Codex's locally generated capability SIDs. This may make the restricted-token write model incompatible with a remote SMB filesystem even though the original user token and SMB credential are valid.
This remains a hypothesis. A focused test should compare, in the same Windows logon session:
9. Missing authenticated SMB integration coverage
The existing Windows sandbox smoke tests create their workspaces under the local user profile:
https://github.com/openai/codex/blob/8e271dc02b23d42827875019924be0f5005642b0/codex-rs/windows-sandbox-rs/sandbox_smoketests.py#L54-L58
The UNC-related test I found verifies that a UNC link cannot be used as a sandbox escape:
https://github.com/openai/codex/blob/8e271dc02b23d42827875019924be0f5005642b0/codex-rs/windows-sandbox-rs/sandbox_smoketests.py#L578-L585
It does not test a legitimate authenticated SMB workspace.
A useful regression matrix would cover:
apply_patch;Requested outcomes
The most useful outcomes would be:
AI assistance disclosure
I used OpenAI Codex to help design the diagnostic comparisons, inspect the public Codex source and official Microsoft documentation, analyze the security properties of the proposed alternatives, and draft this follow-up.
The tests were executed interactively in my affected environment and the observations were reviewed by me. No NAS password or other SMB secret was provided to Codex or included in this report.
Independent reproduction from the VS Code Codex extension on Windows.
Environment:
26.727.408160.146.0-alpha.9.2[windows] sandbox = "elevated"Observed behavior matches this report closely:
SetNamedSecurityInfoW failed: 5helper_unknown_error: setup refresh had errorsPath aliases that refer to the same SMB share do not avoid the failure because sandbox setup operates on the canonical UNC-backed root.
A useful control was a completely local fixed-NTFS workspace under the same elevated sandbox configuration. In that configuration, sandbox setup completed successfully and no UNC root participated. This strongly separates the SMB/UNC sandbox-setup failure from later tool-specific processing.
No share ACLs, firewall settings, sandbox security boundaries, or server permissions were weakened during testing.
A separate test of the documented
unelevatedsandbox fallback encountered the split-writable-root refusal tracked in #32839, so in this managed workspace configuration neither Windows sandbox implementation currently provides a complete fallback.Additional sanitized evidence from a VirtualBox Shared Folders workspace (no project content or private paths included).
Environment
\\vboxsvr\<sanitized-share>\<repo>019ffb4d-57a4-7e12-9660-9b8fb49ff14c<CODEX_HOME>\.sandbox\sandbox.2026-08-13.logConfirmed failure
git statuscan read the repository.VBoxSharedFolderFS, remote drive type, flags0x00000016.FILE_PERSISTENT_ACLS (0x00000008)is absent.\\?\UNC\VBOXSVR\..., attempts to grant the sandbox-group and capability-SID write ACE, then fails before command launch:``
``granting write ACE to \\?\UNC\VBOXSVR\... for sandbox group and capability SID
write ACE grant failed ... SetNamedSecurityInfoW failed: 1
setup refresh completed with errors
setup error: setup refresh had errors
ERROR_INVALID_FUNCTION; HRESULT form is0x80070001.apply_patchtherefore fails while preparing/reading an existing file; the repository file is never opened or modified.Path/mode experiments
GetFinalPathNameByHandleresolves it back to\\?\UNC\vboxsvr\....substonly aliases a local path. A directory junction cannot target UNC (Local volumes are required). A local directory symlink requires extra privilege and still resolves to the same underlying UNC filesystem/security semantics.windows.sandbox="unelevated"with built-in:workspaceon local NTFS passed create/read/delete and ran as the interactive user.UnauthorizedAccessException, HRESULT0x80070005;git -C <UNC> statusexited 128 with permission denied.Minimal reproduction
\\vboxsvr\<share>\reproas a Codex Desktop project with workspace-write and[windows] sandbox = "elevated".sample.txtoutside Codex, then ask Codex to update it withapply_patch.helper_unknown_error: setup refresh had errorsbefore command/file access and theSetNamedSecurityInfoW failed: 1log above.Source-level observation
Current main still queues
ensure_allow_write_acesfor write roots and pushes any error intorefresh_errors, after which refresh bails:Root-cause assessment
This is an interoperability gap: the elevated Windows sandbox assumes every writable root can persist a Windows DACL, while VBoxSharedFolderFS explicitly does not advertise persistent ACLs. Simply ignoring the ACE error is probably not sufficient/safe because the restricted identity still needs access and the ACE participates in the sandbox capability boundary.
Suggested product behavior
GetVolumeInformation[ByHandle]Wbefore ACL setup.FILE_PERSISTENT_ACLS, either use a brokered/path-validated I/O strategy, provide a supported non-ACL backend, or fail that root early with an actionable “use a local NTFS clone/workspace” message.Current safe workaround: open an independent local NTFS clone as the Codex project and use the normal central Git remote. Do not retain the VBox path as an additional writable root.
Independent reproduction on Codex Desktop for Windows, with an additional failure mode showing that an inaccessible remote writable root can poison
apply_patchoperations against a separate local NTFS workspace.Environment:
26.803.10989.0Observed behavior:
apply_patchcan create a new disposable file inside the local NTFS workspace.apply_patchupdate of an existing file in that same local NTFS workspace fails before reading the target:``
``apply_patch verification failed: Failed to read file to update <local-workspace>\...:
fs sandbox helper failed ... windows sandbox failed:
helper_unknown_error: setup refresh had errors
This reproduces the inconsistency already described here: creation may succeed while read/update verification fails. It also confirms that the failure is not necessarily limited to the remote target itself. When remote writable roots participate in sandbox setup refresh, an unrelated
apply_patchoperation against local NTFS can fail too.Practical impact:
helper_unknown_errorgives the user no actionable recovery instruction.Expected behavior:
Safe workaround requested:
No ACLs, sandbox settings, network credentials, or security controls were weakened during testing.