Include legacy deny paths in elevated Windows sandbox setup#17365
Merged
iceweasel-oai merged 1 commit intomainfrom Apr 13, 2026
Merged
Include legacy deny paths in elevated Windows sandbox setup#17365iceweasel-oai merged 1 commit intomainfrom
iceweasel-oai merged 1 commit intomainfrom
Conversation
0c71507 to
a394593
Compare
viyatb-oai
approved these changes
Apr 11, 2026
a394593 to
45736c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This updates the Windows elevated sandbox setup/refresh path to include the legacy
compute_allow_paths(...).denyprotected children in the same deny-write payload pipe added for split filesystem carveouts.Concretely, elevated setup and elevated refresh now both build deny-write payload paths from:
compute_allow_paths(...).deny, which includes existing.git,.codex, and.agentschildren under writable rootsThis lets the elevated backend protect
.gitconsistently with the unelevated/restricted-token path, and removes the old janky hard-coded.codex/.agentselevated setup helpers in favor of the shared payload path.Root Cause
The landed split-carveout PR threaded a
deny_write_pathspipe through elevated setup/refresh, but the legacy workspace-write deny set fromcompute_allow_paths(...).denywas not included in that payload. As a result, elevated workspace-write did not apply the intended deny-write ACLs for existing protected children like<cwd>/.git.Notes
The legacy protected children still only enter the deny set if they already exist, because
compute_allow_pathsfilters.git,.codex, and.agentswithexists(). Missing explicit split-policy deny paths are preserved separately because setup intentionally materializes those before applying ACLs.Validation
cargo fmt --check -p codex-windows-sandboxcargo test -p codex-windows-sandboxcargo build -p codex-cli -p codex-windows-sandbox --binscodex execsmoke withwindows.sandbox='elevated': fresh git repo, attempted append to.git/config, observedAccess is denied, marker not written, Deny ACE present on.gitcodex execsmoke withwindows.sandbox='unelevated': fresh git repo, attempted append to.git/config, observedAccess is denied, marker not written, Deny ACE present on.git