Update confidence levels prompt injection detection to reduce false positive rates (#6390)
Signed-off-by: Dorien Koelemeijer <dkoelemeijer@squareup.com>
This commit is contained in:
committed by
GitHub
parent
9dc548ee2f
commit
3d415fc1ea
@@ -85,7 +85,7 @@ impl PromptInjectionScanner {
|
||||
pub fn get_threshold_from_config(&self) -> f32 {
|
||||
Config::global()
|
||||
.get_param::<f64>("SECURITY_PROMPT_THRESHOLD")
|
||||
.unwrap_or(0.7) as f32
|
||||
.unwrap_or(0.8) as f32
|
||||
}
|
||||
|
||||
pub async fn analyze_tool_call_with_context(
|
||||
@@ -283,7 +283,7 @@ mod tests {
|
||||
let scanner = PromptInjectionScanner::new();
|
||||
let result = scanner.analyze_text("rm -rf /").await.unwrap();
|
||||
|
||||
assert!(result.confidence > 0.9);
|
||||
assert!(result.confidence >= 0.75); // High risk level = 0.75 confidence
|
||||
assert!(!result.pattern_matches.is_empty());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user