Skip to content

Lesson 3 of 13 · 13m

Derive, Don't Collect

Compute the answer on-device or at ingest and never persist the raw input — the GAEN pattern for contact tracing and beyond.

Ship the answer, not the raw material

On April 10, 2020, Apple and Google announced a joint exposure-notification protocol for COVID contact tracing. The design is worth stealing wholesale. Phones broadcast rotating proximity identifiers — BLE beacons that change roughly every 15 minutes — and logged the identifiers they heard. When someone tested positive, their recent keys were uploaded; your phone downloaded the infected key list and did the matching on the device. No central server ever learned who was near whom, or where anyone was. The answer — "you were near a case" — shipped without the raw material, the location history.

That is the pattern this lesson is about: derive the value at the earliest possible point, and never persist the raw input.

The derivation ladder

Rank every intake from least invasive to most:

  1. Don't collect. The field doesn't exist. Most "company size" and "phone number" fields die here.
  2. Compute locally, ship the answer. Face grouping in Apple Photos runs on the device; Live Caption transcribes on-device; Android's Private Compute Core keeps Smart Reply and Live Translate on the handset. The server gets a boolean or a bundle, never the pixels or the audio.
  3. Degrade precision at the edge. Geolocate the IP and keep country_code, not the address. Truncate 203.0.113.47 to 203.0.113.0/24 — Matomo and Plausible do exactly this — or don't log the address at all.
  4. Aggregate at ingest. You don't need 50 million rows to know daily active users. HyperLogLog sketches give you approximate uniques in kilobytes; rollup tables give you counters. The rows never exist.
  5. Collect raw, bounded, justified. Sometimes you need it — payment rails, fraud signals. Then it's pseudonymized, access-controlled, and TTL'd. Collection becomes the deliberate choice, not the default.

The mental model to kill

Teams justify raw collection with optionality: "we might need it for ML later." Two problems. First, GDPR Article 5(1)(b) requires specified purposes; "later" is not one. Second, the option is never free — it's paid for continuously, in blast radius, access-surface, DSAR scope, and deletion fan-out. If the hypothetical feature can't name the fields it needs, it doesn't need them.

Federated learning is the honest version of the ML argument. Google shipped it on Gboard in 2017 — McMahan & Ramage's "Communication-Efficient Learning of Deep Networks from Decentralized Data" — training a shared model on gradients computed per-device, never on the keystrokes. When you genuinely need models, federating or DP-ing the training is the answer, not a data lake of everyone's typing.

The tradeoffs, stated plainly

  • You can't re-derive later. If your "did the user verify their age" flow stores verified=true instead of a birthdate, you can never run a different check on the birthdate. Accept it — that's minimization working, not a bug.
  • Debugging gets harder. Aggregated metrics can't answer "what happened to user X at 14:03." You trade observability for non-collection; compensate with short-TTL detail logs under access control rather than permanent row stores.
  • On-device compute costs your users. Federated learning burns their battery and bandwidth; on-device inference has real latency. The cost moves off your bill onto their device — it's a tradeoff, and sometimes centralization with a TTL is the honest better answer.
  • Local derivation can't be audited centrally. You can't verify every client computed honestly; that's why GAEN's matching needed health-authority key servers for the positive-test list. Design for adversarial inputs at the ingest edge.

The practice

Write an intake table — one row per thing you ingest: raw needed / derived suffices / none. Any "raw needed" without a named consumer gets downgraded or deleted. Then push the derivation as far left as it will go: device → edge → ingest-time transform → bounded row store. Data minimized at collection never needs a deletion pipeline, a DSAR export, or a breach disclosure. It's the only privacy control that's also free to operate.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.