Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba4370b70
ℹ️ 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".
| FileSystemPermissions { entries } | ||
| FileSystemPermissions { | ||
| entries, | ||
| glob_scan_max_depth: requested_file_system.glob_scan_max_depth, |
There was a problem hiding this comment.
Intersect glob scan depth with granted profile
intersect_permission_profiles filters entries against granted, but it always keeps requested_file_system.glob_scan_max_depth. When an approver returns a stricter depth (for example a larger depth, or None for unbounded scanning) the intersection result can become less restrictive than what was granted, so request_permissions_response_from_client_result may persist broader filesystem access than the client approved.
Useful? React with 👍 / 👎.
b612649 to
f6b0616
Compare
Why
#18274 made
PermissionProfilethe canonical file-system permissions shape, but the round-trip fromFileSystemSandboxPolicytoPermissionProfilestill dropped one piece of policy metadata:glob_scan_max_depth.That field is security-relevant for deny-read globs such as
**/*.env. On Linux, bubblewrap sandbox construction uses it to bound unreadable glob expansion. If a profile copied from active runtime permissions loses this value and is submitted back as an override, the resultingFileSystemSandboxPolicycan behave differently even though the visible permission entries look equivalent.What changed
glob_scan_max_depthto protocolFileSystemPermissionsand preserve it when converting to/fromFileSystemSandboxPolicy.read/writeJSON for simple path-only permissions, but force canonical JSON when glob scan depth is present so the metadata is not silently dropped.globScanMaxDepththrough app-serverAdditionalFileSystemPermissions, generated JSON/TypeScript schemas, and app-server/TUI conversion call sites.FileSystemSandboxPolicyused for command execution, so bounded deny-read globs reach Linux bubblewrap materialization.Verification
cargo test -p codex-sandboxing glob_scan -- --nocapturecargo test -p codex-sandboxing policy_transforms -- --nocapturejust fix -p codex-sandboxingStack created with Sapling. Best reviewed with ReviewStack.