mirror of
https://github.com/openai/codex.git
synced 2026-11-22 15:15:18 +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:
1 parent
ceb4bc72c4
commit
0dcad0c972
15 files changed
+74
-166
No files matched your search
@@ -449,16 +449,12 @@ impl Permissions {
|
||||
self.permission_profile_state.profile_workspace_roots()
|
||||
}
|
||||
|
||||
fn materialized_permission_profile(&self) -> PermissionProfile {
|
||||
self.permission_profile()
|
||||
.clone()
|
||||
.materialize_project_roots_with_workspace_roots(&self.workspace_roots)
|
||||
}
|
||||
|
||||
/// Effective runtime permissions after config requirements and runtime
|
||||
/// workspace-root materialization have been applied.
|
||||
pub fn effective_permission_profile(&self) -> PermissionProfile {
|
||||
self.materialized_permission_profile()
|
||||
self.permission_profile()
|
||||
.clone()
|
||||
.materialize_project_roots_with_workspace_roots(&self.workspace_roots)
|
||||
}
|
||||
|
||||
/// Named profile selected by config, if the current profile has one.
|
||||
@@ -468,7 +464,7 @@ impl Permissions {
|
||||
|
||||
/// Effective filesystem sandbox policy derived from the canonical profile.
|
||||
pub fn file_system_sandbox_policy(&self) -> FileSystemSandboxPolicy {
|
||||
self.materialized_permission_profile()
|
||||
self.effective_permission_profile()
|
||||
.file_system_sandbox_policy()
|
||||
}
|
||||
|
||||
@@ -479,7 +475,7 @@ impl Permissions {
|
||||
|
||||
/// Legacy compatibility projection derived from the canonical profile.
|
||||
pub fn legacy_sandbox_policy(&self, cwd: &Path) -> SandboxPolicy {
|
||||
let permission_profile = self.materialized_permission_profile();
|
||||
let permission_profile = self.effective_permission_profile();
|
||||
compatibility_sandbox_policy_for_permission_profile(&permission_profile, cwd)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user