escalating permissions

This commit is contained in:
kevin zhao
2025-10-31 17:15:50 -04:00
parent c8ebb2a0dc
commit d609dfa2fc
3 changed files with 6 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ impl SessionTask for UserShellCommandTask {
command: shell_invocation,
workdir: None,
timeout_ms: None,
with_escalated_permissions: None,
with_escalated_permissions: Some(true),
justification: None,
};

View File

@@ -219,6 +219,7 @@ impl ShellHandler {
env: exec_params.env.clone(),
with_escalated_permissions: exec_params.with_escalated_permissions,
justification: exec_params.justification.clone(),
is_user_shell_command,
};
let mut orchestrator = ToolOrchestrator::new();
let mut runtime = ShellRuntime::new();

View File

@@ -34,6 +34,7 @@ pub struct ShellRequest {
pub env: std::collections::HashMap<String, String>,
pub with_escalated_permissions: Option<bool>,
pub justification: Option<String>,
pub is_user_shell_command: bool,
}
impl ProvidesSandboxRetryData for ShellRequest {
@@ -121,6 +122,9 @@ impl Approvable<ShellRequest> for ShellRuntime {
policy: AskForApproval,
sandbox_policy: &SandboxPolicy,
) -> bool {
if req.is_user_shell_command {
return false;
}
if is_known_safe_command(&req.command) {
return false;
}