pub fn redact_payload(value: &mut Value)Expand description
Mask credential-shaped fields anywhere in a trace payload.
ยงWhy this lives in the contract
Trace payloads carry tool arguments and model requests, which are exactly where an API key or bearer token ends up. Traces are also the data most likely to be shipped to a log aggregator and kept, so an unredacted secret there outlives the request that leaked it.
Redaction is therefore part of the wire contract rather than a courtesy each caller might forget: both the client and the server apply it, so a payload cannot be stored unmasked even if a caller skips the step.