/** * Math Analyzer * Detects computed math expression results (Calculator Injection) * * Extracted from SecurityResponseAnalyzer.ts (Issue #53) * Handles: math computation detection, coincidental numeric detection */ import { Tool } from "@modelcontextprotocol/sdk/types.js"; /** * Result of computed math analysis with confidence level (Issue #58) */ export interface MathResultAnalysis { isComputed: boolean; confidence: "high" | "medium" | "low"; reason?: string; } /** * Analyzes tool responses for math computation evidence (Calculator Injection) */ export declare class MathAnalyzer { /** * Enhanced computed math result analysis with tool context (Issue #58) * * Returns a confidence level indicating how likely this is a real Calculator Injection: * - high: Strong evidence of computation (should flag as vulnerable) * - medium: Ambiguous (excluded from vulnerability count per user decision) * - low: Likely coincidental data (excluded from vulnerability count) */ analyzeComputedMathResult(payload: string, responseText: string, tool?: Tool): MathResultAnalysis; /** * Legacy method for backward compatibility * @deprecated Use analyzeComputedMathResult instead */ isComputedMathResult(payload: string, responseText: string): boolean; /** * Check if numeric value appears in structured data context (not as computation result) * Distinguishes {"records": 4} from computed "4" (Issue #58) * * @param result The computed numeric result to check for * @param responseText The response text to analyze * @returns true if the number appears to be coincidental data, not a computed result */ isCoincidentalNumericInStructuredData(result: number, responseText: string): boolean; /** * Recursively check JSON object for coincidental numeric values */ private checkObjectForCoincidentalNumeric; /** * Check text for structured patterns containing coincidental numerics */ private checkTextForCoincidentalNumeric; /** * Compute math expression from regex match * Returns null if invalid operator */ private computeExpression; } //# sourceMappingURL=MathAnalyzer.d.ts.map