pub struct FingerprintEngine { /* private fields */ }Expand description
Engine that ingests behavior samples and computes agent fingerprints.
Implementations§
Source§impl FingerprintEngine
impl FingerprintEngine
Sourcepub fn ingest(&mut self, sample: BehaviorSample)
pub fn ingest(&mut self, sample: BehaviorSample)
Ingest a new behavior sample.
Sourcepub fn get_fingerprint(&self, agent_id: &str) -> Option<AgentFingerprint>
pub fn get_fingerprint(&self, agent_id: &str) -> Option<AgentFingerprint>
Compute the fingerprint for a given agent, or None if no samples exist.
Sourcepub fn detect_anomaly(
&self,
agent_id: &str,
sample: &BehaviorSample,
) -> AnomalyResult
pub fn detect_anomaly( &self, agent_id: &str, sample: &BehaviorSample, ) -> AnomalyResult
Detect whether a new sample is anomalous relative to the agent’s baseline.
Checks:
- Response time > 2x the baseline mean
- Error rate > 3x the baseline rate (inferred from a single failing sample)
- Confidence drop > 0.2 below the baseline mean
Sourcepub fn similarity(&self, a: &str, b: &str) -> f64
pub fn similarity(&self, a: &str, b: &str) -> f64
Compute a similarity score (0.0 to 1.0) between two agents.
Compares evidence distribution, confidence mean, error rate, and average response time. Returns 0.0 if either agent has no samples.
Trait Implementations§
Source§impl Clone for FingerprintEngine
impl Clone for FingerprintEngine
Source§fn clone(&self) -> FingerprintEngine
fn clone(&self) -> FingerprintEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FingerprintEngine
impl Debug for FingerprintEngine
Source§impl Default for FingerprintEngine
impl Default for FingerprintEngine
Source§impl<'de> Deserialize<'de> for FingerprintEngine
impl<'de> Deserialize<'de> for FingerprintEngine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FingerprintEngine
impl RefUnwindSafe for FingerprintEngine
impl Send for FingerprintEngine
impl Sync for FingerprintEngine
impl Unpin for FingerprintEngine
impl UnsafeUnpin for FingerprintEngine
impl UnwindSafe for FingerprintEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more