Cloudflare enforces engineering standards using AI
TL;DR Highlight
Cloudflare turned its engineering standards into RFC/JSON for AI reviewers, blocking about 16,000 merges in four months.
Who Should Read
Platform or backend developers whose written coding and design standards aren't consistently enforced in code review.
Core Mechanics
- Standards were consolidated into one Codex
- Guidance scattered across docs, repo files, chat, and people's heads was rebuilt into one set for humans and agents.
- Domain owners are responsible for content and quality.
- Standards are RFCs with MUST/SHOULD
- Requirements use the RFC 2119 keywords, with front matter for domain and RFC status.
- Anyone can propose via merge request, and the domain owner gives final approval.
- Approved and enforced are separate states
- Approved RFCs only produce non-blocking findings.
- Only MUST violations of enforced RFCs block merges.
- The gap gives teams time to absorb new requirements.
- Statements are compacted into JSON, not fed whole
- With 60+ RFCs, the full corpus would strain the context window and hurt results.
- A dedicated agent extracts SHOULD/MUST statements into JSON with slug, level, section, and link.
- It started as Markdown and moved to JSON for more accurate filtering.
- AI code reviewer numbers
- It has flagged close to 230,000 violations since the Codex began this year.
- Almost 16,000 withheld approval because of MUST violations on enforced RFCs.
- Linters and a local CLI cover the slow review
- One AI review run usually takes a couple of minutes.
- Mechanically checkable rules go into oxlint-based linter configs that report in milliseconds.
- The same agents can run locally through a CLI.
- The same Codex reviews designs and postmortems
- The spec reviewer evaluated almost 600 designs, with findings 65% major, 29% minor, 6% critical.
- The incident report reviewer assessed 200+ reports and found gaps like missing action items and incomplete timelines.
Community Reactions
- Opinion that the post is unremarkable
- One commenter said that defining review rules like linter rules for an AI agent needs no nine-minute read.
- Opinion that the reviewer itself isn't improved
- A commenter who built a similar system said Cloudflare improves the Codex but not the reviewer model.
- They argued that loop needs closing.
- Experience that companies build their own AI review
- A W24 founder said they pivoted away from AI code review for this reason.
- They called the direction right.
- Concern about writing every standard as an RFC
- Some found that burdensome, while another commenter said it's a good thing from an SRE perspective.
How to Apply
- Turn 5 team rules into MUST/SHOULD JSON
- Pick the 5 rules most often raised in your code review comments.
- Write them as JSON with slug, level, and text.
- Paste them into the prompt below with a PR diff.
- Add approved and enforced stages to your standards
- Start new rules as advisory comments only.
- Promote them so only MUST violations block merges once the team has adapted.
- Move mechanical rules into a linter
- Pick rules the AI reviewer flags repeatedly that static analysis can catch.
- Move them into linter config for millisecond feedback.
- Apply the same rules to design docs
- Evaluate specs against the same JSON rules before implementation.
- Map MUST/SHOULD to critical/major/minor severity.
Try It
# Paste into Claude or ChatGPT (simplified version of Cloudflare's Codex approach)
You are a code reviewer. Compare the standards JSON below with the diff and report only violations.
[Standards]
{"statements":[
{"slug":"api-schemas-must-be-documented-in-openapi-spec","level":"MUST","text":"API request and response schemas MUST be documented using an OpenAPI spec"},
{"slug":"{{rule slug}}","level":"SHOULD","text":"{{your team rule}}"}
]}
[diff]
{{PR diff}}
Rules:
- For each violation, give slug, level, code location, and a fix.
- Mark SHOULD violations as non-blocking and MUST violations as blocking.
- If there are none, answer only "No violations".
Next: grow to 20 rules and count which ones trigger most often.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques