export type RuleCategory = "prompt-injection" | "sensitive-data" | "api-key-leak" | "unsafe-output" | "ai-runtime-abuse" | "config-exposure" | "training-data-poisoning" | "model-dos" | "supply-chain" | "model-theft" | "excessive-agency" | "overreliance" | "workflow-security"; export type RuleSeverity = "low" | "medium" | "high" | "critical"; export type RuleMatch = { start: number; end: number; evidence: string; confidence: number; message?: string; }; export type SourceLine = { line: number; column: number; text: string; }; export type RuleScanOptions = { deepTaint?: boolean; taintDepth?: number; projectRoot?: string; }; export type RuleContext = { filePath: string; content: string; scanOptions?: RuleScanOptions; getLineFromOffset(offset: number): SourceLine; getWindow(start: number, end: number, padding: number): string; }; export type SecurityRule = { id: string; name: string; description: string; category: RuleCategory; severity: RuleSeverity; fixSuggestion: string; requiresAnyTerms?: readonly string[]; detect(context: RuleContext): RuleMatch[]; }; export type RulePlugin = { pluginId: string; name: string; version: string; rules: readonly SecurityRule[]; }; export type Finding = { id: string; filePath: string; ruleId: string; ruleName: string; description: string; category: RuleCategory; severity: RuleSeverity; message: string; fixSuggestion: string; confidence: number; riskScore?: number; signalSummary?: string; line: number; column: number; excerpt: string; pluginId: string; };