Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 18 min read Deep dive hardMaster

How We’re Building Scam Alert on WhatsApp With End-to-End Encryption and Verifiability Guarantees

WhatsApp's Scam Alert is an optional feature that runs an on-device ML classifier over messages from non-contacts and shows a private in-chat warning. No message content leaves the device unless the user chooses to report it. Model versions are published to a public transparency ledger and the weights are released, so Meta cannot send a targeted model to one user. Telemetry is limited to aggregate warning and user-action counts, which pass through a confidential federated analytics pipeline built on attested CVM-based TEEs, OHTTP relays, anonymous credentials, secure aggregation, k-anonymity thresholds and differential privacy. Clients refuse to transmit if the attestation or the privacy parameters fail locally enforced guardrails.

Assumes: end-to-end encryptiontrusted execution environmentsdifferential privacy basicsremote attestation

Related posts

  • Building Private Processing for AI tools on WhatsApp

    Meta Engineering hardMaster

    Private Processing lets WhatsApp users send messages to server-side AI features such as summarization and writing suggestions without Meta or WhatsApp being able to read them. Requests run inside confidential VMs, a type of Trusted Execution Environment, with Confidential Compute mode GPUs behind them. Clients authenticate with anonymous credentials and reach the service through an Oblivious HTTP third-party relay that hides their IP and prevents targeting a specific user to a specific machine. They then open an RA-TLS session whose attestation is checked against a third-party log of approved binaries. The service is stateless and forward secure, bans remote shell access, filters logs leaving the CVM, and uses multi-party-reviewed builds, all guided by a threat model covering insiders, supply-chain vendors and malicious users.

  • DIT — enabling de-identified data collection on WhatsApp

    Meta Engineering hardMaster

    WhatsApp's De-identified Telemetry (DIT) collects usage, reliability and performance data without linking it to a user. The client first fetches anonymous tokens over an authenticated connection, then uploads logs over an unauthenticated one, binding each log with an HMAC keyed from a token. Tokens come from a Verifiable Oblivious Pseudorandom Function (VOPRF) evaluated by an Anonymous Credential System, modeled on Privacy Pass, so issuance and redemption cannot be linked. At scale the design uses Curve25519 instead of Ristretto to save app size, rotates keys more often to blunt static DH attacks, rate-limits through key rotation, allows each token 64 uses per day, strips IPs at the edge, and monitors the collected data for re-identification risk.

  • How WhatsApp enables multi-device capability

    Meta Engineering mediumAdept

    WhatsApp's new multi-device architecture drops the phone as source of truth: each device gets its own identity key, the server maps accounts to device lists, and senders use client-side fanout to encrypt each message separately over pairwise Signal sessions to every sender and recipient device. Security codes now cover all device identities, and Automatic Device Verification limits re-verification to full account re-registration. Calls send per-device SRTP master secrets via fanout, with group calls rekeyed when participants change. Message history moves to a new device as an encrypted bundle, while ongoing app state is stored server-side end-to-end encrypted, including metadata, under rotating keys.

  • Privacy-Aware Infrastructure in the AI-Native Era: An Asset Classification Case Study

    Meta Engineering mediumAdept

    Meta classifies data assets for privacy enforcement with a hybrid pipeline: it builds structured evidence briefs from code resolution, lineage, ownership and annotations, uses LLMs only for novel or ambiguous assets, and distills stable patterns into versioned, human-reviewed deterministic rules. About 85% of requests resolve on the deterministic path in single-digit milliseconds. The ~15% LLM fallback takes seconds and costs roughly 400x the compute. Key lessons are that context matters more than prompt tuning, that circular label fields must be masked from both the LLM and rule distillation, and that evaluation must stay independent of optimization, using frozen human-reviewed reference sets and calibrated confidence scores.

  • MCP Horror Stories: The WhatsApp Data Exfiltration Attack

    Docker mediumAdept

    A WhatsApp MCP vulnerability disclosed by Invariant Labs lets a malicious MCP server exfiltrate a user's entire WhatsApp message history. It combines a "rug pull" tool-description swap after approval with tool poisoning that tells the agent to redirect send_message to an attacker's number and embed list_chats output. The payload hides behind trailing whitespace that client UIs like Cursor truncate, so the confirmation dialog shows only "Hi". A second variant needs no malicious server at all: the attacker sends a WhatsApp message whose text the agent reads via list_chats and treats as instructions. The poisoned descriptions rely on authority language, technical jargon, threats of crashes or bad UX, and instructions to keep the user uninformed, all made possible by missing isolation between MCP servers, no detection of description changes, and unrestricted network access.

The quest for software engineering knowledge.

Look:
Layout: