Cloudflare uses AI to police code

Cloudflare deploys AI to enforce engineering standards, flagging 250K code deviations and blocking 16K merges via its Codex knowledge base.

8 min read
Diagram showing the Cloudflare Codex workflow from RFC proposal to approved and enforced states.
Cloudflare

Visual TL;DR. Scattered Engineering Guidance led to Cloudflare Codex. Cloudflare Codex powers AI Code Reviewer. Cloudflare Codex powers AI Spec Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Spec Reviewer resulted in Evaluated 600 Designs. AI Code Reviewer helps Enforce Engineering Standards. AI Spec Reviewer helps Enforce Engineering Standards.

  1. Scattered Engineering Guidance: guidance fragmented across docs, code, chats, and individual engineer knowledge
  2. Cloudflare Codex: unified repository of engineering guidance for human and automated consumption
  3. AI Code Reviewer: AI agent identifies violations of engineering best practices in code
  4. AI Spec Reviewer: AI agent evaluates technical designs prior to implementation
  5. Flagged 250K Deviations: nearly 250,000 violations of engineering best practices identified in 4 months
  6. Blocked 16K Merges: thousands of code merges blocked due to identified deviations
  7. Evaluated 600 Designs: spec reviewer agent evaluated approximately 600 technical designs
  8. Enforce Engineering Standards: Cloudflare uses AI to enforce consistent engineering standards
Visual TL;DR
Visual TL;DR, startuphub.ai Cloudflare Codex powers AI Code Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Code Reviewer helps Enforce Engineering Standards powers resulted in leading to helps Cloudflare Codex AI Code Reviewer Flagged 250K Deviations Blocked 16K Merges Enforce Engineering Standards From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai Cloudflare Codex powers AI Code Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Code Reviewer helps Enforce Engineering Standards powers resulted in leading to helps Cloudflare Codex AI Code Reviewer Flagged 250KDeviations Blocked 16KMerges EnforceEngineering… From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai Cloudflare Codex powers AI Code Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Code Reviewer helps Enforce Engineering Standards powers resulted in leading to helps Cloudflare Codex unified repository of engineering guidancefor human and automated consumption AI Code Reviewer AI agent identifies violations ofengineering best practices in code Flagged 250K Deviations nearly 250,000 violations of engineeringbest practices identified in 4 months Blocked 16K Merges thousands of code merges blocked due toidentified deviations Enforce Engineering Standards Cloudflare uses AI to enforce consistentengineering standards From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai Cloudflare Codex powers AI Code Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Code Reviewer helps Enforce Engineering Standards powers resulted in leading to helps Cloudflare Codex unified repositoryof engineeringguidance for human… AI Code Reviewer AI agent identifiesviolations ofengineering best… Flagged 250KDeviations nearly 250,000violations ofengineering best… Blocked 16KMerges thousands of codemerges blocked dueto identified… EnforceEngineering… Cloudflare uses AIto enforceconsistent… From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai Scattered Engineering Guidance led to Cloudflare Codex. Cloudflare Codex powers AI Code Reviewer. Cloudflare Codex powers AI Spec Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Spec Reviewer resulted in Evaluated 600 Designs. AI Code Reviewer helps Enforce Engineering Standards. AI Spec Reviewer helps Enforce Engineering Standards led to powers powers resulted in leading to resulted in helps helps Scattered Engineering Guidance guidance fragmented across docs, code,chats, and individual engineer knowledge Cloudflare Codex unified repository of engineering guidancefor human and automated consumption AI Code Reviewer AI agent identifies violations ofengineering best practices in code AI Spec Reviewer AI agent evaluates technical designs priorto implementation Flagged 250K Deviations nearly 250,000 violations of engineeringbest practices identified in 4 months Blocked 16K Merges thousands of code merges blocked due toidentified deviations Evaluated 600 Designs spec reviewer agent evaluatedapproximately 600 technical designs Enforce Engineering Standards Cloudflare uses AI to enforce consistentengineering standards From startuphub.ai · The publishers behind this format
Visual TL;DR, startuphub.ai Scattered Engineering Guidance led to Cloudflare Codex. Cloudflare Codex powers AI Code Reviewer. Cloudflare Codex powers AI Spec Reviewer. AI Code Reviewer resulted in Flagged 250K Deviations. Flagged 250K Deviations leading to Blocked 16K Merges. AI Spec Reviewer resulted in Evaluated 600 Designs. AI Code Reviewer helps Enforce Engineering Standards. AI Spec Reviewer helps Enforce Engineering Standards led to powers powers resulted in leading to resulted in helps helps ScatteredEngineering… guidance fragmentedacross docs, code,chats, and… Cloudflare Codex unified repositoryof engineeringguidance for human… AI Code Reviewer AI agent identifiesviolations ofengineering best… AI Spec Reviewer AI agent evaluatestechnical designsprior to… Flagged 250KDeviations nearly 250,000violations ofengineering best… Blocked 16KMerges thousands of codemerges blocked dueto identified… Evaluated 600Designs spec reviewer agentevaluatedapproximately 600… EnforceEngineering… Cloudflare uses AIto enforceconsistent… From startuphub.ai · The publishers behind this format

