Skip to content

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

Meta Engineering 10 min read Case study mediumAdept

How AI Is Transforming the Adoption of Secure-by-Default Mobile Frameworks

Meta wraps risky OS and third-party APIs in secure-by-default frameworks built on three principles: mirror the existing API, depend only on public and stable interfaces, and keep each library small but usable across all apps and OS versions. SecureLinkLauncher shows the approach on Android. It wraps startActivity-style calls and enforces intent scopes (family, same-key, internal, third-party) to block intent hijacking and data leaks to malicious apps. To migrate call sites at scale, a Llama 4 Maverick pipeline takes 10-20 lines of context around each call, infers the right scope, and emits the rewritten snippet plus actions such as adding imports. Each patch is validated with lints, compilation and tests, and errors are fed back for up to five retries before the patch goes to code owners for one-click review.

Related posts

  • Building secure mobile apps in the agentic era

    Shopify Engineering mediumAdept

    Shopify keeps pace with an 11x jump in mobile code output (~434k lines changed per week during a 12-week agent-driven rewrite) by maintaining a per-app attack surface map covering deep links, WebViews, stored data, permissions and dependencies, where every item carries one of five verdicts and a code link. Each surface has a reusable agent skill built from OWASP MASVS/MASTG plus lessons from past incidents and HackerOne reports. The skill first inventories every item and then has the model review one item at a time with only the relevant code, which keeps findings specific and verifiable. A weekday pipeline (prepare, review, publish) diffs the map against the last accepted version and validates model output, while agents also read security news and alert the team only when something affects the apps.

  • Scaling Slack’s Mobile Codebases: Modernization

    Slack Engineering mediumAdept

    Slack's year-and-a-half Duplo initiative concluded by modernizing its iOS and Android codebases: iOS moved to a custom VIPER-style feature architecture, stricter SwiftLint rules banning singletons and NotificationCenter, Combine (via CombineX until iOS 12 was dropped), and broader SlackKit adoption, while Android replaced Gson with Moshi, Android Priority Job Queue with WorkManager, and handwritten API calls with an internal Retrofit-based library, and introduced coroutines and Compose incrementally. iOS ended 68% modernized and 81% modularized with CI stability rising from 77% to 90% and average time-to-merge down 64%, Android reached 92% modularization, and local builds later dropped nearly 50% with Bazel and M1 Macs. Follow-up work includes layered module dependency rules to stop circular dependencies, possibly adopting Needle for dependency injection, and splitting Android modules into API/implementation pairs for build parallelism.

  • Open-sourcing Mariana Trench: Analyzing Android and Java app security in depth

    Meta Engineering easyNovice

    Mariana Trench is Meta's open-sourced static taint-analysis tool for Android and Java apps that finds security and privacy bugs by tracing data flows from sources (e.g., Intent.getData) to sinks (e.g., Log.w, Runtime.exec). It computes per-method models via abstract interpretation and lets security engineers write rules such as user-controlled input reaching an intent-redirection sink. Rules are refined until high-signal and then run on every pull request. Meta deliberately tolerates more false positives to catch rare exploitable edge cases, and triages results with SAPP, a post-processor that groups similar traces and visualizes source-to-sink paths. Mobile apps get this extra pre-release scrutiny because fixes depend on users installing updates.

  • App stability at scale with a layered defense

    Grab Engineering mediumAdept

    Grab keeps its Android and iOS superapp stable with a layered, shift-left defense against crashes. Prevention comes first: lint rules (including custom rules written from post-mortems) block merges in CI, followed by unit, UI component, E2E and manual QA testing and a mandatory one-week Grab Early Access build that auto-tickets new crashes. At the release gate, a week-long staged rollout monitors the new version's crash rate in isolation and auto-pauses expansion, while feature flags act as kill switches. In production, hard-threshold and trend alerts, a flag-first → server-side fix → hotfix escalation ladder, automated triage with severity SLAs, and a flag-rollout history dashboard contain and diagnose crashes that slip through.

  • How River takes security work from a fix to merge

    Shopify Engineering mediumAdept

    River, Shopify's Slack-based AI agent, drives dependency and application vulnerability fixes from patch to verified closure. It revalidates each ledger entry against the live repository head, PR state and vulnerability tracker before editing. It replays upgrades on the current head, grafts changes into the current lockfile, and ignores CI results from superseded commits. When it reaches a decision it cannot make, it hands owners one narrow question. After merge it confirms the default branch no longer carries the vulnerability. In the first 11 days the dependency backlog fell about 70%, and security merges through the freshness-gated merge queue rose from about 10% to 80%. The key lesson is that prompts can express judgment, but guarantees such as enumeration, deduplication and current-head identity must be enforced in code.

The quest for software engineering knowledge.

Look:
Layout: