Interface InjectionDetector
-
- All Known Implementing Classes:
CompositeDetector,RegexDetector,TypoglycemiaDetector
public interface InjectionDetectorStrategy interface for prompt-injection detection.Implementations must be thread-safe: a single detector instance is shared across all concurrent requests.
Known implementations:
RegexDetector– fast, deterministic regex pre-filterTypoglycemiaDetector– fast, catches injection keywords whose interior letters have been transposed to evade exactmatchingCompositeDetector– chains the above with short-circuit logic
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voiddestroy()DetectionResultscan(String prompt)Scanpromptfor injection signals.
-
-
-
Method Detail
-
scan
DetectionResult scan(String prompt)
Scanpromptfor injection signals.- Parameters:
prompt- the normalized prompt text extracted from the LLM request body- Returns:
- a
DetectionResult; nevernull
-
destroy
default void destroy()
-
-