pub struct ScanReport {
pub skill: String,
pub version: Option<String>,
pub scan_timestamp: String,
pub status: ScanStatus,
pub risk_level: RiskLevel,
pub security_score: u8,
pub security_grade: SecurityGrade,
pub files_scanned: usize,
pub scanner_results: Vec<ScanResult>,
pub findings: Vec<Finding>,
pub suppressed: Vec<Finding>,
pub passed: bool,
}Expand description
Complete scan report for a single skill.
Created by ScanReport::from_results after all scanners have run.
This is the main output of scan::run_scan
and is consumed by the output formatters.
§Examples
use std::path::Path;
use oxidized_agentic_audit::{scan::{self, ScanMode}, config::Config};
let config = Config::load(None).unwrap();
let report = scan::run_scan(Path::new("./my-skill"), &config, ScanMode::Skill);
println!("status: {:?}, errors: {}", report.status, report.error_count());Fields§
§skill: StringName of the scanned skill (derived from the directory name).
version: Option<String>Optional skill version (reserved for future use).
scan_timestamp: StringRFC 3339 timestamp of when the scan ran.
status: ScanStatusOverall scan outcome.
risk_level: RiskLevelOverall risk assessment.
security_score: u8Numeric security score from 0 (worst) to 100 (best).
Computed by deducting points per active finding:
- Critical error (RCE/backdoor/prompt): −30
- Regular error: −15
- Warning: −5
- Info: −1
The score is clamped to [0, 100].
security_grade: SecurityGradeLetter grade derived from security_score.
files_scanned: usizeTotal number of files examined across all scanners.
scanner_results: Vec<ScanResult>Per-scanner results (including skipped scanners).
findings: Vec<Finding>Active (non-suppressed) findings.
suppressed: Vec<Finding>Suppressed findings (kept for transparency in reports).
passed: boolConvenience flag: true when status is ScanStatus::Passed.
Implementations§
Source§impl ScanReport
impl ScanReport
Sourcepub fn from_results(
skill: &str,
results: Vec<ScanResult>,
suppressions: &[Suppression],
strict: bool,
) -> Self
pub fn from_results( skill: &str, results: Vec<ScanResult>, suppressions: &[Suppression], strict: bool, ) -> Self
Builds a ScanReport from raw scanner results.
This constructor:
- Separates suppressed findings from active ones.
- Applies file-level suppression rules.
- Computes
ScanStatusandRiskLevel.
§Arguments
skill— skill name (usually the directory basename).results— scanner results to aggregate.suppressions— rules loaded from.oxidized-agentic-audit-ignore.strict— whentrue, warnings are treated as failures.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Returns the number of active findings with Severity::Error.
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
Returns the number of active findings with Severity::Warning.
Sourcepub fn info_count(&self) -> usize
pub fn info_count(&self) -> usize
Returns the number of active findings with Severity::Info.
Sourcepub fn count_by_severity(&self) -> (usize, usize, usize)
pub fn count_by_severity(&self) -> (usize, usize, usize)
Counts errors, warnings, and info findings in a single pass.
Returns (errors, warnings, info). Prefer this over calling
error_count, warning_count,
and info_count separately when all three values are
needed (avoids three iterations).
Trait Implementations§
Source§impl Debug for ScanReport
impl Debug for ScanReport
Auto Trait Implementations§
impl Freeze for ScanReport
impl RefUnwindSafe for ScanReport
impl Send for ScanReport
impl Sync for ScanReport
impl Unpin for ScanReport
impl UnsafeUnpin for ScanReport
impl UnwindSafe for ScanReport
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more