Skip to content

Include legacy deny paths in elevated Windows sandbox setup#17365

Merged
iceweasel-oai merged 1 commit intomainfrom
codex/elevated-workspace-deny-paths
Apr 13, 2026
Merged

Include legacy deny paths in elevated Windows sandbox setup#17365
iceweasel-oai merged 1 commit intomainfrom
codex/elevated-workspace-deny-paths

Conversation

@iceweasel-oai
Copy link
Copy Markdown
Collaborator

Summary

This updates the Windows elevated sandbox setup/refresh path to include the legacy compute_allow_paths(...).deny protected 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:

  • explicit split-policy deny-write paths, preserving missing paths so setup can materialize them before applying ACLs
  • legacy compute_allow_paths(...).deny, which includes existing .git, .codex, and .agents children under writable roots

This lets the elevated backend protect .git consistently with the unelevated/restricted-token path, and removes the old janky hard-coded .codex / .agents elevated setup helpers in favor of the shared payload path.

Root Cause

The landed split-carveout PR threaded a deny_write_paths pipe through elevated setup/refresh, but the legacy workspace-write deny set from compute_allow_paths(...).deny was 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_paths filters .git, .codex, and .agents with exists(). Missing explicit split-policy deny paths are preserved separately because setup intentionally materializes those before applying ACLs.

Validation

  • cargo fmt --check -p codex-windows-sandbox
  • cargo test -p codex-windows-sandbox
  • cargo build -p codex-cli -p codex-windows-sandbox --bins
  • Elevated codex exec smoke with windows.sandbox='elevated': fresh git repo, attempted append to .git/config, observed Access is denied, marker not written, Deny ACE present on .git
  • Unelevated codex exec smoke with windows.sandbox='unelevated': fresh git repo, attempted append to .git/config, observed Access is denied, marker not written, Deny ACE present on .git

@iceweasel-oai iceweasel-oai changed the title [codex] Include legacy deny paths in elevated Windows sandbox setup Include legacy deny paths in elevated Windows sandbox setup Apr 10, 2026
@iceweasel-oai iceweasel-oai marked this pull request as ready for review April 10, 2026 19:27
@iceweasel-oai iceweasel-oai force-pushed the codex/elevated-workspace-deny-paths branch from 0c71507 to a394593 Compare April 10, 2026 21:52
@iceweasel-oai iceweasel-oai force-pushed the codex/elevated-workspace-deny-paths branch from a394593 to 45736c1 Compare April 13, 2026 17:11
@iceweasel-oai iceweasel-oai merged commit 0131f99 into main Apr 13, 2026
19 of 22 checks passed
@iceweasel-oai iceweasel-oai deleted the codex/elevated-workspace-deny-paths branch April 13, 2026 17:49
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants