/** * CONTENT SAFETY - PII detection, profanity filters, prompt injection detection * Moderation APIs, content classification, safety scoring */ export declare enum SafetyViolationType { PROFANITY = "profanity", PII = "pii", PROMPT_INJECTION = "prompt_injection", HATE_SPEECH = "hate_speech", VIOLENCE = "violence", SEXUAL_CONTENT = "sexual_content", SELF_HARM = "self_harm", ILLEGAL_ACTIVITY = "illegal_activity", MALICIOUS_CODE = "malicious_code", SPAM = "spam" } export declare enum SafetyAction { ALLOW = "allow", WARN = "warn", BLOCK = "block", REDACT = "redact", MODIFY = "modify" } export interface SafetyConfig { enabled: boolean; filters: SafetyFilterConfig[]; pii_detection?: PIIDetectionConfig; moderation_api?: ModerationAPIConfig; custom_rules?: CustomSafetyRule[]; default_action?: SafetyAction; } export interface SafetyFilterConfig { type: SafetyViolationType; enabled: boolean; threshold: number; action: SafetyAction; custom_patterns?: RegExp[]; } export interface PIIDetectionConfig { enabled: boolean; types: PIIType[]; action: SafetyAction; redaction_char?: string; } export declare enum PIIType { EMAIL = "email", PHONE = "phone", SSN = "ssn", CREDIT_CARD = "credit_card", IP_ADDRESS = "ip_address", API_KEY = "api_key", PASSWORD = "password", NAME = "name", ADDRESS = "address", DATE_OF_BIRTH = "date_of_birth" } export interface ModerationAPIConfig { provider: 'openai' | 'anthropic' | 'perspective' | 'custom'; api_key?: string; endpoint?: string; threshold?: number; } export interface CustomSafetyRule { id: string; name: string; pattern: RegExp; violation_type: SafetyViolationType; action: SafetyAction; severity: number; } export interface SafetyCheckResult { safe: boolean; violations: SafetyViolation[]; modified_content?: string; redacted_content?: string; score: number; action: SafetyAction; } export interface SafetyViolation { type: SafetyViolationType; severity: number; confidence: number; location?: { start: number; end: number; }; matched_pattern?: string; suggestion?: string; action: SafetyAction; } export interface PIIMatch { type: PIIType; value: string; start: number; end: number; confidence: number; } export declare class PIIDetector { private patterns; private config; constructor(config: PIIDetectionConfig); /** * Detect PII in text */ detect(text: string): PIIMatch[]; /** * Redact PII from text */ redact(text: string, matches?: PIIMatch[]): string; private initializePatterns; private getConfidence; private validateLuhn; } export declare class ProfanityFilter { private profanity_list; private patterns; constructor(custom_words?: string[]); /** * Check if text contains profanity */ containsProfanity(text: string): boolean; /** * Find all profanity matches */ findMatches(text: string): Array<{ word: string; start: number; end: number; }>; /** * Censor profanity in text */ censor(text: string, replacement?: string): string; private initializeProfanityList; private buildPatterns; private escapeRegex; } export declare class PromptInjectionDetector { private injection_patterns; constructor(); /** * Detect potential prompt injection attempts */ detect(text: string): { detected: boolean; confidence: number; matches: string[]; }; private initializePatterns; } export declare class ContentSafetyClassifier { private pii_detector; private profanity_filter; private injection_detector; private config; constructor(config: SafetyConfig); /** * Check content safety */ check(content: string): SafetyCheckResult; private checkFilter; private checkPII; private redactContent; } //# sourceMappingURL=content-safety.d.ts.map