Remove unused tool call json in logs (#8147)

This commit is contained in:
dorien-koelemeijer
2026-03-27 13:09:14 +10:00
committed by GitHub
parent 0a1f773e7d
commit 6d25161b19
-8
View File
@@ -135,16 +135,12 @@ impl SecurityManager {
let above_threshold = analysis_result.confidence > config_threshold; let above_threshold = analysis_result.confidence > config_threshold;
let finding_id = format!("SEC-{}", Uuid::new_v4().simple()); 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!( tracing::warn!(
monotonic_counter.goose.prompt_injection_finding = 1, monotonic_counter.goose.prompt_injection_finding = 1,
threat_type = "command_injection", threat_type = "command_injection",
above_threshold = above_threshold, above_threshold = above_threshold,
tool_name = %tool_call.name, tool_name = %tool_call.name,
tool_request_id = %tool_request.id, tool_request_id = %tool_request.id,
tool_call_json = %tool_call_json,
confidence = analysis_result.confidence, confidence = analysis_result.confidence,
explanation = %sanitized_explanation, explanation = %sanitized_explanation,
finding_id = %finding_id, finding_id = %finding_id,
@@ -167,14 +163,10 @@ impl SecurityManager {
}); });
} }
} else if analysis_result.scanned { } else if analysis_result.scanned {
let tool_call_json =
serde_json::to_string(&tool_call).unwrap_or_else(|_| "{}".to_string());
tracing::info!( tracing::info!(
monotonic_counter.goose.prompt_injection_tool_call_passed = 1, monotonic_counter.goose.prompt_injection_tool_call_passed = 1,
tool_name = %tool_call.name, tool_name = %tool_call.name,
tool_request_id = %tool_request.id, tool_request_id = %tool_request.id,
tool_call_json = %tool_call_json,
confidence = analysis_result.confidence, confidence = analysis_result.confidence,
explanation = %sanitized_explanation, explanation = %sanitized_explanation,
"Current tool call passed security analysis" "Current tool call passed security analysis"