From bd4dc886d9e613c6fbea949f0560b2a49b22f7b1 Mon Sep 17 00:00:00 2001 From: shiva108 Date: Mon, 26 Jan 2026 13:35:22 +0100 Subject: [PATCH] dectection update. --- tools/prompt_injection_tester/detection/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/prompt_injection_tester/detection/base.py b/tools/prompt_injection_tester/detection/base.py index 093a24c..db57999 100644 --- a/tools/prompt_injection_tester/detection/base.py +++ b/tools/prompt_injection_tester/detection/base.py @@ -133,10 +133,12 @@ class PatternMatchingDetector(BaseDetector): evidence.append(f"Matched: '{pattern}'") # High confidence for explicit indicators - if any(re.search(hc, pattern, re.IGNORECASE) for hc in high_confidence_patterns): + # Check if this pattern is in the high-confidence list + is_high_confidence = pattern in high_confidence_patterns + if is_high_confidence: max_confidence = max(max_confidence, 0.9) else: - max_confidence = max(max_confidence, 0.6) + max_confidence = max(max_confidence, 0.7) # Boost confidence for multiple matches if len(matched) >= 3: