/** * Annotation Deception Detector * High-confidence deception detection for obvious annotation misalignments * * Extracted from ToolAnnotationAssessor.ts for maintainability. * Handles keyword-based misalignment detection. */ /** * Keywords that contradict readOnlyHint=true (these tools modify state) */ export declare const READONLY_CONTRADICTION_KEYWORDS: string[]; /** * Suffixes that exempt "run" from readOnlyHint contradiction detection. * Tools matching "run" + these suffixes are legitimately read-only (fetch analysis data). * Issue #18: browser-tools-mcp uses runAccessibilityAudit, runSEOAudit, etc. */ export declare const RUN_READONLY_EXEMPT_SUFFIXES: string[]; /** * Prefixes that indicate read-only operations. * Issue #161: When a tool starts with these prefixes, certain keywords become nouns. * For example, "post" in "get_post_details" is a Reddit post (noun), not POST method (verb). */ export declare const READONLY_PREFIX_PATTERNS: RegExp[]; /** * Keywords that can be nouns when following a read-only prefix. * Issue #161: These words are verbs when used as prefixes (post_message) but * nouns when used after read-only prefixes (get_post_details). */ export declare const NOUN_KEYWORDS_IN_READONLY_CONTEXT: string[]; /** * Keywords that contradict destructiveHint=false (these tools delete/destroy data) */ export declare const DESTRUCTIVE_CONTRADICTION_KEYWORDS: string[]; /** * Deception detection result */ export interface DeceptionResult { field: "readOnlyHint" | "destructiveHint"; matchedKeyword: string; reason: string; } /** * Check if a tool name contains any of the given keywords (case-insensitive) * Uses word segment matching to avoid false positives (e.g., "put" in "output") * Issue #25: Substring matching caused false positives for words like "output", "input", "compute" * * Handles: camelCase (putFile), snake_case (put_file), kebab-case (put-file), PascalCase (PutFile) */ export declare function containsKeyword(toolName: string, keywords: string[]): string | null; /** * Check if a tool name with "run" keyword is exempt from readOnlyHint contradiction. * Tools like "runAccessibilityAudit" are genuinely read-only (fetch analysis data). * Issue #18: Prevents false positives for analysis/audit tools. */ export declare function isRunKeywordExempt(toolName: string): boolean; /** * Check if a keyword is being used as a noun in a read-only context. * Issue #161: "post" in "get_post_details" is a Reddit post (noun), not POST method (verb). * Prevents false positives when read-only tools reference content types. * * @param toolName - The tool name to check * @param keyword - The keyword that was matched (e.g., "post") * @returns true if the keyword is a noun in this read-only context */ export declare function isNounInReadOnlyContext(toolName: string, keyword: string): boolean; /** * Type guard for confidence levels that warrant event emission or status changes. * Uses positive check for acceptable levels (safer than !== "low" if new levels added). */ export declare function isActionableConfidence(confidence: string): boolean; /** * Detect high-confidence annotation deception * Returns misalignment info if obvious deception detected, null otherwise */ export declare function detectAnnotationDeception(toolName: string, annotations: { readOnlyHint?: boolean; destructiveHint?: boolean; }): DeceptionResult | null; //# sourceMappingURL=AnnotationDeceptionDetector.d.ts.map