/** * Result scrubbing for brokered MCP calls (DES-MCP-TOOLS-001 §4.3 D-2, §6 step 8). * * Every result an upstream returns passes through here before a worker, a log or a record sees * it, in this order: * * 1. **Exact secrets**: every value the broker injected on THIS call is replaced wherever it * appears (`scrubSecrets`, the same pass the registry's probe uses). * 2. **Field names**: a value under a credential-named key (Authorization, Cookie, *token*, * *secret*, *passw*, *credential*, *session*, api/private/access/secret key, ...) becomes * `[REDACTED:field:]`, recursively. * 3. **Value shapes**: credential-shaped substrings anywhere (Bearer/Basic auth, JWTs, AWS access * key ids, GitHub/OpenAI/Slack tokens, `password=...` pairs, PEM private keys) become * `[REDACTED:]`. * * Layers 2 and 3 are ported from wicked-garden's QE evidence redactor * (`scripts/qe/runner/src/redact.mjs`). One difference: garden also denies a bare `key` field. * An MCP result routinely carries `key` as an identifier (a Jira issue key, a cache key), so here * only the qualified credential keys are denied (`api_key`, `private-key`, `accessKey`, ...). */ export declare function isDeniedFieldName(name: string): boolean; interface ValuePattern { id: string; re: RegExp; replace?: (match: string, ...groups: string[]) => string; } export declare const VALUE_PATTERNS: ReadonlyArray; export declare function redactString(value: string): string; /** Layers 2 and 3 over any JSON value. Pure: returns a new value. */ export declare function redactDeep(value: T): T; /** All three layers: the exact injected `secrets` first, then field names and value shapes. */ export declare function scrubResult(value: T, secrets: ReadonlyArray): T; export {}; //# sourceMappingURL=redact.d.ts.map