From 549a6282190bb531b31dc12dd992f4f83c2b2064 Mon Sep 17 00:00:00 2001 From: Dorien Koelemeijer Date: Mon, 1 Jun 2026 14:16:03 +1000 Subject: [PATCH] address PR comment --- crates/goose/src/security/egress_inspector.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/goose/src/security/egress_inspector.rs b/crates/goose/src/security/egress_inspector.rs index 845169f1e3..bc5bbad51d 100644 --- a/crates/goose/src/security/egress_inspector.rs +++ b/crates/goose/src/security/egress_inspector.rs @@ -224,12 +224,20 @@ fn detect_direction(command: &str) -> EgressDirection { static CURL_UPLOAD_RE: OnceLock = OnceLock::new(); let curl_upload_re = CURL_UPLOAD_RE.get_or_init(|| { - Regex::new(r"(?i)\b(curl|wget|xh|httpie)\b.*(-X\s*(POST|PUT|PATCH)|--data|--data-raw|--data-binary|-d\s|-F\s|--form|--upload-file|-T\s)").unwrap() + Regex::new(r"(?i)\bcurl\b.*(-X\s*(POST|PUT|PATCH)|--data|--data-raw|--data-binary|-d\s|-F\s|--form|--upload-file|-T\s)").unwrap() }); if curl_upload_re.is_match(command) { return EgressDirection::Outbound; } + static WGET_UPLOAD_RE: OnceLock = OnceLock::new(); + let wget_upload_re = WGET_UPLOAD_RE.get_or_init(|| { + Regex::new(r"(?i)\bwget\b.*(--post-data|--post-file|--body-data|--body-file)").unwrap() + }); + if wget_upload_re.is_match(command) { + return EgressDirection::Outbound; + } + if lower.contains("npm publish") || lower.contains("cargo publish") || lower.contains("pip upload")