Removes recognizable personal and credential data from a string: email addresses, IP
addresses, URL credentials/queries/fragments, home-directory user names, authorization
headers, JWTs, and token=...-style pairs.
Copies a value into a JSON-safe form with sensitive data removed: strings are scrubbed, values under sensitive keys are replaced, and size, depth, and cycles are bounded.
Strips personally identifiable and credential-like data from text and values before they are sent off the device as diagnostic logs. Pattern-based and deliberately conservative: it removes what it recognizes, so it complements (not replaces) not logging sensitive data in the first place.
Source