Meta Mar 13, 2026

Patch Me If You Can: AI Codemods for Secure-by-Default Android Apps

Article Summary

Pascal Hartig explores how Meta's Product Security team uses AI to automatically patch security vulnerabilities across millions of lines of Android code. The challenge? Doing this at scale without disrupting thousands of engineers.

Meta's Product Security team faced a massive challenge: security vulnerabilities replicated across hundreds of call sites in a multi-app codebase serving billions of users. Their solution combines secure-by-default frameworks that wrap unsafe Android OS APIs with generative AI-powered codemods that automate migration at scale.

Key Takeaways

Critical Insight

Meta built an AI-powered system that can automatically migrate millions of lines of Android code to secure frameworks while minimizing disruption to engineering teams.

The podcast reveals specific lessons learned from implementing this at a scale few companies ever experience.

About This Article

Problem

Meta's Product Security team needs to update APIs and patch security vulnerabilities across millions of lines of code in a large multi-app codebase. The changes have to be replicated across hundreds of call sites to protect billions of users.

Solution

Pascal Hartig's team used generative AI to build codemods that automate code migration to secure-by-default frameworks. The system can propose, validate, and submit security patches without manual intervention.

Impact

This AI approach makes it easier for thousands of engineers to deploy security patches across the entire codebase. It keeps developer productivity and code quality intact while removing the manual work from the process.