Skip to main content

ScanReport

Struct ScanReport 

Source
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: String

Name of the scanned skill (derived from the directory name).

§version: Option<String>

Optional skill version (reserved for future use).

§scan_timestamp: String

RFC 3339 timestamp of when the scan ran.

§status: ScanStatus

Overall scan outcome.

§risk_level: RiskLevel

Overall risk assessment.

§security_score: u8

Numeric 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: SecurityGrade

Letter grade derived from security_score.

§files_scanned: usize

Total 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: bool

Convenience flag: true when status is ScanStatus::Passed.

Implementations§

Source§

impl ScanReport

Source

pub fn from_results( skill: &str, results: Vec<ScanResult>, suppressions: &[Suppression], strict: bool, ) -> Self

Builds a ScanReport from raw scanner results.

This constructor:

  1. Separates suppressed findings from active ones.
  2. Applies file-level suppression rules.
  3. Computes ScanStatus and RiskLevel.
§Arguments
  • skill — skill name (usually the directory basename).
  • results — scanner results to aggregate.
  • suppressions — rules loaded from .oxidized-agentic-audit-ignore.
  • strict — when true, warnings are treated as failures.
Source

pub fn error_count(&self) -> usize

Returns the number of active findings with Severity::Error.

Source

pub fn warning_count(&self) -> usize

Returns the number of active findings with Severity::Warning.

Source

pub fn info_count(&self) -> usize

Returns the number of active findings with Severity::Info.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for ScanReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.