Skip to main content

redact_key

Function redact_key 

Source
fn redact_key(text: &str, key: &str) -> String
Expand description

Text with the credential’s copies masked, before the body is cut - a key straddling the cut would otherwise survive as a fragment of itself. A text carrying no key material comes back untouched, its own formatting intact.

The error text reaches tool output and the transcript JSONL, neither of which rotates, so a host reflecting the request (the key rides its auth) must not put key material there. Two masks cover the shapes a copy arrives in: the key itself wherever it appears, and any word carrying a window of it - a reflected copy can be truncated or wrapped across words, so a word may carry only a piece of the key.