import type { ContentType } from './config-schema.js';
import type { CustomSecret } from './secrets.js';
export declare function sanitize(text: string): string;
/**
 * Prompt injection patterns — verb + target proximity detection.
 * Shared between ingestion scrubbing and extraction flagging.
 */
export declare const INSTRUCTIONAL_LEAKAGE_RE: RegExp;
/** System XML tags that shouldn't appear in user content. Accounts for optional whitespace (e.g. `</ system>`). */
export declare const XML_TAG_LEAKAGE_RE: RegExp;
/** Suspicious Base64 blobs (60+ contiguous chars). */
export declare const BASE64_BLOB_RE: RegExp;
/** Excessive consecutive Unicode escape sequences. */
export declare const UNICODE_ESCAPE_RE: RegExp;
export interface IngestionSanitizeOptions {
    chunkType: ContentType;
    filePath?: string;
    onWarn?: (message: string) => void;
}
/**
 * Sanitize a chunk's text content before embedding into LanceDB.
 *
 * Strictness varies by content type:
 * - `spec` / `session_log`: strip invisible Unicode, flag injection patterns
 * - `code`: only strip Trojan Source BiDi overrides (preserves valid string literals)
 *
 * Injection patterns are flagged via onWarn but NOT stripped — they may be
 * legitimate discussions about security in specs or PRs.
 */
export declare function sanitizeForIngestion(text: string, options: IngestionSanitizeOptions): string;
/** Check whether a regex pattern is safe from catastrophic backtracking (ReDoS). */
export declare function isRegexSafe(pattern: string): boolean;
/** Compile user-defined custom secrets into executable RegExp instances. */
export declare function compileCustomSecrets(secrets: CustomSecret[], onWarn?: (message: string) => void): RegExp[];
/** Mask detected secrets with [REDACTED]. Returns the cleaned text. */
export declare function maskSecrets(text: string, customSecrets?: CustomSecret[]): string;
//# sourceMappingURL=sanitize.d.ts.map