11 Privacy
- MUST apply redaction on the device. A field the app excludes never leaves the phone (11.1).
- Records may stay on the device, redacted and masked, for up to the retention the policy sets (24 hours by default, 7 days at most) before they are sent or deleted (section 15).
- MUST leave request bodies, response bodies and query strings on the device unless the app turns their capture on.
- MUST honor consent: when the app withdraws it, the SDK stops collecting and drops its queue, and the choice holds across launches until the app gives it back (section 13.5).
- SHOULD identify users only by a hash the app provides, in
user.hash. An SDK MUST NOT senduser.email,user.nameoruser.full_nameon its own initiative. - An app SHOULD set a
user.hashof at least 16 characters that cannot be guessed from the user, for example the lowercase hex SHA-256 of its own user id and a secret it keeps. A remote request (15.5) or a live tester (16.1) matched by a user hash reaches that user’s devices, and a short hash can be found by trying. So a backend MAY match those by a hash of at least 16 characters only. A shorter one still works for everything else, and requests and testers then reach the user’s devices by their install id alone. An SDK sends the hash as the app sets it, whatever its length. - MUST NOT send
device.idor identifiers derived from IDFV, IDFA or the Android ID (section 2.2).app.installation.idis allowed and can be turned off (section 2.3). - MUST ship a privacy manifest (
PrivacyInfo.xcprivacy) with each SDK module on Apple platforms, declaring the data it collects and the required-reason APIs it uses. - A backend MUST NOT store the client IP address. It MAY derive a coarse location (country, region) from it at the edge, then drop it.
11.1 Redaction
Section titled “11.1 Redaction”The start option redact (13.1) lists attribute keys whose
values never leave the device. It is empty by default.
What matches. Keys are compared without regard to case. A record attribute matches a listed key when:
- its whole key is the listed key (
emailmatchesemail); or - the listed key has no dot, and is the attribute key’s last dot-separated segment.
emailmatchesuser.emailandcheckout.Email. It does not matchemail_hash,email.domainoruser.email.verified.
A listed key with a dot matches only that whole key: payment.card matches payment.card,
not card or order.payment.card.
What it does. The value becomes the string [REDACTED], whatever its type: a number, a
boolean or an array becomes that string too. The key stays, so a team can see the field was
there.
What it covers. The attributes the app hands the SDK, in every family (15.1):
- the attributes of
log(),recordError(),addBreadcrumb(),trigger()and the app’s spans; - the global attributes (
setAttribute) andsetUser’s attributes; - a cross-platform layer’s crash (14.1) and a bridged log record (13.7).
exception.message is also redacted, wherever the SDK writes it (handled errors, crashes),
when the list names it by that whole key. A handled error’s body, when the SDK makes it from
the message, is then redacted too. A listed message does not reach it: the last-segment
match never applies to the SDK’s keys.
What it never touches.
- The attributes the SDK writes for its own instrumentation, whatever the list holds: the
registry’s keys (A.4) as the SDK sets them, such as
app.screen.nameon a screen view orhttp.request.methodon a network span. The rest ofexception.*is never redacted either: grouping and symbolication need it, and the device fingerprint (15.7) reads the type and the frames, not the message. - The Resource (section 2).
- Free text: log bodies, breadcrumb messages and span names are not matched.
- URLs: a network span records no query string unless the app turns that on
(8.4), and its path is not redacted. A path that
holds personal data needs
url.template, or the app’s own handling. - Replay, which masks on its own rules (section 10).
redact is not a full filter for personal data. An app keeps secrets and personal data out of
messages and span names, and puts them only in attributes it lists.
When. An SDK MUST redact a record before it writes any of its files: the store
(15.2) and its journal, and crash reports with the context
they copy (the global attributes, a cross-platform layer’s crash). On a record, redaction
comes after the global attributes are merged in and before the limits of
1.6, so the cut never sees the raw value. Rules
(15.8) and triggers read the record as stored: a rule on a
listed key sees [REDACTED].
Where the list lives. On the device only: the list is never sent, since a list of keys can
itself tell what an app collects. Like every start option, it is the starting SDK’s. A
cross-platform layer passes its redact to the native start, and the native SDK redacts once,
for every record the layer hands it. A layer that starts after the native SDK started does not
change the list.
The reference function privacy.redact (B.2) fixes the
matching.