pub struct CodeSecurityAnalyzer { /* private fields */ }Expand description
Analyser that scans text for code blocks and checks them for security vulnerabilities.
Implementations§
Source§impl CodeSecurityAnalyzer
impl CodeSecurityAnalyzer
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new CodeSecurityAnalyzer with the default severity threshold
(Medium).
Sourcepub fn with_severity_threshold(threshold: SecuritySeverity) -> Self
pub fn with_severity_threshold(threshold: SecuritySeverity) -> Self
Create a new CodeSecurityAnalyzer with a custom severity threshold.
Findings with severity below threshold are silently dropped.
Sourcepub fn analyze(&self, text: &str) -> Vec<SecurityFinding>
pub fn analyze(&self, text: &str) -> Vec<SecurityFinding>
Analyse text (typically an LLM response) for code security vulnerabilities.
Extracts code blocks, detects languages, and scans for vulnerability
patterns. Returns a list of SecurityFindings tagged as
"insecure_code".
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeSecurityAnalyzer
impl RefUnwindSafe for CodeSecurityAnalyzer
impl Send for CodeSecurityAnalyzer
impl Sync for CodeSecurityAnalyzer
impl Unpin for CodeSecurityAnalyzer
impl UnsafeUnpin for CodeSecurityAnalyzer
impl UnwindSafe for CodeSecurityAnalyzer
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