/** * Mutation Detector Module * Detects definition mutations and content changes for rug pull detection. * * Extracted from TemporalAssessor as part of Issue #106 refactoring. * DVMCP Challenge 4: Tool descriptions that mutate after N calls to inject malicious instructions. */ /** * Tracks tool definition snapshots across invocations to detect rug pull mutations. */ export interface DefinitionSnapshot { invocation: number; description: string | undefined; inputSchema: unknown; timestamp: number; } /** * Result of definition mutation detection. */ export interface DefinitionMutation { detectedAt: number; baselineDescription?: string; mutatedDescription?: string; baselineSchema?: unknown; mutatedSchema?: unknown; } /** * Result of content change detection. */ export interface ContentChangeResult { detected: boolean; reason: string | null; } /** * Detects definition mutations and semantic content changes in tool responses. * Used to identify "rug pull" attacks where tools change behavior after N invocations. */ export declare class MutationDetector { /** * Detect mutations in tool definition across invocation snapshots. * DVMCP Challenge 4: Tool descriptions that mutate after N calls. */ detectDefinitionMutation(snapshots: DefinitionSnapshot[]): DefinitionMutation | null; /** * Secondary detection for stateful tools that pass schema comparison. * Catches rug pulls that change content semantically while keeping schema intact. * * Examples detected: * - Weather data -> "Rate limit exceeded, upgrade to premium" * - Stock prices -> "Subscribe for $9.99/month to continue" * - Search results -> "Error: Service unavailable" */ detectStatefulContentChange(baseline: unknown, current: unknown): ContentChangeResult; /** * Extract text content from a response for semantic analysis. */ private extractTextContent; /** * Check for error-related keywords that indicate service degradation. */ private hasErrorKeywords; /** * Check for promotional/monetization keywords that indicate a monetization rug pull. * Enhanced to catch CH4-style rug pulls with limited-time offers, referral codes, etc. * * Combined into single regex for O(text_length) performance instead of O(18 * text_length). */ private hasPromotionalKeywords; /** * Check for suspicious URL/link injection that wasn't present initially. * Rug pulls often inject links to external malicious or monetization pages. */ private hasSuspiciousLinks; } //# sourceMappingURL=MutationDetector.d.ts.map