/** * Beam Shield — Wall 5: Anomaly Detection * Detects unusual behavior patterns that may indicate compromise or attack. */ export interface AnomalyResult { type: string; severity: 'low' | 'medium' | 'high' | 'critical'; description: string; shouldAlert: boolean; } interface DB { prepare: (sql: string) => { get: (...args: unknown[]) => Record | undefined; all: (...args: unknown[]) => Record[]; }; } export declare class AnomalyDetector { private db; constructor(db: DB); /** Check if response size is 10x the agent's average */ checkResponseSizeAnomaly(agentBeamId: string, currentSize: number): AnomalyResult | null; /** Check if this intent type was never seen from this sender */ checkNewIntentType(senderBeamId: string, intentType: string): AnomalyResult | null; /** Check for burst of intents from a single sender */ checkRapidSenderRate(senderBeamId: string, windowMinutes?: number): AnomalyResult | null; /** Check if sender's trust score dropped since last contact */ checkTrustDrop(senderBeamId: string, currentTrust: number): AnomalyResult | null; /** Run all anomaly checks */ detectAll(context: { senderBeamId: string; intentType: string; currentTrust: number; responseSize?: number; }): AnomalyResult[]; } export {};