Strips secrets, API keys, Bearer/Basic tokens, private keys, and user home directory paths.
Redaction precedes truncation so a cut cannot reveal a credential prefix.
Parameters
Optionaltext: string|null
Raw diagnostic or error text to sanitize.
Returns string
Sanitized string bounded within MAX_RAW_INPUT_LENGTH bytes.
Strips secrets, API keys, Bearer/Basic tokens, private keys, and user home directory paths. Redaction precedes truncation so a cut cannot reveal a credential prefix.