/** * High-confidence key/value credential forms shared with core * `safety.secretPattern` / `key-value-secret` (keep sources in sync). * * Matches house-format credentials such as: * internal_token= * token= * api_key= * * Intentionally does **not** match metric/config lookalikes such as * maxTokens=, tokenCount=, secret=false, short placeholders, or values that are * *entirely* a library-emitted redaction placeholder (`[REDACTED]`, * `[HASH:xxxxxxxx]`, `[HASH:unknown]`). Arbitrary `[REDACTED:…]` / `[HASH:…]` * payloads are not trusted. A marker used as a prefix (`[REDACTED]canary…`) * or incomplete marker (`[REDACTED]/canary…`) is still a secret. Query * separators (`&`, `#`, `?`) may end a complete placeholder when the same form * appears in a URL query; `/` and `;` do **not** — they are ordinary free-text * characters. */ declare const KEY_VALUE_SECRET_PATTERN_SOURCE: string; declare const KEY_VALUE_SECRET_PATTERN: RegExp; declare function valueContainsKeyValueSecret(value: string): boolean; type RedactionProfile = "local" | "share" | "strict"; type RedactionAction = "replace" | "hash" | "prefix" | "truncate" | "keep"; type RedactionSeverity = "info" | "warning" | "error"; type RedactionMatchKind = "key" | "value" | "custom"; type RedactionRule = string | { key: string; strategy: "full"; } | { key: string; strategy: "prefix"; keep?: number; } | { key: string; strategy: "hash"; }; interface RedactionFinding { path: string; detector: string; action: RedactionAction; severity: RedactionSeverity; matchKind: RedactionMatchKind; preview?: string; } interface RedactionDetection { action?: RedactionAction; replacement?: unknown; severity?: RedactionSeverity; matchKind?: RedactionMatchKind; preview?: string; } interface RedactionDetectorInput { path: string; key?: string; value: unknown; } interface RedactionDetector { id: string; severity?: RedactionSeverity; matchKind?: RedactionMatchKind; detect(input: RedactionDetectorInput): RedactionDetection[]; } interface RedactionResult { value: T; findings: RedactionFinding[]; redacted: boolean; profile: RedactionProfile; } interface ResolvedRedactionProfile { profile: RedactionProfile; extraKeys: readonly string[]; maxMetadataValueLengthCap?: number; maxPreviewLengthCap?: number; } interface RedactOptions { profile?: RedactionProfile; detectors?: RedactionDetector[]; rules?: RedactionRule[]; replacement?: string; maxDepth?: number; maxStringLength?: number; collectFindings?: boolean; } interface RedactorOptions extends RedactOptions { extraKeys?: readonly string[]; } declare const DEFAULT_REDACT_KEYS: readonly ["authorization", "cookie", "token", "apiKey", "password", "secret", "email"]; declare const SHARE_PROFILE_EXTRA_KEYS: readonly ["userEmail", "customerEmail", "phone", "phoneNumber", "address", "ip", "ipAddress", "sessionId", "requestId", "correlationId", "decisionId", "groupId", "customerId", "userId", "accountId", "tenantId", "orgId", "organizationId", "traceId", "spanId", "parentSpanId", "currentTask", "task", "userInput", "requestText", "conversationText"]; declare const STRICT_PROFILE_EXTRA_KEYS: readonly ["prompt", "completion", "input", "output", "inputPreview", "outputPreview", "message", "messages", "transcript", "context", "document", "documents", "chunk", "chunks", "retrieval", "query"]; declare function createRedactionProfile(profile?: RedactionProfile): ResolvedRedactionProfile; declare class Redactor { #private; constructor(options?: RedactorOptions); redactValue(key: string, value: unknown): unknown; redactRecord(record: Record): Record; redact(value: T): RedactionResult; } declare function createRedactor(options?: RedactorOptions): Redactor; declare function redact(value: T, options?: RedactOptions): RedactionResult; export { DEFAULT_REDACT_KEYS, KEY_VALUE_SECRET_PATTERN, KEY_VALUE_SECRET_PATTERN_SOURCE, type RedactOptions, type RedactionAction, type RedactionDetection, type RedactionDetector, type RedactionDetectorInput, type RedactionFinding, type RedactionMatchKind, type RedactionProfile, type RedactionResult, type RedactionRule, type RedactionSeverity, Redactor, type RedactorOptions, type ResolvedRedactionProfile, SHARE_PROFILE_EXTRA_KEYS, STRICT_PROFILE_EXTRA_KEYS, createRedactionProfile, createRedactor, redact, valueContainsKeyValueSecret };