Security analysis engines for LLMTrace
This crate provides regex-based security analyzers for detecting prompt injection attacks, encoding-based attacks, role injection, PII leakage, and data leakage in LLM interactions.
Feature: ml
When the ml feature is enabled, an ML-based analyzer using the Candle framework
becomes available:
- [
MLSecurityAnalyzer] — runs local inference with a HuggingFace text classification model (BERT or DeBERTa v2). - [
EnsembleSecurityAnalyzer] — combines regex and ML results for higher accuracy.