Add prompt injection mitigation logging back (#8518)

This commit is contained in:
dorien-koelemeijer
2026-04-14 10:44:49 +10:00
committed by GitHub
parent d2b473f8ee
commit 2e529b7497
+8
View File
@@ -136,12 +136,16 @@ impl SecurityManager {
let above_threshold = analysis_result.confidence > config_threshold;
let finding_id = format!("SEC-{}", Uuid::new_v4().simple());
let tool_call_json =
serde_json::to_string(&tool_call).unwrap_or_else(|_| "{}".to_string());
tracing::warn!(
monotonic_counter.goose.prompt_injection_finding = 1,
threat_type = "command_injection",
above_threshold = above_threshold,
tool_name = %tool_call.name,
tool_request_id = %tool_request.id,
tool_call_json = %tool_call_json,
confidence = analysis_result.confidence,
explanation = %sanitized_explanation,
finding_id = %finding_id,
@@ -164,10 +168,14 @@ impl SecurityManager {
});
}
} else if analysis_result.scanned {
let tool_call_json =
serde_json::to_string(&tool_call).unwrap_or_else(|_| "{}".to_string());
tracing::info!(
monotonic_counter.goose.prompt_injection_tool_call_passed = 1,
tool_name = %tool_call.name,
tool_request_id = %tool_request.id,
tool_call_json = %tool_call_json,
confidence = analysis_result.confidence,
explanation = %sanitized_explanation,
"Current tool call passed security analysis"