fix: align core approvals with split sandbox policies#14171
Merged
viyatb-oai merged 4 commits intomainfrom Mar 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef8cb44979
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ef8cb44 to
b6118e0
Compare
This was referenced Mar 10, 2026
971fab4 to
d3aa8db
Compare
celia-oai
approved these changes
Mar 11, 2026
codex-rs/core/src/tools/runtimes/shell/unix_escalation_tests.rs
Outdated
Show resolved
Hide resolved
a6ed2e6 to
d4f22d3
Compare
viyatb-oai
added a commit
that referenced
this pull request
Mar 12, 2026
## Stack fix: fail closed for unsupported split windows sandboxing #14172 fix: preserve split filesystem semantics in linux sandbox #14173 fix: align core approvals with split sandbox policies #14171 -> refactor: centralize filesystem permissions precedence #14174 ## Summary - add a shared per-path split filesystem precedence helper in `FileSystemSandboxPolicy` - derive readable, writable, and unreadable roots from the same most-specific resolution rules - add regression coverage for nested `write` / `read` / `none` carveouts and legacy bridge enforcement detection ## Testing - cargo test -p codex-protocol - cargo clippy -p codex-protocol --tests -- -D warnings
d4f22d3 to
441353d
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.
Stack
fix: fail closed for unsupported split windows sandboxing #14172
fix: preserve split filesystem semantics in linux sandbox #14173
-> fix: align core approvals with split sandbox policies #14171
refactor: centralize filesystem permissions precedence #14174
Why This PR Exists
This PR is intentionally narrower than the title may suggest.
Most of the original split-permissions migration already landed in the earlier
#13434 -> #13453stack. In particular:#13439already did the broad runtime plumbing for split filesystem and network policies.#13445already movedapply_patchsafety onto filesystem-policy semantics.#13448already switched macOS Seatbelt generation to split policies.#13449and#13453already handled Linux helper and bubblewrap enforcement.#13440already introduced the first protocol-side helpers for deriving effective filesystem access.The reason this PR still exists is that after the follow-on
[permissions]work and the new shared precedence helper in#14174, a few core approval paths were still deciding behavior from the legacySandboxPolicyprojection instead of the split filesystem policy that actually carries the carveouts.That means this PR is mostly a cleanup and alignment pass over the remaining core consumers, not a fresh sandbox backend migration.
What Is Actually New Here
FileSystemSandboxPolicyinstead of only legacyDangerFullAccess/ReadOnly/WorkspaceWritecategoriesfile_system_sandbox_policyinto the shell, unified-exec, and intercepted-exec approval paths so they all use the same split-policy semanticsapply_patchsafety on the same effective-access rules as the shared protocol helper, rather than letting it drift through compatibility projectionssandbox_modeconfig still builds split policies and round-trips back without semantic driftWhat This PR Does Not Do
This PR does not introduce new platform backend enforcement on its own.
#14173.#14172.#14174.Files To Focus On
core/src/exec_policy.rs: unmatched-command fallback and approval rendering now read the split filesystem policy directlycore/src/tools/sandboxing.rs: default exec-approval requirement keys offFileSystemSandboxPolicy.kindcore/src/tools/handlers/shell.rs: shell approval requests now carry the split filesystem policycore/src/unified_exec/process_manager.rs: unified-exec approval requests now carry the split filesystem policycore/src/tools/runtimes/shell/unix_escalation.rs: intercepted exec fallback now uses the same split-policy approval semanticscore/src/safety.rs:apply_patchsafety keeps using effective filesystem access rather than legacy sandbox categoriescore/src/config/config_tests.rs: new regression coverage for legacysandbox_modeno-drift behavior through the split-policy loaderNotes
core/src/codex.rsandcore/src/codex_tests.rsare just small fallout updates forRequestPermissionsResponse.scope; they are not the point of the PR.#13439/#13445stack, the main review question here is simply: “are there any remaining approval or patch-safety paths that still reconstruct semantics from legacySandboxPolicyinstead of consuming the split filesystem policy directly?”Testing