pub trait SecurityAnalyzer: Send + Sync {
// Required methods
fn analyze_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
context: &'life2 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn analyze_response<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
response: &'life1 str,
context: &'life2 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn name(&self) -> &'static str;
fn version(&self) -> &'static str;
fn supported_finding_types(&self) -> Vec<String>;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn analyze_interaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
response: &'life2 str,
context: &'life3 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
Trait for security analyzers.
Required Methods§
Sourcefn analyze_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
context: &'life2 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn analyze_request<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
context: &'life2 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Analyze a request for security issues.
Sourcefn analyze_response<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
response: &'life1 str,
context: &'life2 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn analyze_response<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
response: &'life1 str,
context: &'life2 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Analyze a response for security issues.
Sourcefn supported_finding_types(&self) -> Vec<String>
fn supported_finding_types(&self) -> Vec<String>
Get supported security finding types.
Provided Methods§
Sourcefn analyze_interaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
response: &'life2 str,
context: &'life3 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn analyze_interaction<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
response: &'life2 str,
context: &'life3 AnalysisContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecurityFinding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Analyze a complete request/response pair.