mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
Run sandbox integrity checks before commands and filesystem operations (#51843)
## What changed Wire existing sandbox integrity checks into local command preparation, exec-server process preparation, and sandboxed filesystem helper and file-open operations. Make execution request preparation asynchronous so callers can await the checks. The checks remain observational: failures and timeouts do not prevent command execution. ## Testing Add regression tests that launch a real command after checker preparation fails or exceeds its timeout, verifying successful output and exit status. GitOrigin-RevId: a82399f8aeb8b08f9965e6121b4c7f460552af3f
This commit is contained in:
@@ -329,7 +329,8 @@ pub async fn process_exec_tool_call(
|
||||
codex_self_exe,
|
||||
windows_sandbox_type,
|
||||
use_legacy_landlock,
|
||||
)?;
|
||||
)
|
||||
.await?;
|
||||
|
||||
// Route through the sandboxing module for a single, unified execution path.
|
||||
crate::sandboxing::execute_env(exec_req, stdout_stream).await
|
||||
@@ -338,7 +339,7 @@ pub async fn process_exec_tool_call(
|
||||
/// Transform a portable exec request into the concrete argv/env that should be
|
||||
/// spawned under the requested sandbox policy.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn build_exec_request(
|
||||
pub async fn build_exec_request(
|
||||
params: ExecParams,
|
||||
permission_profile: &PermissionProfile,
|
||||
sandbox_cwd: &AbsolutePathBuf,
|
||||
@@ -439,7 +440,7 @@ pub fn build_exec_request(
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
ExecRequest::from_sandbox_exec_request(request, options, windows_sandbox_workspace_roots)
|
||||
ExecRequest::from_sandbox_exec_request(request, options, windows_sandbox_workspace_roots).await
|
||||
}
|
||||
|
||||
pub(crate) async fn execute_exec_request(
|
||||
|
||||
Reference in New Issue
Block a user