Cloudflare is deploying artificial intelligence to enforce its engineering standards, a move that has already flagged hundreds of thousands of code deviations and blocked thousands of merges. Over the past four months, the company's AI code reviewer identified nearly 250,000 violations of its engineering best practices. Its companion, a spec reviewer agent, has evaluated about 600 technical designs prior to implementation. This initiative draws from the Cloudflare Codex, a unified repository of engineering guidance designed for both human and automated consumption.

The need for such a system became apparent as Cloudflare grew. Previously, engineering guidance was scattered across documentation, code repositories, chat logs, and individual engineers' knowledge. This fragmentation made it difficult for developers to find current and authoritative information, leading to wasted time and inconsistent application of standards. Relying solely on human reviewers also became unsustainable; no single engineer could possibly read and verify every standard across all projects.

Building the Codex

To address this, Cloudflare constructed the Codex, a structured collection of engineering standards. This centralized knowledge base allows AI agents to access and apply guidance directly at the point of work, whether it's code review, technical design evaluation, or incident report analysis. The Codex is organized into distinct domains, such as architectural patterns, security, reliability, and specific programming languages. Each domain is managed by an owner responsible for its content quality and consistency.

Standards within the Codex follow an RFC (Request for Comments) format, using keywords like MUST and SHOULD as defined by RFC 2119. Any employee can propose a new standard via a merge request. These proposals undergo multiple rounds of feedback before an owner grants final approval, at which point the RFC becomes part of the Codex and is published internally. Initially, approved RFCs generate non-blocking findings. However, after an explicit promotion step, enforced RFCs can block merges that violate MUST requirements, providing a crucial buffer for teams to adapt to new standards.

AI's Role in Enforcement

Feeding the entire Codex corpus directly to a large language model would strain context windows and degrade performance, especially as the number of RFCs grows. Cloudflare employs a purpose-built agent to extract and condense MUST and SHOULD statements into a structured JSON format. This process enriches the data with metadata, enabling efficient retrieval and progressive disclosure of relevant standards. Each extracted statement receives a stable slug identifier, crucial for tracking across different systems over time for monitoring and exception handling.

The JSON output, an example of which details control plane service requirements, includes fields like `rfc`, `title`, `status`, `domain`, and `statements`. Each statement contains its own `slug`, `section`, `level` (MUST or SHOULD), `text`, and `href` for easy reference. This structured approach allows AI agents to precisely identify and flag deviations, freeing up engineers to focus on higher-level problem-solving and strategic development rather than manual compliance checks.

Why This Matters

Cloudflare's approach highlights a significant trend: the increasing reliance on AI not just for creating software, but for ensuring its quality and adherence to organizational policies. As software complexity and development velocity accelerate, traditional methods of code review and standard enforcement struggle to keep pace. By automating much of this process, Cloudflare aims to maintain engineering rigor at scale, prevent knowledge silos, and reduce the costly errors that can arise from inconsistent practices. This could set a precedent for other large tech organizations grappling with similar scaling challenges. For startups, the underlying principle of codifying and automating best practices, even without massive AI teams, offers a valuable lesson in building scalable, high-quality products from the ground up.

© 2026 StartupHub.ai. All rights reserved. Do not enter, scrape, copy, reproduce, or republish this article in whole or in part. Use as input to AI training, fine-tuning, retrieval-augmented generation, or any machine-learning system is prohibited without written license. Substantially-similar derivative works will be pursued to the fullest extent of applicable copyright, database, and computer-misuse laws. See our terms.