Route filesystem reads and writes by their own sandbox permissions (#46122)

## Why

Filesystem reads previously required a sandbox whenever writes were restricted, even with full-disk read permission. This made permitted reads depend on sandbox availability.

## What changed

- Select sandboxing independently for reads and writes, allowing full-disk reads directly while keeping restricted operations sandboxed.
- Use the executor's path convention when evaluating full-disk access, including `:slash_tmp` denials.
- Apply read-specific checks to capability discovery and skill resource reads, allowing unrestricted reads on executors without sandboxed discovery support.

## Testing

Add regression tests for direct read APIs, restricted writes and reads, executor-specific permission rules, and capability discovery without sandbox support. Update Windows tests to verify sandbox enforcement through writes.

GitOrigin-RevId: a03844bd1f0ea583bb54326683cddbfdd050119f
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-09-17 05:09:03 +00:00
1 parent 70e8fe1be3
commit a4ee536f01
15 files changed
+635 -151

No files matched your search

+1 -1
View File
@@ -333,7 +333,7 @@ async fn read_bounded_text(
"failed to read executor skill resource {resource}: {err}"
))
};
if sandbox.is_some_and(FileSystemSandboxContext::should_run_in_sandbox)
if sandbox.is_some_and(FileSystemSandboxContext::should_read_from_sandbox)
&& path.infer_path_convention() == Some(PathConvention::Windows)
&& sandbox.is_some_and(|context| !context.windows_sandbox_is_requested())
{