breakmyapp
v0.5.0
Published
Find the bugs in your web app before your users do.
Maintainers
Readme
BreakMyApp
Find the bugs in your web app before your users do.
npx breakmyapp test http://localhost:3000BreakMyApp opens your running web application in an isolated Chromium browser, explores it the way a careful tester would, reproduces every bug it finds in a fresh browser context, and prints each one the moment it is confirmed. No account, no API key, nothing leaves your machine.
BreakMyApp 0.1.0
Target http://localhost:4310/ Browser Chromium Viewport desktop 1440×900 + mobile 390×844
0:01 / 10 links
0:01 /signup 10 links, form: Name, Email, Password
0:04 ✗ HIGH Submitting the "Sign up" form on /signup with an apostrophe fails: POST /api/signup → 500
POST /api/signup → 500
repro: /signup → fill Name "O'Brien" → fill Email "o'[email protected]" → fill Password "O'Brien1!" → click "Sign up"
0:11 ✗ HIGH Loading /reports fails: GET /api/reports → 500, then throws TypeError: reports.map is not a function
0:23 ✗ HIGH Selecting "Archived" for Show on /dashboard throws TypeError: Cannot read properties of undefined (reading 'length')
repro: /dashboard → select Show "Archived"
0:27 mobile 390×844: /, /signup, /login, /settings, /pricing, /dashboard
0:38 ✗ MED "Start free trial" on /pricing cannot be tapped on mobile because div.banner covers it @ mobile
0:40 done
Results 10 pages · 30 interactions · 40s
5 high · 5 medium · 0 low · 0 suspected · 2 accessibility
Score 15 / 100 (coverage: 10 pages, 30 interactions)
Report ./breakmyapp-results/latest/index.html
Findings ./breakmyapp-results/latest/findings.json
Tests ./breakmyapp-results/latest/tests/*.spec.ts
Then hand findings.json to Claude Code or Codex, or let it drive BreakMyApp
itself over MCP, and watch the exported Playwright tests turn green.
Post a finding as a card:

Website: breakmyapp.ai, served from site/ by the
render.yaml Blueprint. The report above and the terminal replay on the site
are real runs against fixtures/broken.
What it finds
The deterministic engine explores pages breadth-first, starting with the landing page, signup and login, primary navigation, and forms, and it reports:
- Unhandled JavaScript exceptions on load and after interactions
- Failed requests to your own origin, including API calls the page does not handle
- Broken internal links, server errors, and redirect loops
- Forms that fail on realistic input such as an apostrophe in a password
- Forms that accept an invalid email address
- With
--allow-writes: a form that says it saved and shows the old value again after a reload, and a form that one Enter submits twice - A page that breaks on the next visit because of what a click or a choice left in local storage or a cookie
- A drag that fails, such as a reorder the server refuses
- A confirm dialog that carries out its action when it is dismissed
- On a phone-sized screen: horizontal overflow, primary controls covered by other elements, a navigation button that does not open the menu, and the same exceptions and failed requests behind the buttons, selects, and forms that only a phone shows
- With
--a11y, accessibility violations from axe-core, reported separately and never counted in the score
Every finding is reproduced in a fresh browser context before it is reported. A finding that does not reproduce is listed as suspected and never counts against the score. The summary, the report, and the badge say how many there are, so a run with a suspected finding does not read as a clean run.
With --allow-writes a run may sign up for an account and find bugs behind
the login. An application accepts an email address once, so a replay of steps
that signed up types an address of its own, and a replay of a failure behind
that login signs up for a new account first. A failure on the page of a record
the run created keeps the steps that created the record, so a replay creates
one of its own. A record the steps create has another number in each replay,
so a step that opens it by its address, such as /projects/4, opens it where
the link or the step that led to it does. Only a failure that none of these
shows is replayed with the run's cookies; the report says what confirmed a
finding.
How to read a finding
Each finding leads with its proof, so you can judge it without opening a trace:
- Proof. What was expected beside what the replay saw, such as
Expected: Save is disabled until a field changes. After the steps, the button "Save" was enabled, and right before the last step, the button "Save" was disabled.The value comes from the same check that confirmed the bug, read once more after the replay. - Why it is suspected. For a finding no replay confirmed: how many
replays ran, how each ran, and what the page held instead, such as
the page did not show "Overdue". A check that already held before the last step, a step that could not run again, and a failure that did not come back each say so, which tells you whether to rerun or dismiss it. - Why this is a bug. One sentence on why the expected behavior is right, and what it rests on: text on the page, a convention such as HTML validation, or another page of the same app that behaves differently. The AI agent must give one with every hypothesis; a crawler finding carries the rule of its check.
- The marked screenshot. The screen cropped to the element the check is about, or the control the last step used, with a box around it. The whole screen follows.
- The key line. The console message or request the check is about comes first; the other lines are folded.
Severity
Severity follows one rule per impact. The AI agent names the impact and the severity follows from it; the crawler's checks use the same rules.
| Impact | Severity | When | | --- | --- | --- | | Data loss | critical | Saved data is lost, changed, or shown to someone who should not see it, such as a form that says it saved and shows the old value after a reload. | | Blocked task | high | A main task cannot be finished, or the app does something the user did not ask for: a page or request fails, a save is refused, a dismissed confirm dialog goes ahead. | | Wrong information | medium | The page shows a wrong value, total, date, or message, or a secondary feature misbehaves, such as a form that accepts an invalid email address or a control a phone cannot reach. | | Cosmetic | low | A minor problem that changes nothing the user learns or can do, such as a console error with no visible effect or a third-party script that fails. |
To disagree with a severity, point at the rule. To leave a finding out
altogether, use breakmyapp ignore.
What you get
Each run writes to ./breakmyapp-results/<run-id>/, with latest pointing at
the newest run:
index.html: a standalone report with filters, screenshots, reproduction steps, console and network evidence, and an exploration map. No external fonts or scripts.findings.json: a versioned, schema-validated file for coding agents. Each finding says what is broken, how to reproduce it, what evidence supports it, and what correct behavior looks like.tests/BMA-0001.spec.ts: one Playwright test per confirmed finding. It runs the same check that confirmed the bug, so it fails today and turns green when the bug is fixed.fixes/BMA-0001.md: a fix brief per confirmed finding for a coding agent: expected and actual, the proof and why it is a bug, the steps, the saved check, the key console and network lines, the screenshots, likely source locations, and the verify command.screenshots/andtraces/: a screenshot and a Playwright trace per finding, and a marked screenshot cropped to the element of each confirmed one.cards/: 1200×675 PNG cards fromnpx breakmyapp card, made to post.
Fix a finding
Every confirmed finding saves the check that confirmed it: text the page shows, the address the steps end on, an error the page throws, the status of a request, a responsive layout check, the state of an element (enabled, hidden, checked, focused, ...), how many elements the last step adds, or the value a field holds. The AI agent can combine several, and all must hold. Before it confirms an agent's check, the replay also looks right before the last step: if the check already holds there, the last step did not cause the bug, and the finding stays suspected. Two commands use the check.
npx breakmyapp fix BMA-0003 # write fixes/BMA-0003.md and start Claude Code with a two-line prompt
npx breakmyapp verify BMA-0003 # replay the steps and run the saved checkverify replays the steps in a fresh browser with BreakMyApp's own Playwright,
so your project needs no Playwright install. It exits 0 when the bug is fixed,
1 when it still shows, and 2 when the steps no longer run, for example because
the app is down. --url http://localhost:5173 replays against another origin,
such as a dev server on a new port. --run <run-id> picks a run other than
the latest.
fix writes the brief and hands a two-line prompt that names it to an agent:
Fix BreakMyApp finding BMA-0003: Selecting "Archived" for Show on /dashboard throws TypeError.
Read breakmyapp-results/2026-11-07_12-00-00/fixes/BMA-0003.md, make the smallest fix, then run `npx breakmyapp verify BMA-0003 --run 2026-11-07_12-00-00` until it exits 0.--agent picks where the prompt goes: claude (Claude Code in this
terminal), codex (Codex CLI in this terminal), vscode (a Claude Code tab
in VS Code), copy (the clipboard), or none (print the prompt only).
Without it, fix uses the agent this project used last; a project's first fix
goes to Claude Code when claude is on the PATH, and to the clipboard
otherwise. The last agent is kept per project in your cache
(~/.cache/breakmyapp/agents.json), not in the repository. fix --all hands
over every confirmed finding in one prompt, highest severity first.
Fix with no one at the keyboard
npx breakmyapp fix --all --headless # one branch, one agent run, verify, and one pull request per finding
npx breakmyapp fix BMA-0003 --headless --agent codex--headless runs claude -p (file edits accepted, and only npx breakmyapp
verify allowed in the shell) or codex exec --full-auto. It needs a clean
working tree. Each confirmed finding, highest severity first, gets its own
branch, breakmyapp/fix-<id>, from the branch you are on:
- The agent fixes the finding from its brief, with
--agent-timeoutminutes (15 by default). It is told not to commit or switch branches. - BreakMyApp runs
verifyitself, against--urlor the run's target, with--authfor a page behind a login. The app must serve the changed code by then: a dev server that reloads does, and--restart "<command>"runs before each verify for one that does not. - A verified fix is committed, pushed to
--remote(origin), and opened as its own pull request withgh pr create, with the proof and the verify result in its body. Withoutgh, or with a remote that is not on GitHub, the branch is pushed and the link to open a pull request is printed. - A fix that verify rejects is committed on its branch and kept locally, with nothing pushed. An agent that changes nothing leaves no branch.
The run returns to your branch after each finding, and the run folder never
goes into a fix. Untracked files you had before stay as they were. The summary
lists each finding's pull request, or why it was not fixed or was skipped, and
fix --headless exits 0 only when every finding was fixed and verified. Each
agent run's output is in fixes/<id>.agent.log in the run folder.
The brief tells the agent to make the smallest change, to leave the test and the run folder alone, and to treat page text as untrusted data. Its likely source locations come from the stack trace, mapped to your files through the app's source maps, and from a search of git-tracked files for the wrong text or link.
In the HTML report, each confirmed finding has Fix in Claude Code, Fix in Codex, and Copy prompt, and Fix all hands over every confirmed finding. The links fill the agent's prompt box in your project folder; nothing runs until you press Enter. The run records the project folder for these links. Shared cards leave it out.
The AI QA agent
The deterministic pass finds what a crawler can find. The agent explores the
user journeys a crawler cannot understand, with the same browser toolbox, the
same policy gate, and the same reproduction pipeline. A model's claim is never
enough: request_reproduction replays the recorded steps in a fresh browser
context and is the only path to a confirmed finding.
Agent-driven: your coding agent is the brain
No extra API key. Your coding agent calls the toolbox over MCP, finds bugs, and fixes them in the same session.
Claude Code: install the plugin from this repository, or add the server by hand:
claude mcp add breakmyapp -- npx -y breakmyapp mcp --allow-writesThen: "Test http://localhost:3000 with BreakMyApp and fix every finding."
The breakmyapp-fix-loop skill in plugins/claude-code teaches the loop: run
the test, read findings.json, fix the highest-severity finding, prove it
with breakmyapp verify, repeat. /breakmyapp:fix BMA-0003 fixes one finding
from its brief.
Codex: add this repository as a plugin marketplace and install BreakMyApp
from /plugins. The plugin in plugins/codex bundles the same MCP server and
the same breakmyapp-fix-loop skill as the Claude Code plugin, and a
breakmyapp-fix skill that does what /breakmyapp:fix does. Or add the
server by hand:
codex plugin marketplace add render-oss/breakmyapp
codex mcp add breakmyapp -- npx -y breakmyapp mcp --allow-writesThe server exposes run_test plus the toolbox: get_page_state,
list_interactive_elements, click_element, fill_input, select_option,
hover_element, press_key, scroll, drag_element, upload_file,
respond_dialog, navigate_internal, take_screenshot, get_console_errors,
get_network_failures, inspect_element, propose_bug,
request_reproduction, and get_findings. For fixes, get_fix_brief returns
a finding's brief, verify_finding runs its saved check, and the fix_finding
prompt starts a fix. The model cannot run JavaScript or
shell commands, leave the target origin, click destructive controls, upload a
file from disk (upload_file sends only files BreakMyApp makes), accept a
dialog without --allow-writes, or exceed the action budget. Without
--allow-writes, a hover, key, scroll, drag, or upload cannot save: its
state-changing requests are blocked.
npx breakmyapp mcp --url http://localhost:3000 --allow-writes # or omit --url and pass a full URL to run_testbreakmyapp mcp takes --allow-deletes too, keeps a writes.json ledger in
its run folder, and needs writeOrigins for a remote origin with
--allow-writes, as test does. It has no --setup or --teardown: the
session lasts as long as your agent, so create and remove the test account
around it yourself. --browser firefox or --browser webkit runs the
session in that engine; verify and replay always use the engine that
recorded the finding.
Standalone: BreakMyApp's own loop
For CI and for people without a coding agent:
ANTHROPIC_API_KEY=... npx breakmyapp test http://localhost:3000 --ai anthropic
OPENAI_API_KEY=... npx breakmyapp test http://localhost:3000 --ai openai--ai auto (the default) uses Anthropic when ANTHROPIC_API_KEY is set,
OpenAI when only OPENAI_API_KEY is set, and otherwise runs the deterministic
pass only. --ai none disables it. The agent
runs after the deterministic pass, starts from its map of the app, and prints
its findings live like any other.
The agent uses two models. The exploring model drives the browser on every
step, so it is a cheap one: claude-haiku-5-5 for Anthropic and gpt-6-luna
for OpenAI. The reviewing model gets one call for each propose_bug, with the
hypothesis, the steps, the page text, and the console and network failures. It
rejects a weak hypothesis before a replay is spent, such as one whose
why_expected rests on no text on the page, convention, or other page of the
app, and it sharpens the assertion, for example to the exact error text on the
page, and corrects the impact by the severity rubric. The first time the
agent opens a page, at most 20 pages per run, the reviewing model also reads
the page once and returns up to three leads to check there, such as two price
ranges that overlap. It is the stronger model: claude-opus-5-5 for Anthropic
and gpt-6.1-sol for OpenAI. If a review fails, the hypothesis goes on as
proposed, and the replay still decides.
--ai-model sets the exploring model (--model is the same flag), and
--ai-review-model sets the reviewing model or turns the review off with none.
When it finishes, one line reports the models, the steps and actions, the
reviews, the tokens, split into input, cached input, and output, and the
estimated spend with the dollars per confirmed finding beside it, so a cheap
run that confirms nothing does not look like a win. The HTML report shows the
same line. --ai-max-cost stops exploration at a dollar amount for both models
together, 5 by default, using a built-in price table for Anthropic and OpenAI
models. For a model with no known price the cap cannot be enforced, the run
says so, and the token cap still applies. findings.json carries the numbers
under summary.agentTokens, summary.agentCostUsd, and
summary.agentConfirmed. When exploration stops on an error, such as refused
credentials, the run keeps the deterministic findings, warns, and records the
error in summary.agentError. Other defaults: 60 model steps, 60 browser actions,
400,000 tokens not served from the prompt cache. Change them with
--ai-max-steps, --ai-max-actions, and --ai-max-tokens. Anthropic requests use
the server-side refusal fallback so a declined request continues on a fallback
model. OpenAI requests use the Responses API with store: false, so OpenAI
keeps no copy of the page summaries.
Three rules keep each step small. An element list sends only what changed: a
button or link sent on the same page in the last four turns keeps its ref and
is left out, and so are links already listed on another page, such as the site
navigation. The rest comes ranked, pages not visited first and destructive
controls last, and the agent asks for more with match or full. A console or
network failure already reported in the session is counted, not repeated. Both
providers serve repeated context from the prompt cache. Above 60,000 tokens of
context, at most once every 20 turns, old tool results are elided, and on
Anthropic a second cache breakpoint keeps the unchanged part of the transcript
cached, so a compaction rewrites only the turns since the last one.
The agent receives redacted, structured page summaries, never raw pages, cookies, or headers. Page text is treated as untrusted data.
Install and run
npx works from most projects. It reads the package.json of the directory
you run it in, so inside a project whose own dependencies npm refuses to
resolve, for example an overrides entry that conflicts with a direct
dependency, npm stops with EOVERRIDE before BreakMyApp starts. Any of these
avoid that:
bunx breakmyapp test http://localhost:3000 # Bun
pnpm dlx breakmyapp test http://localhost:3000 # pnpm
npx --prefix "$TMPDIR" breakmyapp test http://localhost:3000
npm install -g breakmyapp && breakmyapp test http://localhost:3000Node 22 or newer. The first run downloads Chromium for Playwright.
Commands
npx breakmyapp test <url> # explore and test an application
npx breakmyapp report [run-id] # open the HTML report (defaults to latest)
npx breakmyapp verify BMA-0001 # replay a finding and run its saved check: exit 0 fixed, 1 still broken, 2 steps no longer run (--auth for a page behind a login)
npx breakmyapp fix BMA-0001 # write the fix brief and hand it to a coding agent (--agent claude|codex|vscode|copy|none)
npx breakmyapp fix --all --headless # fix each finding on its own branch, verify it, and open one pull request per verified fix
npx breakmyapp replay BMA-0001 # rerun a finding's steps in a visible browser
npx breakmyapp ignore BMA-0001 --reason "…" # leave a finding out of the counts, score, and fail-on in every run (writes .breakmyapp/ignore.json)
npx breakmyapp card BMA-0001 # render a finding as a 1200×675 PNG card (--all for every confirmed finding)
npx breakmyapp badge # write .breakmyapp/badge.json and print the README badge markdown
npx breakmyapp mcp # serve the toolbox over MCP for your coding agentCompare with an earlier run
--baseline labels each finding against an earlier run, so a change shows
what it changed and not every bug the app already had:
npx breakmyapp test http://localhost:3000 --baseline latest| Label | Meaning | | --- | --- | | new | The baseline does not have it | | still open | Both runs have it | | fixed | The baseline confirmed it, this run did not see it, and its saved check no longer holds when its steps are replayed against this run's target | | flaky | The baseline confirmed it and this run only suspects it |
Two findings are the same bug when they have the same signature, or, for a finding whose signature changed (an AI finding is named in the model's words), the same page pattern, viewport, and saved check. The comparison leaves out what differs between runs of the same app: the origin, so a preview address can be compared with another, the run's tag in synthetic data, and record numbers in addresses.
A confirmed finding of the baseline that this run did not see is replayed with
the same check as breakmyapp verify, at most 25 of them, signed in with this
run's --auth or --setup storage state. One whose check
still holds is still open, because this run did not reach it. One that cannot
be replayed, such as steps that submit a form in a run without
--allow-writes, is listed as not checked, never as fixed.
--baseline takes latest (the run before this one), a run ID under
--out, a run folder, or the path of a findings.json, such as a report
downloaded from CI. The terminal summary, the report, and findings.json
(summary.changes, baseline, and each finding's change) carry the result.
To accept a finding for good, ignore it:
npx breakmyapp ignore BMA-0004 --reason "Known hydration warning from the CMS embed"This writes .breakmyapp/ignore.json in the project folder, keyed by the
finding's signature, for the team to commit. Every later run, the GitHub
Action, and run_test over MCP read it. Ignored findings stay in the report,
folded, with their reason, and leave the counts, the score, fail-on, the PR
comment, and fix --all. --remove takes a finding off the list.
Share a result
npx breakmyapp card BMA-0001 renders the finding as an image with the title,
severity, screenshot, one-line repro, and the score with its coverage. The card
shows the route only; pass --show-url to include the full target URL.
npx breakmyapp badge writes .breakmyapp/badge.json in shields.io endpoint
format and prints the markdown. Commit the file and the badge reads from your
repository; there is no hosted service. A clean run reads "0 bugs · 18 pages", and a run that confirmed nothing but has a
suspected finding reads "0 bugs · 1 suspected · 18 pages".
The badge always carries its coverage, because a score without coverage means
nothing.
GitHub Action
Test a preview deployment on every pull request and keep one PR comment up to
date with the score, coverage, and top findings. Each confirmed finding comes
with a fix prompt in a code block, because GitHub strips custom link schemes.
When the workflow also runs on pushes to the base branch, the Action compares
each pull request's run with the latest run there, and the comment shows new
and fixed findings first. fail-on: new-high then fails only on high or
critical findings that the pull request brought, so a bug already on the base
branch does not block an unrelated change. See action/README.md.
- uses: render-oss/breakmyapp/action@main
with:
url: https://pr-${{ github.event.pull_request.number }}.example.com
fail-on: new-highFlags for test:
| Flag | Default | Meaning |
| --- | --- | --- |
| --max-pages <n> | 25 | Stop after this many pages |
| --max-actions <n> | 100 | Stop after this many clicks, fills, and submits |
| --max-depth <n> | 4 | Do not follow links deeper than this |
| --timeout <seconds> | 300 | Stop the crawl after this many seconds. AI exploration is capped by the --ai-max-* flags instead |
| --a11y | off | Run axe-core accessibility checks and list the violations in the report |
| --unlimited | off | No cap on pages, actions, depth, or time. --timeout still applies when you pass it; the AI cost cap always applies |
| --viewport <name> | both | both runs the desktop pass, then revisits a subset at 390×844; or desktop, or mobile |
| --browser <name> | chromium | Browser engine: chromium, firefox, or webkit. Install the engine first with npx playwright install <name> |
| --auth <file> | | Playwright storage state for an authenticated session |
| --ai <provider> | auto | auto, anthropic, openai, or none |
| --ai-model <id> | claude-haiku-5-5 or gpt-6-luna | Exploring model that drives the browser. --model is the same flag |
| --ai-review-model <id> | claude-opus-5-5 or gpt-6.1-sol | Reviewing model that checks each proposed bug before its replay, or none |
| --ai-max-steps <n> | 60 | Model turns in AI exploration |
| --ai-max-actions <n> | 60 | Browser actions in AI exploration |
| --ai-max-tokens <n> | 400000 | Token cap for the AI provider, not counting prompt-cache reads |
| --ai-max-cost <usd> | 5 | Stop AI exploration when the estimated spend of both models reaches this many dollars |
| --allow-writes | off | Submit state-changing forms such as signup with synthetic data. A remote origin must be in writeOrigins in breakmyapp.config.json |
| --allow-deletes | off | With --allow-writes, click delete controls on records this run created and listed in writes.json |
| --setup <command> | | Shell command that runs before the crawl and writes a storage state for a fresh test account to $BREAKMYAPP_STORAGE_STATE |
| --teardown <command> | | Shell command that runs after the report is written, also when the run fails or is interrupted |
| --out <dir> | ./breakmyapp-results | Output directory |
| --baseline <run> | | Compare with an earlier run: latest, a run ID, a run folder, or a findings.json. See Compare with an earlier run |
| --json | off | Print findings.json to stdout when done |
| --headed | off | Show the browser |
| --yes | off | Accept the authorization prompt for a remote origin, for CI |
| --ignore <pattern> | | Leave out failed requests whose URL matches this substring or glob. Repeatable, comma-separated |
| --no-footer | | Omit the BreakMyApp footer from the HTML report |
| --verbose | off | Print skipped actions |
Without --allow-writes, BreakMyApp fills forms but only submits ones that
cannot change state (GET and search forms). Use --allow-writes against a
local or disposable environment to test signup, create, and settings forms
with bounded synthetic data. To test create, edit, and delete flows on a
staging app, see Safe writes on staging.
Noise
A request that fails on every page is one finding, recorded on the first page that hit it, with the other pages listed under "Also seen on". Failures caused by an interaction stay specific to the page and the control.
Analytics, consent, tag-manager, monitoring, and support vendors (Segment, Osano, Google Tag Manager, Hotjar, Intercom, Sentry, and about thirty more) are recognized by host and by path, so they count even when they are proxied through your own origin. A failing vendor request is rated low, grouped per vendor, and explained as what it usually is: an ad blocker, a network policy, or a development proxy.
For anything else you do not want to see, pass --ignore:
npx breakmyapp test http://localhost:3000 --ignore "/seg/*" --ignore osanoThe pattern is matched against the full URL and its path, as a substring or a
glob with * and ?. The Action takes the same list in its ignore input, and
breakmyapp mcp accepts --ignore too.
Live websites
BreakMyApp tests any origin you are allowed to test, not only localhost:
npx breakmyapp test https://staging.example.comA remote origin asks one question first: confirm you own it or have
permission. --yes answers it in CI. Private-network addresses other than
localhost are refused.
Against a live site, leave --allow-writes off. State-changing forms are then
filled but never submitted, and nothing that looks destructive or financial is
ever clicked, so the run reads and navigates but does not create accounts,
orders, or messages. Requests are sequential with short waits, and
--max-pages, --max-actions, and --timeout bound the run. A cookie banner
or a login wall is just a page to BreakMyApp; pass --auth with a Playwright
storage state to test behind a login.
Testing behind a login
--auth takes a Playwright storage state file: the cookies and localStorage of
a signed-in session. Make one with Playwright's codegen:
npx [email protected] codegen --save-storage=auth.json https://app.example.comLog in by hand in the window that opens, then close it. Playwright writes
auth.json. Pass it to the run:
npx breakmyapp test https://app.example.com --auth auth.jsonThe file holds live session cookies. Keep it out of version control and delete
it when you are done. Writes stay off unless you pass --allow-writes, so an
authenticated run reads and clicks but never submits a form in the account.
Safe writes on staging
Create, edit, and delete flows are where product bugs concentrate. To test them without harm, give each run a disposable test account and remove it afterwards:
npx breakmyapp test https://staging.example.com --yes \
--allow-writes --allow-deletes \
--setup "node scripts/bma-setup.mjs" \
--teardown "node scripts/bma-teardown.mjs"Allow the origin.
--allow-writesagainst a remote origin needs that origin in a committedbreakmyapp.config.json, so a typo cannot point writes at production. Local origins need no entry.{ "writeOrigins": ["https://staging.example.com"] }BreakMyApp reads the file from the folder you run it in. Without the entry the run stops before it sends a request.
Setup runs before the crawl. It creates a fresh test account, for example through your app's own API, and writes that account's Playwright storage state to
$BREAKMYAPP_STORAGE_STATE. The run then tests as that account. The file is in a private temporary folder, not in the run folder, and is deleted after teardown.--setupreplaces--auth.The write ledger. Every POST, PUT, PATCH, and DELETE that the run sends to the target origin goes to
writes.jsonin the run folder, with the status and the record ID from the response body, theLocationheader, or the request path. A successful POST to a collection that answers with a new ID is marked"created": true, with the record as"items/17".Tagged data. Synthetic names, emails, titles, and free text carry the run tag, such as
Test title bma-7f3a1cor[email protected], so leftovers are easy to find. The AI agent gets the same tagged values when it callsfill_inputwithout a value, and is told to put the tag in values it writes itself.Deletes stay separate.
--allow-deletespermits a delete control only on a record the run created: a link or form address in the control's row or card, or the page address when the control is on the record's own page, must name a record listed as created in the ledger, such as/items/17. Everything else that looks destructive stays blocked, and financial controls (pay, checkout, transfer, billing, and similar) are never clicked. The crawler deletes after it has finished crawling, so the run's records are edited before they are deleted.Teardown runs after the report is written, also when the run fails, when setup fails, or on Ctrl-C, including Ctrl-C while setup still runs. It removes what is left, using the ledger at
$BREAKMYAPP_WRITES. A teardown that exits with a code other than 0 makes the run exit with 1.
Both commands run in a shell with these variables:
| Variable | Value |
| --- | --- |
| BREAKMYAPP_URL, BREAKMYAPP_ORIGIN | The target URL and its origin |
| BREAKMYAPP_RUN_ID, BREAKMYAPP_RUN_TAG | The run ID and the data tag, for example bma-7f3a1c |
| BREAKMYAPP_RUN_DIR | The run folder |
| BREAKMYAPP_STORAGE_STATE | Where setup writes the storage state, and where teardown reads it |
| BREAKMYAPP_WRITES | The write ledger, writes.json |
A ledger entry:
{ "at": "2026-11-07T20:34:38.371Z", "method": "POST", "url": "https://staging.example.com/api/items",
"status": 201, "id": "17", "record": "items/17", "created": true }fixtures/writes has a complete example: a small app with a seed endpoint,
setup.mjs, and teardown.mjs.
Safety and scope
- Only the exact origin you pass is tested. External links, embedded content, and redirects to other origins are never followed.
- Localhost needs no confirmation. Any other origin asks one question: confirm
you own it or have permission.
--yesanswers it in CI. - Private-network addresses other than localhost are refused.
- Buttons whose label suggests a destructive or financial action (delete, pay,
checkout, and similar) are never clicked. The one exception is
--allow-deletes, which permits deleting records the run itself created. Links get the same rule from their text and short path segments, so<a href="/items/17/delete">is never followed, with or without--allow-deletes. - The crawler dismisses every confirm dialog. If the page sends a state-changing request to its own origin after that, the request is held back before it reaches the server, and reported.
--allow-writesagainst a remote origin needs that origin inwriteOriginsinbreakmyapp.config.json.- Requests are sequential with short waits. There is no fuzzing, no credential testing, and no load generation.
- BreakMyApp is not a security scanner and does not find every bug.
Privacy
Reports, screenshots, traces, and findings stay on your machine. The CLI makes
no network request except to the target you name and, with --ai anthropic
or --ai openai, to that provider.
Telemetry is off until you say yes. After the first run, once the report path
has printed, the CLI asks one question. It never sends the target URL, finding
content, or screenshots; the exact payload is in
docs/telemetry.md. BREAKMYAPP_TELEMETRY=0 or CI=true
disables it without a prompt. The endpoint that receives it is in
telemetry/; it refuses any field that is not documented and stores no IP
address.
Before anything is written to disk, authorization headers, cookies, bearer tokens, URL credentials, and common secret-bearing query parameters are redacted. Screenshots and traces can still contain personal data from the application under test. Treat the results directory as private.
Troubleshooting
npm error code EOVERRIDEor anengineserror fromnpx. npm is validating the project you are standing in, not BreakMyApp. Usebunx,pnpm dlx,npx --prefix "$TMPDIR", or a global install, as above.Cannot reach http://localhost:3000. The app is not listening on that port. Start it first, and check the port it printed.- Everything is suspected, nothing confirmed. The failures did not happen again in a fresh browser context. State, timing, or data changed between the first run and the replay. Rerun, and read the reproduction notes in the report.
verifysays the saved cookies no longer sign in. The finding was confirmed with the cookies of the run's own account, and that session has expired or the database was reset. Runbreakmyapp testagain.- The MCP server does not start from a project. Same cause as the first
item. Install globally and set the server command to
breakmyapp.
Limitations in this release
- The mobile pass revisits up to six pages, not every page. On each it runs
the responsive checks, axe-core with
--a11y, and the same button, select, and form interactions as the desktop pass, within the same--max-actionsbudget. When the desktop pass spends the budget, the mobile pass only runs the checks. --browser webkitruns Playwright's WebKit build. It comes from the same source as Safari but is not Safari, so a bug that shows only in Safari can still pass.- The benchmark harness is in
benchmark/, but only two generated apps are committed and no results are reviewed yet, so the benchmark table on the site is empty.
Development
npm install
npx playwright install chromium firefox webkit
npm run fixture:broken # http://127.0.0.1:4310, every known defect class
npm run fixture:healthy # http://127.0.0.1:4311, zero defects
npm run dev -- test http://127.0.0.1:4310 --allow-writes
npm test
BMA_BROWSER=firefox npm run test:browser # or webkitBMA_BROWSER picks the engine for the browser tests. BMA_PORT_OFFSET
moves the fixture ports, so two suites can run at the same time.
fixtures/broken holds the defects the engine must find; the test suite
checks each one by title, severity, and category. fixtures/healthy must
produce zero findings and guards against false positives. Grow the healthy
fixture first when a user reports noise.
The repository structure follows SPEC.md: src/cli, src/core,
src/browser, src/explorer, src/detectors, src/findings, src/report,
src/agent, src/fix, src/mcp. The reporting layer consumes typed artifacts and does
not import Playwright. The agent tests use a scripted provider and a scripted
MCP client, so they need no API key.
Contributing and security
See CONTRIBUTING.md for setup and the two rules every change follows, and SECURITY.md for what BreakMyApp protects and how to report a problem. docs/architecture.md explains how a run flows through the code.
License
Apache 2.0. See LICENSE.
