feat(config): support managed deny-read requirements#17740
Merged
Conversation
This was referenced Apr 14, 2026
7ceefbb to
f004fb3
Compare
62bed94 to
bded322
Compare
c8ede2c to
b31b932
Compare
bded322 to
f2836d0
Compare
6e2a8c9 to
f74937c
Compare
afdd075 to
57c3a35
Compare
viyatb-oai
added a commit
that referenced
this pull request
Apr 16, 2026
## Summary
- adds first-class filesystem policy entries for deny-read glob patterns
- parses config such as :project_roots { "**/*.env" = "none" } into
pattern entries
- enforces deny-read patterns in direct read/list helpers
- fails closed for sandbox execution until platform backends enforce
glob patterns in #18096
- preserves split filesystem policy in turn context only when it cannot
be reconstructed from legacy sandbox policy
## Stack
1. This PR - glob deny-read policy/config/direct-tool support
2. #18096 - macOS and Linux sandbox enforcement
3. #17740 - managed deny-read requirements
## Verification
- just fmt
- cargo check -p codex-core -p codex-sandboxing --tests
---------
Co-authored-by: Codex <noreply@openai.com>
4fac10c to
2cb6091
Compare
57c3a35 to
4db0235
Compare
viyatb-oai
added a commit
that referenced
this pull request
Apr 17, 2026
## Summary - adds macOS Seatbelt deny rules for unreadable glob patterns - expands unreadable glob matches on Linux and masks them in bwrap, including canonical symlink targets - keeps Linux glob expansion robust when `rg` is unavailable in minimal or Bazel test environments - adds sandbox integration coverage that runs `shell` and `exec_command` with a `**/*.env = none` policy and verifies the secret contents do not reach the model ## Linux glob expansion ```text Prefer: rg --files --hidden --no-ignore --glob <pattern> -- <search-root> Fallback: internal globset walker when rg is not installed Failure: any other rg failure aborts sandbox construction ``` ``` [permissions.workspace.filesystem] glob_scan_max_depth = 2 [permissions.workspace.filesystem.":project_roots"] "**/*.env" = "none" ``` This keeps the common path fast without making sandbox construction depend on an ambient `rg` binary. If `rg` is present but fails for another reason, the sandbox setup fails closed instead of silently omitting deny-read masks. ## Platform support - macOS: subprocess sandbox enforcement is handled by Seatbelt regex deny rules - Linux: subprocess sandbox enforcement is handled by expanding existing glob matches and masking them in bwrap - Windows: policy/config/direct-tool glob support is already on `main` from #15979; Windows subprocess sandbox paths continue to fail closed when unreadable split filesystem carveouts require runtime enforcement, rather than silently running unsandboxed ## Stack 1. #15979 - merged: cross-platform glob deny-read policy/config/direct-tool support for macOS, Linux, and Windows 2. This PR - macOS/Linux subprocess sandbox enforcement plus Windows fail-closed clarification 3. #17740 - managed deny-read requirements ## Verification - Added integration coverage for `shell` and `exec_command` glob deny-read enforcement - `cargo check -p codex-sandboxing -p codex-linux-sandbox --tests` - `cargo check -p codex-core --test all` - `cargo clippy -p codex-linux-sandbox -p codex-sandboxing --tests` - `just bazel-lock-check` --------- Co-authored-by: Codex <noreply@openai.com>
Add managed requirements plumbing for deny-read filesystem entries now that glob deny-read policy and platform enforcement are split below it in the stack. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex noreply@openai.com
4db0235 to
e665898
Compare
bolinfest
approved these changes
Apr 17, 2026
Collaborator
bolinfest
left a comment
There was a problem hiding this comment.
This needs an end-to-end test in a follow-up.
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 PR lets managed requirements inject deny-read filesystem constraints into the effective filesystem sandbox policy. User-controlled config can still choose the surrounding permission profile, but it cannot remove or weaken the managed deny-read entries.
Managed deny-read shape
A managed requirements file can declare exact paths and glob patterns under
[permissions.filesystem]:Those entries are compiled into the effective filesystem policy as
access = nonerules, equivalent in shape to filesystem permission entries like:The important difference is that the managed entries come from requirements, so lower-precedence user config cannot remove them or make those paths readable again.
Relative managed
deny_readentries are resolved relative to the directory containing the managed requirements file. Glob entries keep their glob suffix after the non-glob prefix is normalized.Runtime behavior
deny_readentries are appended to the effectiveFileSystemSandboxPolicyafter the selected permission profile is resolved.FileSystemPath::Path { access: None }; glob patterns becomeFileSystemPath::GlobPattern { access: None }.sandbox_modeis constrained toread-onlyorworkspace-write;danger-full-accessandexternal-sandboxcannot silently bypass the managed read-deny policy./debug-configshows the effective managed requirement aspermissions.filesystem.deny_readwith its source.Stack