mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user