Preflight

Security check for apps built with AI

Find the holes in your app before a stranger does.

Preflight is a free guide your AI coding agent follows. It hunts for the spots where one mistake could cost you money, customer data or control of your app, fixes them, and proves every fix with a test.

Paste this into your coding agentClaude Code · Codex · Cursor
Read https://zirkomirko.com/tools/preflight/agent.md and run a security preflight on this project.
  • Free, MIT licence
  • No sign-up
  • Runs on your own machine
  • 39 check modules

Scroll to watch it work

01 How to read the map

This landscape is your app.

Sign-up, payments, uploads, the database, the AI chat: everything you built sits somewhere on this ground.

  • Tall peak = big damage. The higher it is, the worse things get if someone abuses that spot. Scored 0 to 10.
  • Red = an open hole. Someone could walk in today.
  • Green = fixed, with a test that proves it.

02 The survey

First it looks. It changes nothing.

Your agent reads the project and notes what's there: database, logins, payments, hosting, secret keys. Then it tells you in plain English which of its 39 check modules apply to you, and asks permission once.

  1. Lookread-only
  2. Askone message
  3. Checkevery path traced

03 Hole one · payments

Anyone can fake a payment.

Open · 9.1 criticalFixed · test passesUnsigned payment webhook

The problem
Stripe tells your app "this person paid" by calling a web address. If the app doesn't check that the call really came from Stripe, anyone can call it and give themselves Pro for free.
How it's found
The agent follows the payment code from the web address to the database and looks for the signature check.
The fix
Verify Stripe's signature, reject repeats, and only then grant access.
The proof
A test sends a forged payment. It works before the fix and gets rejected after.

04 Hole two · customer data

Any user can read everyone's data.

Open · 8.8 criticalFixed · test passesDatabase open to every user

The problem
Row security is off on a table, so the public key inside your website can read every user's rows, not only their own.
How it's found
The agent lists every table and its rules, then writes down who can read what.
The fix
Turn row security on, with rules so each user reaches only their own rows.
The proof
A test signs in as user A and asks for user B's data. Before: it gets it. After: nothing. If the proof can't run on your machine, the agent says so instead of pretending.

05 Hole three · control

Anyone can open the admin page.

Open · 7.7 highFixed · attack blockedAdmin route trusts the browser

The problem
The admin page trusts a flag sent by the visitor's browser. Anyone can send that flag.
How it's found
Every page and API gets a row: who may call it, and where that is enforced. An empty cell is a finding.
The fix
Check the role on the server, from the signed-in session, on every admin route.
The proof
The agent replays the request as a normal user on your machine. It now gets "forbidden".

06 Your part

A few things only you can do.

Dashboards, billing settings, DNS and secret keys live outside your code. The agent can't click those for you, so it hands you a short checklist in plain words: what to change, where, and why.

  • Rotate the Stripe key that sat in git history
  • Turn on two-factor login for your hosting account
  • Set a spending limit on your AI API key

07 Cleared

Cleared for launch.

What's left is low ground you know about. The agent writes it all down: what was fixed and proven, what's still open and the risk you're carrying, and a gate that re-checks before every deploy.

74 / 74critical and high problems found
115tests added to prove the fixes
47 / 48replayed attacks now blocked

From one blind test on a practice app with 109 planted problems. Nothing is ironclad. Read the full results.

01What you get

When the run ends, this is in your project.

  1. A

    Fixes in your code

    Each one approved by you first, sorted by how bad it is.

  2. B

    A test for every critical fix

    It fails on the old code and passes on the new, so the hole can't quietly come back.

  3. C

    A plain-English report

    What was fixed and proven, what's still open, and the risk you're carrying.

  4. D

    Your checklist and a deploy gate

    The dashboard steps only you can do, and a check that runs again before every deploy.

02What it covers

39 modules. It runs only the ones your app needs.

The agent maps your stack first, then picks the modules that apply. In a hurry? Say "quick pass" for the core checks with fixes, plus a list of what it skipped.

01

Access

Who can reach whose data. Accounts, sessions, social login, hosted auth.

02

Input

Injection, server-side requests, cross-site scripting, API validation.

03

Money

Payments and webhooks, double spend, coupons, rate limits, cost abuse.

04

Data

Keys and secrets, what ships to the browser, database rules, uploads, privacy.

05

Platform

Next.js, Supabase, Firebase, Node, Django, Rails, Laravel, hosting.

06

Pipeline

Cloud settings, dependencies, CI, domain and email records.

07

AI

Prompt injection, model output handling, agents, tools and MCP.

08

Surfaces

Mobile, desktop, browser extensions, wallets, sockets and cron jobs.

03Run it

Clear your app
for launch.

One line in your coding agent. It maps, asks once, fixes with your approval and proves each fix.

Paste into your coding agentClaude Code · Codex · Cursor
Read https://zirkomirko.com/tools/preflight/agent.md and run a security preflight on this project.
  • Free, MIT licence
  • No sign-up
  • Runs on your own machine

It only works on your own project. Live sites get at most a light read of public headers, and only if you own them. Nothing is ironclad: see how it did in a blind test.

04For agents

Plain files your agent reads.

What is Preflight?

Preflight is a free, MIT-licensed set of instructions for AI coding agents. The user pastes one line into Claude Code, Codex, Cursor or a similar agent. The agent reads the guideline, maps the project, writes a short threat model, proposes the check modules that apply out of 39 (access control, logins and sessions, injection, payments and business logic, abuse and cost, secrets, database rules, Next.js, Supabase, Firebase and other platform playbooks, cloud and CI, domain and email, AI features and agents, mobile and other surfaces, operations), asks permission once, runs them, reports problems by severity in plain English, fixes what the user approves on a separate branch, adds a test for every critical and high fix that attempts the attack, replays the attack against the app running locally, and lists the manual steps only the owner can do. It works only on the user's own project and does defensive work only.

How it works

  1. Copy the one-line prompt from the page into your coding agent, inside your project.
  2. The agent lists what your project contains and asks once: may it check, prove problems on a local copy, fix them, and look at your live site.
  3. The agent reports problems by severity in plain English. Approve fixes one severity level at a time; it works on a separate branch.
  4. Each critical and high fix comes with a test that attempts the attack. You also get exact steps for what only you can do, such as replacing a leaked key.

FAQ

Is Preflight free?
Yes. The instructions, the modules, the templates and the page are free and MIT licensed.
Will it change my code?
Only what you approve, one severity level at a time, on a separate git branch or after a backup copy. Finding problems is read-only.
What does proving a fix mean?
For each critical and high fix the agent writes a test that performs the attack. The test must fail on the old code and pass on the new code, and it stays in your project.
Will it attack my live site?
No. Attack replay happens only against your app running on your own computer. With your permission it sends at most 30 ordinary requests to your live address to read headers and check a few well-known file paths.
Is this a full security audit?
No. It is a review, repair and proof pass by your AI agent, not a penetration test or a compliance audit.

See Preflight in action