dash

2 posts

dropbox

How Dropbox uses MCP and Dash to close the design-to-code security gap (opens in new tab)

Dropbox found a significant gap between security design reviews and implementation. Only 12% of implementing pull requests linked back to their original threat models, and the median delay between review and code submission was about five weeks. To close this gap, Dropbox built a system using Dash, Model Context Protocol (MCP), and foundational models to automatically retrieve relevant security requirements and compare them with code during review. ## The Design-to-Code Gap - Threat models document risks, attack scenarios, and agreed-upon mitigations during security review. - These documents often remain in wikis or documentation systems, while implementation happens later through pull requests. - At Dropbox: - Only 12% of implementing PRs linked to their original design review. - Among 79 verified pairs, 54% of PRs were opened more than a month after the review. - The median delay was approximately five weeks, with some delays exceeding 11 months. - Only 29% of PRs were opened within two weeks of the security review. - About 15% of design reviews were filed retroactively, suggesting that some security-sensitive work was not identified early enough. ## Why Existing Tools Fall Short - Static analysis can detect whether certain security patterns or controls exist. - It generally cannot determine whether those controls satisfy the specific requirements agreed upon during design review. - Manual linking between PRs and threat models depends on engineers remembering additional workflow steps. - Reminder bots may improve compliance temporarily, but adherence tends to decline. - The core problem is not a lack of security documentation; it is the difficulty of making that existing context available during implementation. ## Dash and MCP as a Context Bridge - Dash already indexes Dropbox content and connected applications, including threat models and engineering documentation. - Dropbox used Dash’s MCP server to let an AI security agent search and read this content. - MCP provides a common interface for bringing multiple context sources into one agent session. - When a PR is opened, the agent retrieves relevant threat models and supporting documents. - A foundational model then compares the documented requirements with the proposed code. - For example, it can identify whether code implementing an endpoint enforces authentication required by the corresponding threat model. - Unlike traditional static analysis, this approach evaluates code against documented security intent, not just known code patterns. ## Integrating Security into Code Review - Dropbox surfaced the system directly within the existing code-review workflow rather than creating a separate security process. - This allows developers and reviewers to receive relevant security context where implementation decisions are already evaluated. - The same mechanism can potentially identify missing reviews when code appears security-sensitive but has no corresponding threat model. Dropbox’s approach shows how retrieval and AI reasoning can reconnect design decisions with implementation. Organizations can apply the same pattern beyond security—for example, to compliance requirements, privacy reviews, accessibility standards, or other design-to-code checks.

meta

FFmpeg at Meta: Media Processing at Scale (opens in new tab)

FFmpeg is central to Meta’s media infrastructure, running tens of billions of times daily. Meta’s heavily modified internal fork became difficult to maintain as upstream FFmpeg evolved, so the company collaborated with the FFmpeg community to upstream key capabilities. Threaded multi-lane transcoding and real-time quality metrics now allow Meta to rely entirely on upstream FFmpeg for VOD and livestreaming. ## Moving Away from an Internal FFmpeg Fork - Meta’s fork had diverged substantially from upstream while supporting specialized requirements. - Maintaining both the fork and newer open-source FFmpeg versions created: - Divergent feature sets - Difficult rebases - Increased regression risk - Collaboration with FFmpeg developers, FFlabs, and VideoLAN enabled the needed functionality to be integrated upstream. ## More Efficient Multi-Lane Transcoding - Meta creates multiple DASH encodings for each uploaded video, varying resolution, codec, framerate, and quality. - Running separate FFmpeg processes wastes resources by repeatedly decoding the same source and starting multiple processes. - A single FFmpeg command can decode once and send frames to multiple encoder instances. - Earlier FFmpeg versions still processed those encoders serially for each frame. - Improved parallel encoder threading, introduced from FFmpeg 6.0 and completed in FFmpeg 8.0, allows encoder instances to run concurrently. - The change reduces compute overhead across Meta’s more than one billion daily video uploads. ## Real-Time Quality Metrics for Livestreaming - Metrics such as PSNR, SSIM, and VMAF measure compression-related visual quality loss. - Traditional FFmpeg workflows calculate these metrics after encoding, which is unsuitable for live video. - Meta needed a decoder after each encoder to reconstruct compressed frames and compare them with the original frames during processing. - FFmpeg’s “in-loop” decoding, available beginning in FFmpeg 7.0, enables real-time per-lane quality measurement within one command. ## Deciding What to Upstream - Meta aims to upstream changes that provide broad value to FFmpeg users. - Infrastructure-specific patches are kept internal when they cannot be reasonably tested or used by the wider community. - Meta’s custom MSVP transcoding ASIC is integrated through FFmpeg’s standard hardware APIs, alongside NVIDIA, AMD, and Intel technologies. - Because external developers cannot access MSVP hardware, Meta maintains and validates those internal patches itself. ## Continued Investment in FFmpeg - Upstream improvements allowed Meta to retire its internal fork for all VOD and livestreaming pipelines. - Standardized hardware interfaces make it easier to combine specialized ASICs with software-based encoding and decoding. - Meta plans to continue contributing to FFmpeg to improve efficiency, reliability, codec support, and media experiences across the industry. Meta’s experience demonstrates that upstreaming broadly useful infrastructure improvements can reduce long-term maintenance costs while strengthening the entire FFmpeg ecosystem.