/** * Shared PII / credential redaction policy for the Frihet MCP server. * * Single source of truth for the set of field names that must never leave the * process in cleartext — government IDs (NIF/CIF/VAT), banking identifiers, * identity documents, internal trace/user identifiers, webhook signing secrets, * and auth tokens. * * Two consumers: * - openai-profile.ts — strips these from tool I/O in OpenAI-safe mode * (in-place DELETE of the live response the user receives). * - observability.ts — redacts these from every Langfuse trace payload * (non-mutating CLONE) so an external observability service never stores a * taxId / secret / IBAN, regardless of profile mode. * * Zero runtime deps — safe in both Node.js (stdio) and Cloudflare Workers (edge). */ /** Sentinel left in place of a redacted value in cloned (tracing) payloads. */ export declare const REDACTED = "[redacted]"; /** * Allowlist short, single-line human remediation prose for agent display. * * Server text is omitted unless it matches one of two explicit semantics: an * API-key scope instruction matching the ERP contract, or a conservative * workspace-owner access instruction. A small character alphabet and the * structural checks below are defense in depth. Rejection is intentional: an * omitted hint is safer than attempting to redact arbitrary backend prose. */ export declare function sanitizeServerRemediation(value: unknown, errorCode?: string): string | undefined; /** * Field names whose VALUES must never appear in logs, traces, or any surface * outside the process boundary. Includes snake_case + locale synonyms because * the Frihet API may return any of them via `.passthrough()` schemas. */ export declare const SENSITIVE_FIELD_NAMES: readonly string[]; /** Recursively removes named fields from an object/array tree, IN PLACE. */ export declare function deepRedact(obj: unknown, fields?: readonly string[]): void; /** Best-effort redaction of JSON field patterns from display / serialized text. */ export declare function redactText(text: string, fields?: readonly string[]): string; /** * Returns a deep CLONE of `value` with sensitive field values replaced by the * REDACTED sentinel (objects/arrays) and JSON field patterns stripped from any * string leaf (covers the serialized MCP `content[].text` block). * * Unlike {@link deepRedact} this never mutates its argument — required for * tracing, where the original object is the live response returned to the * caller. A depth guard bounds pathological / cyclic structures. */ export declare function redactClone(value: unknown, fields?: readonly string[], depth?: number): unknown; //# sourceMappingURL=redaction.d.ts.map