Skip to content

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

Meta Engineering 19 min read Case study mediumAdept

How Meta understands data at scale

Meta's Privacy Aware Infrastructure builds data understanding by schematizing every data asset in a canonical Thrift-based format (DataSchema, covering over 100 million schemas across 100+ systems) and annotating fields with a universal privacy taxonomy of semantic types. Annotation is shifted left into developer workflows. A classification pipeline of scheduling, sampling, scanning, heuristics and ML models predicts labels, auto-assigns them above a confidence threshold, and propagates them along lineage so copies inherit equivalent classifications. A Facebook Dating religious-views walkthrough shows how schema, annotation and OneCatalog inventory let purpose-limitation controls follow sensitive data across heterogeneous systems.

Assumes: data schemas and IDLsdata lineageML classification basics

Related posts

  • 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.

  • How Meta enforces purpose limitation via Privacy Aware Infrastructure at scale

    Meta Engineering mediumAdept

    Meta enforces purpose limitation (data used only for allowed purposes) with Policy Zones, an information flow control system built into HHVM, Presto, Spark and other infrastructure. It replaces fragile point checks and ACL-based physical data separation with runtime checks on annotated data flows. Developers label data assets and requests or functions with annotations. Zones then propagate context through function call stacks or SQL batch jobs and flag violations in logging mode before switching to blocking enforcement. Policy Zone Manager tooling, backed by data lineage and an ML classifier, guides large rollouts through four steps: identify assets, discover downstream flows, remediate each flow (annotate the sink, block it, or reclassify it), and enforce and monitor.

  • How Meta discovers data flows via lineage at scale

    Meta Engineering mediumAdept

    Meta builds a data lineage graph across its web, data warehouse and AI systems to find where sensitive data such as Facebook Dating religion fields flows, so privacy controls like Policy Zones can be applied. Signals come from static code analysis, from Privacy Probes runtime instrumentation, and from SQL analysis of Presto and Spark query logs and AI training configs. Privacy Probes captures sampled source and sink payloads within a request and classifies pairs as a high-confidence match-set (exact or contains match) or a noisier full-set that can include transformed flows. An iterative tool in Policy Zone Manager then walks the graph from sources, with developers or heuristics excluding irrelevant nodes so that whole downstream branches are pruned at once.

  • Policy Zones: How Meta enforces purpose limitation at scale in batch processing systems

    Meta Engineering mediumAdept

    Meta's Policy Zones, part of its Privacy Aware Infrastructure, applies information flow control to enforce purpose limitation across an exabyte-scale data warehouse. Datasets and loggers carry Governable Data Annotations such as MESSAGING_DATA, and downstream data must be at least as restrictive as its sources. A SQL parser (UPM) turns queries from processors like Presto into semantic trees. A Policy Evaluation Service checks each flow and issues a cryptographically signed token that the Warehouse Permission Service validates at access time. Policy Zone Manager tooling handles label creep through reclassification, letting the system run across millions of datasets, tens of millions of daily flows and trillions of consent checks per hour.

  • Scaling Privacy Infrastructure for GenAI Product Innovation

    Meta Engineering easyNovice

    Meta scales its Privacy Aware Infrastructure (PAI) to cover GenAI products such as its AI glasses, using cross-stack data lineage as the foundation for automated privacy enforcement. Lineage signals are collected from web privacy probes, logger-to-warehouse flows, parsed SQL and batch-processing logs, RPC boundaries for LLM inference calls, and training manifests, then stitched into an end-to-end graph. A shared library, PrivacyLib, links reads to writes through a common correlation key across languages and data systems. The resulting lineage guides where Policy Zones are placed and blocks training jobs on data not permitted for that purpose, while verifiers continuously watch flow edges to catch new or changed processing early.

The quest for software engineering knowledge.

Look:
Layout: