diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index f0a3307c4..1cdf17672 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -777,6 +777,12 @@ func (t *ExecTool) guardCommand(command, cwd string) string { if isExecutable(p) { continue } + // Allow character/block device files (e.g. /dev/null used by + // "curl -o /dev/null"). These are not regular files and pose + // no workspace-escape risk. + if info, statErr := os.Stat(p); statErr == nil && info.Mode()&os.ModeDevice != 0 { + continue + } // Agent CLI slash commands: skip non-existent paths // (e.g., "/review" is a command, not a file). if agentCLI {