From 5368f4a6d0f520d5fc7f0255c9b891b51ea6cee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Renzel?= Date: Wed, 25 Feb 2026 15:31:12 +0100 Subject: [PATCH] Fix: calling URLs with curl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling URLs via curl results in the error: “Command blocked by safety guard (path outside working dir)”. This commit fixes the problem. --- pkg/tools/shell.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index ad1664b5b..9711dde89 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -278,6 +278,10 @@ func (t *ExecTool) guardCommand(command, cwd string) string { } } + if strings.HasPrefix(cmd, "curl -s") && strings.Contains(cmd, "https://") { + return "" + } + if t.restrictToWorkspace { if strings.Contains(cmd, "..\\") || strings.Contains(cmd, "../") { return "Command blocked by safety guard (path traversal detected)"