Windows config footgun: `:root` + `"." = "write"` resolves to the drive root instead of the workspace
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:
:rootrefers to the filesystem root / drive root- it should not be used when the intent is workspace-local write access
:workspace_rootsis 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
:rootvs: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.
2 Comments
i checked this against current
main, and the behavior lines up with the parserthe key detail is that scoped filesystem entries special-case
".":compile_scoped_filesystem_path()returnscompile_filesystem_path(path)whensubpath == ".". so[permissions.<profile>.filesystem.":root"]with"." = "write"compiles toFileSystemSpecialPath::Rootwith write access, not to a cwd/workspace grantwhen a concrete path is needed,
Rootis resolved from the cwd root/ancestors, which is where anE:\...workspace becomesE:\on Windows. by contrast,:workspace_rootscompiles toProjectRoots { subpath: None }, then gets materialized against the active workspace roots/cwd lateri 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 enoughi 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_entriesCARGO_BUILD_JOBS=2 just test -p codex-core read_write_trailing_glob_suffix_compiles_as_subpath compile_permission_profile_workspace_roots_resolves_enabled_entriesboth pass locally
This solution seems pretty okay to me. It gives enough information to correct the issue without having to search through docs and source code.