End-to-end encryption (E2EE) in Messenger protects your messages from prying eyes. But what about the links shared within those messages? A malicious link can compromise your security regardless of encryption. Messenger's Advanced Browsing Protection (ABP) tackles this by checking URLs against a massive, frequently updated blocklist. The real challenge? Performing this check without revealing your browsing activity—even to Meta's servers. This isn't just a simple hash lookup; it's a feat of applied cryptography involving Private Information Retrieval (PIR), Oblivious Pseudorandom Functions (OPRF), and hardware-backed trusted execution. Let's unpack how it works.

The Core Challenge: Private Information Retrieval (PIR)
At its heart, ABP is a PIR problem. The client (your Messenger app) needs to ask the server "is this URL in your blocklist?" while revealing as little as possible about the URL itself. A naive solution would be for the server to send you the entire multi-million entry database, but that's impractical due to size and update frequency.
The starting point is an optimized PIR scheme using an Oblivious Pseudorandom Function (OPRF) and database sharding. The client blinds its query (the URL) using the OPRF, sending a scrambled version to the server. The server processes all entries in a specific "bucket" (shard) of the database and sends back the results. The client then unblinds the response to see if there was a match. The server never sees the plaintext query and only knows which bucket was accessed.
Handling URL Prefixes: The Privacy vs. Efficiency Trade-off
URL matching isn't exact. If evil.com/phishing is blocked, then evil.com/phishing/page2 should also be flagged. This requires prefix matching. A simple approach would have the client query every prefix (evil.com, evil.com/phishing, etc.), but this leaks more information (P * B bits for P prefixes).
ABP's solution is clever: bucket entries by domain. The client requests just one bucket (for evil.com) and checks all path prefixes locally. This fixes the privacy leak but creates an efficiency problem: buckets become unbalanced. Malicious actors often use the same domain (e.g., link shorteners) for many URLs, creating one massive bucket.
The Ruleset: Balancing the Buckets
To solve the unbalanced bucket problem, the server performs a pre-processing step to generate a ruleset. This ruleset tells the client how to compute the bucket ID for a given URL, often by hashing not just the domain but also a specific number of path segments.
# Conceptual example of applying a ruleset (not production code)
def compute_bucket_id(url, ruleset):
current_hash = hash(url.domain)
path_segments = url.path.split('/')
while current_hash[:16] in ruleset: # Check 8-byte hex prefix
num_segments_to_add = ruleset[current_hash[:16]]
# Append the specified number of path segments and re-hash
new_path = '/'.join(path_segments[:num_segments_to_add])
full_string = url.domain + '/' + new_path
current_hash = hash(full_string)
# Bucket ID is derived from the final hash
return current_hash[:4]
The server generates this ruleset iteratively, breaking up large buckets by adding rules for specific domains, ensuring all buckets are below a manageable size. This maintains the prefix-matching guarantee while enabling efficient, private queries. You can explore the technical foundations in the original engineering blog post.

Layering Privacy Protections
Even with PIR, the server learns the bucket index. ABP adds three more layers to obscure this final piece of information.
| Layer | Technology | What It Protects Against |
|---|---|---|
| Confidential Computing | AMD SEV-SNP (Trusted Execution Environment - TEE) | A compromised host OS or hypervisor reading the bucket ID in memory. The request is decrypted inside the secure enclave. |
| Oblivious RAM (ORAM) | Path ORAM algorithm | An adversary with memory access patterns observing which data within the TEE is being read. All database accesses look identical. |
| Oblivious HTTP (OHTTP) | Third-party proxy | The server linking a request to a client's IP address. The proxy strips identifying info before forwarding the encrypted request. |
Limitations and Considerations
While ABP is a significant privacy advance, it's not magic. The system involves trade-offs:
- Complexity: The architecture is intricate, relying on multiple cutting-edge cryptographic and systems techniques. Auditing and maintaining such a system is non-trivial.
- Trust Assumptions: It shifts trust from the application server to the hardware vendor (AMD for SEV-SNP) and the OHTTP proxy provider. A breach in these components could weaken the model.
- Performance Overhead: ORAM and cryptographic operations add latency and computational cost compared to a simple, non-private lookup. The engineering post details optimizations like parallel database copies to mitigate this.
- Scope: It protects the query for a URL. It does not hide the fact that a query was made, nor does it protect your privacy once you click and leave Messenger for the web browser.

Conclusion and Next Steps
Messenger's Advanced Browsing Protection represents the forefront of privacy-preserving security. It demonstrates how cryptographic primitives like PIR and OPRF, once academic curiosities, can be productized at scale when combined with hardware TEEs and clever systems engineering.
For developers and security engineers, the next step is to explore these building blocks. Understanding Oblivious Pseudorandom Functions and Private Information Retrieval schemes is becoming increasingly relevant as privacy regulations tighten and user expectations grow. Experimenting with open-source implementations of these protocols is a great way to start.
This approach isn't limited to URL checking. Similar architectures could be applied to private threat intelligence feeds, privacy-preserving fraud detection, or secure data marketplaces. The core idea—performing computations on sensitive data without exposing the data itself—is a powerful pattern for the future.
Further Reading: To see how major platforms are balancing innovation with user privacy, check out our analysis of recent announcements like the React Conf 2025 Key Takeaways on the Compiler, React 19.2, and the Future of Native. For another example of making powerful data tools accessible, read about the Data Commons MCP now hosted on Google Cloud.