import type { IAgentRuntime, UUID } from "../../../types/index.ts";
import { type Action, type CoordinationDetection, type CredentialTheftDetection, type ImpersonationDetection, type Message, type MultiAccountDetection, type PhishingDetection, type SecurityCheck, type SecurityContext, type SecurityEvent, SecurityEventType, type ThreatAssessment } from "../types/security.ts";
import type { TrustEngine } from "./TrustEngine.ts";
export interface RiskScore {
    score: number;
    factors: Record<string, number>;
    recommendation: string;
}
export interface SocialEngineeringFactors {
    urgency: number;
    authority: number;
    intimidation: number;
    liking: number;
    reciprocity: number;
    commitment: number;
    socialProof: number;
    scarcity: number;
}
export declare class SecurityModule {
    private runtime;
    private trustEngine;
    private behavioralProfiles;
    private messageHistory;
    private actionHistory;
    private keywordPatternCache;
    private readonly INJECTION_PATTERNS;
    private readonly INJECTION_KEYWORDS;
    private readonly URGENCY_KEYWORDS;
    private readonly AUTHORITY_KEYWORDS;
    private readonly INTIMIDATION_KEYWORDS;
    private readonly CREDENTIAL_PATTERNS;
    private readonly SENSITIVE_KEYWORDS;
    private readonly PHISHING_INDICATORS;
    /**
     * Initialize the security module
     */
    initialize(runtime: IAgentRuntime, trustEngine: TrustEngine): Promise<void>;
    /**
     * Detect prompt injection attempts
     */
    detectPromptInjection(message: string, context: SecurityContext): Promise<SecurityCheck>;
    /**
     * Detect social engineering attempts
     */
    detectSocialEngineering(message: string, context: SecurityContext): Promise<SecurityCheck>;
    /**
     * Analyze a message for security threats
     */
    analyzeMessage(message: string, entityId: UUID, context: SecurityContext): Promise<SecurityCheck>;
    /**
     * Assess overall threat level
     */
    assessThreatLevel(context: SecurityContext): Promise<ThreatAssessment>;
    /**
     * Get recent security incidents
     */
    getRecentSecurityIncidents(_roomId?: UUID, hours?: number): Promise<SecurityEvent[]>;
    /**
     * Get security recommendations based on threat level
     */
    getSecurityRecommendations(threatLevel: number): string[];
    /**
     * Log security event (now public)
     */
    logSecurityEvent(event: Omit<SecurityEvent, "id" | "timestamp" | "handled">): Promise<void>;
    /**
     * Analyze social engineering factors
     */
    private analyzeSocialEngineeringFactors;
    /**
     * Calculate keyword score
     */
    private calculateKeywordScore;
    private static readonly SE_FACTOR_PHRASES;
    private detectFactorScore;
    /**
     * Calculate overall social engineering risk
     */
    private calculateSocialEngineeringRisk;
    /**
     * Analyze semantic patterns
     */
    private analyzeSemantics;
    private normalizeForScan;
    private reverseString;
    private getKeywordPattern;
    private containsObfuscatedKeyword;
    private detectObfuscatedKeywordMatches;
    /**
     * Log trust impact from security events
     */
    logTrustImpact(entityId: UUID, event: SecurityEventType, impact: number, context?: {
        worldId?: UUID;
    }): Promise<void>;
    /**
     * Maps security events to trust evidence types
     */
    private mapSecurityEventToTrustEvidence;
    /**
     * Detect multi-account manipulation
     */
    detectMultiAccountPattern(entities: UUID[], timeWindow?: number): Promise<MultiAccountDetection | null>;
    /**
     * Detect credential theft attempts
     */
    detectCredentialTheft(message: string, entityId: UUID, context: SecurityContext): Promise<CredentialTheftDetection | null>;
    /**
     * Detect phishing campaigns
     */
    detectPhishing(messages: Message[], entityId: UUID): Promise<PhishingDetection | null>;
    /**
     * Detect impersonation attempts
     */
    detectImpersonation(username: string, existingUsers: string[]): Promise<ImpersonationDetection | null>;
    /**
     * Detect coordinated activity
     */
    detectCoordinatedActivity(entities: UUID[], timeWindow?: number): Promise<CoordinationDetection | null>;
    /**
     * Helper methods for pattern detection
     */
    private getBehavioralProfiles;
    private buildBehavioralProfile;
    private calculateProfileSimilarities;
    private calculateVariance;
    private checkSynchronizedActions;
    private getRecentActions;
    private detectSuspiciousLinks;
    private extractLinks;
    private calculateStringSimilarity;
    private calculateVisualSimilarity;
    private levenshteinDistance;
    /**
     * Store message for analysis
     */
    storeMessage(message: Message): Promise<void>;
    /**
     * Store action for analysis
     */
    storeAction(action: Action): Promise<void>;
}
//# sourceMappingURL=SecurityModule.d.ts.map