← All articles
ResearchWorkflow testing

We ran 50 real incidents through AgentTwin

Fifty money-losing bugs taken from public postmortems, GitHub issues and vendor warnings, each run through the unchanged npx agenttwin. The catch rate, the false alarms and every miss.

In this article
Conceptual illustration · AgentTwin journal

Fifty bugs that cost someone money

A test tool is only as good as the bugs it catches, and a catch rate means little when the tool's makers wrote the bugs. So we collected 50 bugs from public sources: postmortems, GitHub issues, vendor documentation and forum threads. Each one charged a card twice, sent the same email again, created a duplicate record, announced something that never happened, or wiped data.

For each bug we wrote a small app twice. The buggy version has the failure the report describes. The fixed version has the fix the report or the vendor recommends. No one's code is copied. Then we ran the unchanged npx agenttwin on both, with no configuration, no hints and no per-bug setup.

A bug counts as caught when the buggy version gets a finding. A false alarm is a finding on the fixed version.

A public incident becomes two small apps, the buggy version as reported and the fixed version. Both go through the same unchanged npx agenttwin. The buggy app must get a finding (caught); the fixed app must stay quiet (no false alarm).
How each incident is scored. Illustrative test design; the measured results are in the table below.

The result

Result
Bugs caught 50 of 50
False alarms on the fixed versions 0 of 50
Fixed versions that ran to the end 50 of 50

That number needs context, and we would rather give it than have someone else point it out. The first full run of these 50 bugs caught 40 and raised 3 false alarms. We then fixed what the misses showed, and ran it again. So 50 of 50 is a score on bugs that shaped the tool, not on bugs it has never seen. The next 50 incidents will be collected and scored before we change anything for them, and we will publish that number the same way, misses included.

The library and the scoring run are part of our test suite, and the numbers above come from its latest run on 21 November 2026.

What the bugs look like

The 50 bugs fall into a few families:

Family Bugs Example source
A payment retried without its idempotency key 11 Stripe's docs on idempotent requests, a team's double-charge postmortem
A message or record sent again after a timeout or a retry 16 Mailgun's 2014 postmortem, a Buttondown incident
A webhook handled on every duplicate delivery 14 Stripe: handle duplicate events, a Shopify community thread
Success announced after a failure 2 a Craft Commerce issue, an Amazon Pay plugin issue
A database statement that touches every row 3 Fortune on the Replit incident, GitLab's 2017 postmortem
A row inserted twice, or an update that matched nothing 4 Razorpay's webhook best practices

The services involved are Stripe, Slack, Resend, Postmark, SendGrid, Twilio, HubSpot, Zendesk, Jira, GitHub, Shopify and PostgreSQL.

Why most of these pass unit tests

Nearly every bug here needs a specific state to appear: the provider saved the write but the reply was lost, the first request failed with a 500, the service stayed down, or the same webhook arrived twice. A mock answers success or failure, so it never produces "saved, but you were not told", and a unit test built on mocks cannot tell the buggy and fixed versions apart.

AgentTwin produces those states on purpose. It runs the real workflow against working copies of each service, then repeats it with each fault injected and checks what changed: duplicate records, retries without a stable key, announcements after a failed write, and every SQL statement the app sent.

What we fixed to get here

The first full run caught 40 of the 50, with false alarms on 3 fixed versions. Most misses were not missing checks. They were places where the tool could not see what happened:

  • Database checks had no statements to read. The rule that flags DELETE without WHERE, TRUNCATE and DROP was written, but the main run never passed it the statements the app sent. All three data-wipe incidents were missed until it did.
  • A timeout in the app's own code never fired. Requests routed to a twin ignored the app's AbortSignal, so AbortSignal.timeout(3000) waited forever and the retry under test never ran.
  • Twins that dropped detail. The Postmark twin's state lost a message's content when its delivery was recorded, so two identical emails looked different. The Resend twin ignored the Idempotency-Key header that real Resend honours, which made a correct fix look broken.
  • Seeds the schema refused. A seeded row missing a NOT NULL column stopped a database incident from running at all.

Each fix is generic: none of them knows about a specific bug in the library.

Every miss

On the first full run, these 10 were missed:

Bug Why it was missed Fixed by
Agent cleanup deletes every row (Replit) The seeded row lacked a required column, so the database refused it and the run never started Seed rows fill every required column from the project's schema
A table dropped to fix a mismatch The main run did not pass SQL statements to the database checks Every write statement is recorded and checked
Maintenance empties the wrong table (GitLab) Same as above Same
A cancellation that updated no row Same as above, and the request's userId did not match the seeded user_id Statements checked; userId and user_id get the same test value
An order insert retried after a dropped reply Duplicate-row checks never saw the database's tables Tables before and after the run are passed to the checks
A confirmation email for a failed payment The false announcement was only reported when it matched a clean-run check False announcements are judged from the fault run itself
A newsletter batch re-sent The Postmark twin's state lost the message content once delivery was recorded Updates are merged into the record
A batch of emails retried from the start A send inside a loop was expected exactly once Calls inside loops get no fixed count
A webhook credit applied twice A Stripe balance credit was counted as a new customer, and the running balance made two credits look different Nested resources are not parent-collection writes; running balances are ignored when comparing records
A tracker issue duplicated after restarts The Jira twin had no project, so every request was refused The project the code names is seeded

The 3 false alarms were 2 fixed versions we had written incompletely (a Slack post not guarded on redelivery, a resend with no idempotency key) and a twin gap: the Resend twin ignored Idempotency-Key, which real Resend honours.

On the current run there are no misses. When the held-out set is scored, its misses go here.

Run it on your own code

npx agenttwin

It finds the workflow, builds the twins and runs the faults locally. Nothing reaches the real services.

Frequently asked questions

Where do the 50 bugs come from?

Public postmortems, GitHub issues, vendor documentation and forum threads. Each bug links to its source in the library, and each is rebuilt as a small app; no one's code is copied.

What counts as caught?

The unchanged command reports at least one finding on the buggy version. A finding on the fixed version counts as a false alarm.

Did you tune AgentTwin for these bugs?

No per-bug rules. Fixes made while building the library are generic, such as reading SQL statements or honouring idempotency keys, and they apply to every project.

Can I see the misses?

Yes. They are listed above, with why each was missed.

Continue readingWhy AI agents delete production databases →
Evaluate one workflow

Can your workflow pass the same check after a failure?

Bring the entry point, dependency operations and result you need to preserve. Discuss whether AgentTwin supports the test, what preparation is needed and the scope and costs before proceeding.

Discuss your workflow Try the sample first →← Back to all articles