/** * Credential shapes redacted before they leave this tree, in one place. * * Two tables evolved independently and disagreed: * * - `runtime/query/guardrail-presets.ts` carried eight vendor-prefix-anchored * patterns, private and unexported, deliberately narrow — a loose * "looks like a secret" regex over model output produces false positives * on ordinary code, and a redactor that fires on the wrong thing gets * switched off, at which point it protects nothing. * - `provider/errors.ts` carried a broader, field-name-aware set (a * generic key-prefix pattern, a bearer-header pattern, and a JSON * field-name scrubber that catches a secret by the key it sits under * regardless of value shape) because the narrow approach had already * proven insufficient there: a vendor error body echoes the request, * and a request can carry a credential shape the narrow table never * anticipated. * * Both live here now, as two exported sets rather than one, because the * cost of a false positive is not the same at the two call sites: * * - `OUTPUT_SECRET_PATTERNS` (the original narrow eight) is what * `secretRedactionGuardrail` matches against MODEL OUTPUT. A false * positive there rewrites the answer the caller asked for, so it stays * narrow on purpose. * - `LOG_SECRET_PATTERNS` (the union of both tables) is for text that is * being logged or carried in an error's `detail`, never returned as the * answer itself. A false positive there redacts one word out of a * diagnostic line nobody was going to copy-paste as a credential, which * is a cost worth paying for the wider net. * * `SecretPattern` label strings are never returned to the caller verbatim — * consumers replace a match with `[REDACTED: