Files
Dery Ferdikaanddebpalash ba98d1d89d fix(logs): redact provider keys in log messages, not only in tracebacks (#4506)
* fix(logs): redact provider keys in log messages, not only in tracebacks

core.scrub already knows the credential shapes a vendor echoes back in its own
error text (sk-..., AIza..., AKIA..., GitHub PATs, JWTs, bearer tokens, Slack
tokens), but the log filter applied them only to exc_text, through scrub_text.
A provider that quotes the caller's key in a failure message therefore left it
in the log line verbatim, and from there in the diagnostics attached to a bug
report; the same text inside a traceback came out redacted.

scrub_credential_shapes() is the cheap half of scrub_text: the same patterns,
without the env-var sweep or the home-path regexes, behind one prefix scan so an
ordinary record pays a single substring test. The filter uses it for record.msg
and for the arguments, which is where the raw provider text actually arrives
(translation_quality logs the exception as an argument).

The crash-log suite and the existing traceback cases stay green.

* docs(changelog): note the provider-key log fix (#4506)

* fix(logs): case-insensitive credential gate covers every bearer spelling; scope the changelog

---------

Co-authored-by: debpalash <4178343+debpalash@users.noreply.github.com>
2026-11-27 05:46:20 -08:00
..