Skip to main content

AuditConfig

Struct AuditConfig 

Source
pub struct AuditConfig {
    pub collision_threshold: f32,
    pub sibling_disambiguation_threshold: f32,
    pub shadow_similarity_threshold: f32,
    pub max_tool_tokens: usize,
    pub max_catalog_tokens: usize,
    pub fail_on: Option<Severity>,
    pub disabled_rules: Vec<String>,
    pub input_price_per_million_usd: f32,
    pub cached_price_per_million_usd: f32,
}
Expand description

Configuration governing rule thresholds, token cost pricing, and pass/fail gates for Auditor.

Deserializes cleanly from partial JSON configuration files (e.g., .mcp-vol.json).

Fields§

§collision_threshold: f32

Pairwise composite similarity threshold that emits a VOL014 collision error.

§sibling_disambiguation_threshold: f32

Lower pairwise similarity threshold requiring sibling disambiguation (VOL005).

§shadow_similarity_threshold: f32

Minimum similarity required alongside schema-cost asymmetry to flag shadowing (VOL015).

§max_tool_tokens: usize

Maximum recommended tokens for a single tool description (VOL012).

§max_catalog_tokens: usize

Maximum recommended tokens for the entire serialized catalog (VOL012).

§fail_on: Option<Severity>

Minimum severity that causes AuditReport::passed to become false. Set to None to never fail on findings.

§disabled_rules: Vec<String>

Rule codes to suppress (e.g., ["VOL013"]).

§input_price_per_million_usd: f32

Assumed LLM uncached input price in USD per 1M tokens (default 3.00, Sonnet-class rate).

§cached_price_per_million_usd: f32

Assumed LLM prompt-cached read price in USD per 1M tokens (default 0.30, 10% read rate).

Implementations§

Source§

impl AuditConfig

Source

pub fn with_collision_threshold(self, threshold: f32) -> Self

Sets the VOL014 pairwise collision similarity threshold (0.0..=1.0).

Source

pub fn with_sibling_disambiguation_threshold(self, threshold: f32) -> Self

Sets the VOL005 sibling disambiguation similarity threshold (0.0..=1.0).

Source

pub fn with_max_tool_tokens(self, max_tokens: usize) -> Self

Sets the per-tool description token budget for VOL012.

Source

pub fn with_max_catalog_tokens(self, max_tokens: usize) -> Self

Sets the catalog-wide serialized token budget for VOL012.

Source

pub fn with_fail_on(self, severity: Option<Severity>) -> Self

Sets the minimum severity level that fails the audit gate.

Source

pub fn disable_rule(self, code: impl Into<String>) -> Self

Suppresses a specific rule ID (e.g. "VOL013").

Source

pub fn with_input_price_per_million(self, usd_per_million: f32) -> Self

Overrides the USD per 1M input token rate used for cost estimates (cached rate defaults to 10%).

Trait Implementations§

Source§

impl Clone for AuditConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AuditConfig

Source§

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

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

impl Default for AuditConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AuditConfig

Source§

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 AuditConfig

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§

§

impl Forget for AuditConfig

§

impl Freeze for AuditConfig

§

impl Move for AuditConfig

§

impl RefUnwindSafe for AuditConfig

§

impl Send for AuditConfig
where RawVecInner: Send,

§

impl Sync for AuditConfig
where RawVecInner: Sync,

§

impl Unpin for AuditConfig
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for AuditConfig

§

impl UnwindSafe for AuditConfig
where RawVecInner: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.