Use permission profiles throughout sandbox execution (#36183)

## What changed

- Pass the canonical `PermissionProfile` through execution requests, sandbox
  selection, escalation, and the exec server instead of carrying separate
  derived filesystem and network policies.
- Derive runtime sandbox policies from the effective profile at their points of
  use, including after applying additional permissions.
- Update sandbox and escalation tests to inspect policies through the profile.

GitOrigin-RevId: 695b82ea94f5289516b0933bb23074cb2dcce8ac
This commit is contained in:
viyatb-oai
2026-07-30 16:30:32 +00:00
committed by copyberry
parent ceb4bc72c4
commit 0dcad0c972
15 changed files with 74 additions and 166 deletions
+1 -3
View File
@@ -112,10 +112,8 @@ impl FileSystemSandboxRunner {
) -> Result<SandboxExecRequest, JSONRPCErrorError> {
let helper = &self.runtime_paths.codex_self_exe;
let sandbox_manager = SandboxManager::new();
let (file_system_policy, network_policy) = permission_profile.to_runtime_permissions();
let sandbox = sandbox_manager.select_initial(
&file_system_policy,
network_policy,
permission_profile,
SandboxablePreference::Auto,
sandbox_context.windows_sandbox_level,
/*has_managed_network_requirements*/ false,
+2 -2
View File
@@ -150,6 +150,7 @@ pub(crate) async fn prepare_exec_request(
managed_mitm_ca_trust_bundle_path.as_ref(),
native_sandbox_policy_cwd.as_path(),
);
#[cfg(unix)]
let (file_system_policy, network_policy) = permissions.to_runtime_permissions();
#[cfg(unix)]
let sandbox_helper_paths = params
@@ -179,8 +180,7 @@ pub(crate) async fn prepare_exec_request(
);
let sandbox_manager = SandboxManager::new();
let sandbox = sandbox_manager.select_initial(
&file_system_policy,
network_policy,
&permissions,
SandboxablePreference::Require,
sandbox_context.windows_sandbox_level,
params.enforce_managed_network,