diff --git a/codex-rs/core/src/tasks/user_shell.rs b/codex-rs/core/src/tasks/user_shell.rs index cc48e3def6..0e57e1b728 100644 --- a/codex-rs/core/src/tasks/user_shell.rs +++ b/codex-rs/core/src/tasks/user_shell.rs @@ -82,7 +82,7 @@ impl SessionTask for UserShellCommandTask { command: shell_invocation, workdir: None, timeout_ms: None, - with_escalated_permissions: Some(true), + with_escalated_permissions: None, justification: None, }; diff --git a/codex-rs/core/src/tools/runtimes/shell.rs b/codex-rs/core/src/tools/runtimes/shell.rs index 1e885ca689..8c31526699 100644 --- a/codex-rs/core/src/tools/runtimes/shell.rs +++ b/codex-rs/core/src/tools/runtimes/shell.rs @@ -150,7 +150,7 @@ impl Approvable for ShellRuntime { } fn wants_escalated_first_attempt(&self, req: &ShellRequest) -> bool { - req.with_escalated_permissions.unwrap_or(false) + req.is_user_shell_command || req.with_escalated_permissions.unwrap_or(false) } }