Skip to content

Windows Codex App: authenticated SMB/UNC workspaces fail in both sandbox modes #35476

Description

@SilverHandCZ

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
\server.example.local\domains\PROJECT_B

With:

[windows]
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
write ACE grant failed: SetNamedSecurityInfoW failed: 5
setup refresh completed with errors

After changing the configuration to:

[windows]
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 use shows the mapped network share.
  • Windows Credential Manager contains the SMB credential.
  • Get-Item against the UNC path returns Access denied.
  • git -C <UNC path> status returns 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?

  1. On Windows 11, connect to an authenticated SMB share available through a UNC path.

  2. Open a Codex Desktop project located on that share and configure the UNC directory as an allowed writable root.

  3. Set:

    [windows]
    sandbox = "elevated"

  4. Restart Codex and run any sandboxed PowerShell command.

  5. Observe that sandbox setup refresh fails before the command starts with SetNamedSecurityInfoW error 5.

  6. Run the same test with a local TEMP directory as the working directory.

  7. Observe that setup still fails because all configured UNC writable roots are processed.

  8. Change the configuration to:

    [windows]
    sandbox = "unelevated"

  9. Restart Codex.

  10. Verify that local sandboxed commands work.

  11. Run Get-Item or git status against the explicitly allowed UNC project.

  12. Observe Access denied.

  13. Use apply_patch to create a file on the share and then attempt to update it.

  14. 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 #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:
#25422

Feedback ID:
019f9dbb-8f86-7d01-8949-935b52c5b7c6

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions