# Preflight test results

Version 2.0, tested 2026-11-14. This page says what was tested, what the numbers were, and what they do not prove.

## The test

We wrote a realistic small SaaS called "Notably": Next.js, Supabase, Stripe, OpenAI, SMS and email sending, an Expo mobile app, a worker box, Terraform and two CI workflows. It runs locally against mock services. We planted 109 security problems in it: 21 critical, 53 high and 35 medium. Some are blunt (an admin API with no login). Some are subtle (a database rule that lets any user add themselves to any team, a payment webhook whose signature check falls back to trusting the message, a web page that can tell the AI assistant to email documents out, a coupon that two simultaneous requests can both redeem).

A fresh agent that had never seen the answers received two things: this guideline and the app. Consent was granted up front. It had to find the problems, fix them on a copy, write a regression test for every critical and high fix, and prove the fixes by replaying the attacks against the app running locally.

Agent: Claude Fable 5.2 in Claude Code.

## Finding

| Severity | Planted | Found | Partly | Missed |
|---|---|---|---|---|
| Critical | 21 | 21 | 0 | 0 |
| High | 53 | 53 | 0 | 0 |
| Medium | 35 | 34 | 1 | 0 |
| All | 109 | 108 | 1 | 0 |

The agent grouped these into 66 findings by root cause. It also reported real problems we had not planted on purpose. None of its findings was wrong.

## Fixing and proving

We checked the fixes ourselves, separately from the agent's own report.

| Check | Result |
|---|---|
| The agent's test suite on the fixed code | 115 passed, 0 failed |
| The same suite on the code before the fixes | 104 failed, 11 passed (the 11 check that normal use still works) |
| Our own script of 48 attacks, on the unfixed app | 48 of 48 succeed |
| The same 48 attacks on the fixed app | 47 closed, 1 reduced |

The one that is reduced, not closed: an endpoint that tells the sign-up form whether an email already has an account. It no longer reveals the plan and is rate-limited, but it still answers. Three of the 47 were confirmed by reading the fixed code, because our replay could no longer reach them over HTTP.

The agent's own tally of its 66 findings: 48 fixed and proven, 10 fixed but not provable on the test machine, 6 open in part, 2 that only the owner can do (replacing the leaked keys, and answering questions such as whether the repository is public).

**Not run anywhere:** ten fixes are file edits with no local way to execute them: the database migration with the new row rules, the CI workflows, the Terraform files, the Docker files, the Supabase auth settings and the mobile app. The agent wrote a SQL test for the migration and left it for the owner to run.

The full report from this run: [example-report.md](example-report.md).

## Compared with version 1

We also ran the first version of this guideline (12 modules, report only) on the same app, and both versions again with a mid-tier model (Claude Sonnet 5.5), report only.

| Guideline | Agent | Critical and high found | All found |
|---|---|---|---|
| v2.0 | Claude Fable 5.2 | 74 of 74 | 108.5 of 109 |
| v1.0 | Claude Fable 5.2 | 74 of 74 | 106.5 of 109 |
| v2.0 | Claude Sonnet 5.5 | 74 of 74 | 108.5 of 109 |
| v1.0 | Claude Sonnet 5.5 | 73 of 74 | 107 of 109 |

(A problem found only in part counts as half.)

## What this does and does not show

- **Finding these problems was not the hard part.** On an app this size, a capable agent that reads every file found almost everything with the old, shorter guideline too. The numbers above do not show that version 2 finds more. They show that it does not find less, and that its length did not stop either model from finishing.
- **What version 2 adds is what happens after the list:** fixes on a separate branch, a test for each serious fix that fails on the old code and passes on the new, a replay of the attack against the running app, a rotation checklist with exact steps, a `SECURITY.md`, an incident runbook and a deploy gate. Version 1 asked for none of the tests or replay. This half was run once, with one model.
- **Same author.** We wrote both the app and the guideline, so every planted problem belongs to a class the guideline names. This test shows the guideline works as written. It does not measure what it would miss in your project.
- **One run each.** Agent runs vary from one run to the next.
- **Not tested:** much larger codebases, other agents (Codex, Cursor), and stacks other than Next.js and Supabase.

It is a review, repair and proof pass by an AI agent. It is not a penetration test or a guarantee.
