core-agent-ide/codex-rs/protocol/src
Michael Bolin b52c18e414
protocol: derive effective file access from filesystem policies (#13440)
## Why

`#13434` and `#13439` introduce split filesystem and network policies,
but the only code that could answer basic filesystem questions like "is
access effectively unrestricted?" or "which roots are readable and
writable for this cwd?" still lived on the legacy `SandboxPolicy` path.

That would force later backends to either keep projecting through
`SandboxPolicy` or duplicate path-resolution logic. This PR moves those
queries onto `FileSystemSandboxPolicy` itself so later runtime and
platform changes can consume the split policy directly.

## What changed

- added `FileSystemSandboxPolicy` helpers for full-read/full-write
checks, platform-default reads, readable roots, writable roots, and
explicit unreadable roots resolved against a cwd
- added a shared helper for the default read-only carveouts under
writable roots so the legacy and split-policy paths stay aligned
- added protocol coverage for full-access detection and derived
readable, writable, and unreadable roots

## Verification

- added protocol coverage in `protocol/src/protocol.rs` and
`protocol/src/permissions.rs` for full-root access and derived
filesystem roots
- verified the current PR state with `just clippy`




---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/13440).
* #13453
* #13452
* #13451
* #13449
* #13448
* #13445
* __->__ #13440
* #13439

---------

Co-authored-by: viyatb-oai <viyatb@openai.com>
2026-03-07 03:49:29 +00:00
..
prompts core/protocol: add structured macOS additional permissions and merge them into sandbox execution (#13499) 2026-03-05 16:21:45 -08:00
account.rs add error messages for the go plan type (#10181) 2026-01-30 01:17:25 +00:00
approvals.rs sandboxing: plumb split sandbox policies through runtime (#13439) 2026-03-07 02:30:21 +00:00
config_types.rs Allow full web search tool config (#13675) 2026-03-07 00:50:50 +00:00
custom_prompts.rs [app-server] remove serde(skip_serializing_if = "Option::is_none") annotations (#5939) 2025-10-30 18:18:53 +00:00
dynamic_tools.rs feat(app-server, core): allow text + image content items for dynamic tool outputs (#10567) 2026-02-04 16:12:47 -08:00
items.rs Enabling CWD Saving for Image-Gen (#13607) 2026-03-06 00:47:21 -08:00
lib.rs config: add initial support for the new permission profile config language in config.toml (#13434) 2026-03-06 15:39:13 -08:00
mcp.rs feat: replace custom mcp-types crate with equivalents from rmcp (#10349) 2026-02-02 17:41:55 -08:00
message_history.rs Generate JSON schema for app-server protocol (#5063) 2025-10-20 11:45:11 -07:00
models.rs feat(app-server-protocol): address naming conflicts in json schema exporter (#13819) 2026-03-07 01:33:46 +00:00
num_format.rs Fix execpolicy parsing for multiline quoted args (#9565) 2026-01-22 22:16:53 -08:00
openai_models.rs chore: add web_search_tool_type for image support (#13538) 2026-03-05 07:02:27 +00:00
parse_command.rs [app-server] remove serde(skip_serializing_if = "Option::is_none") annotations (#5939) 2025-10-30 18:18:53 +00:00
permissions.rs protocol: derive effective file access from filesystem policies (#13440) 2026-03-07 03:49:29 +00:00
plan_tool.rs Plan mode: stream proposed plans, emit plan items, and render in TUI (#9786) 2026-01-30 18:59:30 +00:00
protocol.rs protocol: derive effective file access from filesystem policies (#13440) 2026-03-07 03:49:29 +00:00
request_user_input.rs Better handling skill depdenencies on ENV VAR. (#9017) 2026-01-29 14:13:30 -05:00
thread_id.rs feat: sqlite 1 (#10004) 2026-01-28 15:29:14 +01:00
user_input.rs feat: structured plugin parsing (#13711) 2026-03-06 11:08:36 -08:00