/** * Tier 2 Scanner — LLM-based security analysis via Workers AI. * * Takes SKILL.md content + Tier 1 findings and uses Cloudflare Workers AI * (Llama 3.1 70B) to provide a semantic security assessment with a score, * verdict, and rationale. */ import type { SecurityFinding, Tier2Result } from './types.js'; /** Minimum interface for the Workers AI binding */ export interface AIBinding { run(model: string, input: { messages: Array<{ role: string; content: string; }>; }): Promise<{ response?: string; }>; } /** * Runs Tier 2 LLM-based security analysis. * * Retries up to MAX_RETRIES times with exponential backoff on transient * failures (network errors, timeouts, 5xx). Only returns FAIL after all * retries are exhausted. * * @param content - The SKILL.md file content * @param tier1Findings - Findings from the Tier 1 pattern scanner * @param ai - The Workers AI binding (env.AI) * @returns Tier2Result with score, verdict, rationale, and model */ export declare function runTier2Scan(content: string, tier1Findings: SecurityFinding[], ai: AIBinding): Promise;