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: f32Pairwise composite similarity threshold that emits a VOL014 collision error.
sibling_disambiguation_threshold: f32Lower pairwise similarity threshold requiring sibling disambiguation (VOL005).
shadow_similarity_threshold: f32Minimum similarity required alongside schema-cost asymmetry to flag shadowing (VOL015).
max_tool_tokens: usizeMaximum recommended tokens for a single tool description (VOL012).
max_catalog_tokens: usizeMaximum 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: f32Assumed LLM uncached input price in USD per 1M tokens (default 3.00, Sonnet-class rate).
cached_price_per_million_usd: f32Assumed LLM prompt-cached read price in USD per 1M tokens (default 0.30, 10% read rate).
Implementations§
Source§impl AuditConfig
impl AuditConfig
Sourcepub fn with_collision_threshold(self, threshold: f32) -> Self
pub fn with_collision_threshold(self, threshold: f32) -> Self
Sets the VOL014 pairwise collision similarity threshold (0.0..=1.0).
Sourcepub fn with_sibling_disambiguation_threshold(self, threshold: f32) -> Self
pub fn with_sibling_disambiguation_threshold(self, threshold: f32) -> Self
Sets the VOL005 sibling disambiguation similarity threshold (0.0..=1.0).
Sourcepub fn with_max_tool_tokens(self, max_tokens: usize) -> Self
pub fn with_max_tool_tokens(self, max_tokens: usize) -> Self
Sets the per-tool description token budget for VOL012.
Sourcepub fn with_max_catalog_tokens(self, max_tokens: usize) -> Self
pub fn with_max_catalog_tokens(self, max_tokens: usize) -> Self
Sets the catalog-wide serialized token budget for VOL012.
Sourcepub fn with_fail_on(self, severity: Option<Severity>) -> Self
pub fn with_fail_on(self, severity: Option<Severity>) -> Self
Sets the minimum severity level that fails the audit gate.
Sourcepub fn disable_rule(self, code: impl Into<String>) -> Self
pub fn disable_rule(self, code: impl Into<String>) -> Self
Suppresses a specific rule ID (e.g. "VOL013").
Sourcepub fn with_input_price_per_million(self, usd_per_million: f32) -> Self
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%).