pub trait InjectionClassifier: Send + Sync {
// Required methods
fn model_id(&self) -> &str;
fn score(&self, text: &str) -> f64;
}Expand description
A prompt-injection classifier over a span of (untrusted) text, returning a
malicious-probability in [0, 1].
The built-in HeuristicClassifier is always available and dependency-free.
A downloadable neural backend (harn-guard) supersedes it at process start
via register_injection_classifier, so the default binary never links a
model runtime — only a host compiled with the optional backend registers one.
Required Methods§
Sourcefn model_id(&self) -> &str
fn model_id(&self) -> &str
Stable identity surfaced in DetectorVerdict::model and audit trails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".