Windows config footgun: `:root` + `"." = "write"` resolves to the drive root instead of the workspace

Open 💬 2 comments Opened Jul 1, 2026 by iskandersierra

What is the type of issue?

Documentation is confusing

What is the issue?

On Windows, a configuration like this can be interpreted much more broadly than a user may expect:

[permissions.<profile>.filesystem.":root"]
"." = "write"

I initially assumed this meant “write access to the current workspace directory”.

In practice, for a workspace located on E:\..., this ended up resolving to the drive root () rather than the repository root. That caused confusing sandbox startup failures that looked like runtime or ACL problems rather than a configuration semantics issue.

In my case, I observed failures such as:

  • ACL-related setup failures on E:\
  • later, after partial config changes, SetTokenInformation(TokenDefaultDacl) failed: 1344

After tracing the behavior and narrowing the config, the issue was resolved.

What fixed it

The correct configuration for workspace-local write access was:

[permissions.<profile>.filesystem.":workspace_roots"]
"." = "write"

I also removed an overly broad extra workspace root from the active profile.

After that:

  • process launch worked
  • Get-Location executed successfully
  • a temporary file could be created and deleted inside the repo
  • the process exited with code 0

Why I’m filing this as a docs issue

I’m not reporting this as a hard product bug.

This is a documentation/UX issue because the current semantics are easy to misread on Windows:

  • :root + "." = "write" can be understood as “current working directory”
  • but it effectively targets the filesystem/volume root for the current cwd

That makes the resulting failures difficult to diagnose.

Suggested documentation improvement

Please consider documenting explicitly that:

  • :root refers to the filesystem root / drive root
  • it should not be used when the intent is workspace-local write access
  • :workspace_roots is the safer choice for repo-scoped write permissions

A validation warning for this pattern on Windows would also help in future versions, but the main issue here is that this behavior is subtle and easy to misunderstand from config alone.

Where did you find it?

I found it while using Codex on Windows and then traced the behavior through the Codex source code and local config.

Relevant areas:

  • Codex config semantics for :root vs :workspace_roots
  • Windows sandbox startup behavior
  • Permission profile configuration on Windows

I did not find an obvious documentation page clearly warning that :root with "." = "write" can resolve to the drive root on Windows.

View original on GitHub ↗

2 Comments

Ap4sh · 1 month ago

i checked this against current main, and the behavior lines up with the parser

the key detail is that scoped filesystem entries special-case ".": compile_scoped_filesystem_path() returns compile_filesystem_path(path) when subpath == ".". so [permissions.<profile>.filesystem.":root"] with "." = "write" compiles to FileSystemSpecialPath::Root with write access, not to a cwd/workspace grant

when a concrete path is needed, Root is resolved from the cwd root/ancestors, which is where an E:\... workspace becomes E:\ on Windows. by contrast, :workspace_roots compiles to ProjectRoots { subpath: None }, then gets materialized against the active workspace roots/cwd later

i think a small startup warning for scoped :root + "." would catch this without changing existing semantics. something like "did you mean :workspace_roots?" would probably be enough

i also ran the relevant local checks:

  • CARGO_BUILD_JOBS=2 just test -p codex-protocol materialize_project_roots_with_workspace_roots_expands_exact_and_glob_entries materialize_project_roots_with_cwd_expands_symbolic_glob_entries
  • CARGO_BUILD_JOBS=2 just test -p codex-core read_write_trailing_glob_suffix_compiles_as_subpath compile_permission_profile_workspace_roots_resolves_enabled_entries

both pass locally

iskandersierra · 1 month ago

This solution seems pretty okay to me. It gives enough information to correct the issue without having to search through docs and source code.