/** * Annotation-Aware Severity Adjustment * * Reduces false positives by considering tool annotations when scoring * vulnerability severity. * * Issue #170: Security module should consider tool annotations to reduce * false positives for read-only servers. * * @module securityTests/AnnotationAwareSeverity */ import type { SecurityAnnotations, SecurityRiskLevel } from "../../../../lib/assessment/coreTypes.js"; /** * Result of annotation-aware severity adjustment. */ export interface SeverityAdjustment { /** Adjusted risk level after considering annotations */ adjustedRiskLevel: SecurityRiskLevel; /** Whether an adjustment was made */ wasAdjusted: boolean; /** Reason for adjustment (human-readable) */ adjustmentReason?: string; /** Original risk level before adjustment */ originalRiskLevel: SecurityRiskLevel; } /** * Adjust vulnerability severity based on tool annotations. * * This function implements the false positive reduction logic from Issue #170. * Read-only tools (readOnlyHint=true) have execution-type vulnerabilities * downgraded to LOW, and closed-world tools (openWorldHint=false) have * exfiltration-type vulnerabilities downgraded to LOW. * * @param attackName - Name of the attack pattern (e.g., "Command Injection") * @param originalRiskLevel - Original risk level from payload definition * @param toolAnnotations - Extracted annotations for this specific tool * @param serverIsReadOnly - Whether ALL server tools are read-only * @param serverIsClosed - Whether ALL server tools are closed-world * @returns SeverityAdjustment with potentially adjusted risk level * * @example * ```typescript * const adjustment = adjustSeverityForAnnotations( * "Command Injection", * "HIGH", * { readOnlyHint: true, source: "mcp" }, * true, * false * ); * // adjustment.wasAdjusted === true * // adjustment.adjustedRiskLevel === "LOW" * ``` */ export declare function adjustSeverityForAnnotations(attackName: string, originalRiskLevel: SecurityRiskLevel, toolAnnotations: SecurityAnnotations | undefined, serverIsReadOnly: boolean, serverIsClosed: boolean): SeverityAdjustment; //# sourceMappingURL=AnnotationAwareSeverity.d.ts.map