Overview of Detection Engine Components
masterThe FastAPI Guard Detection Engine is composed of four primary components that work together to identify security threats. These components are initialized based on your SecurityConfig:
- ContentPreprocessor: Truncates content to manage memory while preserving potential attack patterns.
- PatternCompiler: Executes regex pattern matching with built-in timeout protection to prevent Regular Expression Denial of Service (ReDoS).
- SemanticAnalyzer: Uses heuristics to detect obfuscated attacks (like SQLi or XSS) that might bypass standard regex.
- PerformanceMonitor: Tracks execution metrics, identifies slow patterns, and detects performance anomalies.