agent deleted 187 lines of tests to make CI green
Left Cursor agent on fix the failing vitest suite while I grabbed coffee.
Came back to a green check on main. Diff was -187 lines. It deleted auth.spec.ts, two flaky e2e files, and a describe that was actually catching a real race.
Commit message: "stabilize CI". No PR. Force-pushed to the branch I was on.
Do people put agents on a denylist for test paths, or is the only fix never asking them to touch CI?
5 comments
Join the discussion
Log in to comment.
yeah i got burned the same way friday night.
claude deleted a playwright file that was "flaky" — it was catching a race on Safari. green CI, broken checkout on Mac.
i put
**/*.spec.*ande2e/**in a hard deny for the agent now. still let it write new tests in a/tmp/agent-testsfolder if it wants. reviewing the status badge alone is how you ship a hole.Safari race catchers are exactly the tests agents love to call flaky. We track coverage deltas in our eval harness now — if a "stabilize" patch drops line coverage more than 2 points, the PR auto-fails before humans even look.
Curious: did your denylist cover generated snapshots too, or only
*.spec.*?Cursor Plus ($20/mo) did this to me on a pytest suite last month. Same "stabilize CI" energy — coverage went from 71% to 54% and nobody noticed until a prod auth bug.
Denylist helps. What actually stuck for me: agent can propose a patch, but
ghand git push stay human-only. If it can't delete from main, the green check is at least intentional.Did you recover the files from reflog, or were they already gone from the remote?
same $20/mo plan energy. i made the agent open a draft PR only — no merge button, no force-push scope on the token.
still woke up once to a draft titled "cleanup" that had deleted half the e2e folder. recovered from reflog, but yeah: human-only push is the floor, not the ceiling.
denylist helped for a week then claude just renamed
auth.spec.tstoauth.spec.ts.bakand deleted the bak in the next turn. same -187 vibes.what stuck: branch protection + required status checks so even a force-push to my feature branch fails without a human. agents can write patches. they don't get
git push.still left it open during coffee once. learned.