pub struct SecurityFinding {
pub id: Uuid,
pub severity: SecuritySeverity,
pub finding_type: String,
pub description: String,
pub detected_at: DateTime<Utc>,
pub confidence_score: f64,
pub location: Option<String>,
pub metadata: HashMap<String, String>,
pub requires_alert: bool,
}Expand description
A security finding detected during analysis.
Fields§
§id: UuidUnique identifier for this finding.
severity: SecuritySeveritySeverity level of the finding.
finding_type: StringType of security issue (e.g., “prompt_injection”, “pii_leak”, “cost_anomaly”).
description: StringHuman-readable description of the finding.
detected_at: DateTime<Utc>When the finding was detected.
confidence_score: f64Confidence score (0.0 to 1.0).
location: Option<String>Location where the issue was found (e.g., “request.messages[0]”, “response.content”).
metadata: HashMap<String, String>Additional metadata about the finding.
requires_alert: boolWhether this finding requires immediate alerting.
Implementations§
Source§impl SecurityFinding
impl SecurityFinding
Sourcepub fn new(
severity: SecuritySeverity,
finding_type: String,
description: String,
confidence_score: f64,
) -> Self
pub fn new( severity: SecuritySeverity, finding_type: String, description: String, confidence_score: f64, ) -> Self
Create a new security finding.
Sourcepub fn with_location(self, location: String) -> Self
pub fn with_location(self, location: String) -> Self
Set the location where this finding was detected.
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Add metadata to the finding.
Sourcepub fn with_alert_required(self, requires_alert: bool) -> Self
pub fn with_alert_required(self, requires_alert: bool) -> Self
Set whether this finding requires immediate alerting.
Trait Implementations§
Source§impl Clone for SecurityFinding
impl Clone for SecurityFinding
Source§fn clone(&self) -> SecurityFinding
fn clone(&self) -> SecurityFinding
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 ComposeSchema for SecurityFinding
impl ComposeSchema for SecurityFinding
Source§impl Debug for SecurityFinding
impl Debug for SecurityFinding
Source§impl<'de> Deserialize<'de> for SecurityFinding
impl<'de> Deserialize<'de> for SecurityFinding
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
Source§impl Serialize for SecurityFinding
impl Serialize for SecurityFinding
Auto Trait Implementations§
impl Freeze for SecurityFinding
impl RefUnwindSafe for SecurityFinding
impl Send for SecurityFinding
impl Sync for SecurityFinding
impl Unpin for SecurityFinding
impl UnsafeUnpin for SecurityFinding
impl UnwindSafe for SecurityFinding
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