ProdGuard

Guide

How do I tell if an AI coding agent broke something in my app?

Look for guards that were removed rather than features that stopped working. An agent asked to make something work will often take the shortest path, and the shortest path is frequently to delete whatever is blocking it. The app keeps working — that is the problem.

Ordinary bugs announce themselves. This class does not: the tests still pass, the page still renders, and nothing errors. A paywall that has been switched off looks exactly like a paywall nobody has hit yet.

What to look for

The changes worth grepping for

These are the ones that cost money or expose data, roughly in order of how often they show up:

ChangeWhy an agent makes it
Gate pinned open const locked = false, hasAccess = true. Asked to "show the dashboard in the demo", and the subscription check was in the way.
RLS disabled A query returned nothing, so the row-security policy got switched off instead of fixed. How to check yours.
Webhook verification removed Signature checks failed in local testing, so the check came out. How to check yours.
Admin key moved client-side A server call was awkward, so the service-role key got a VITE_ or NEXT_PUBLIC_ prefix to make it reachable — which ships it to every browser.
Email confirmation off Signup testing was slow with a confirmation step.
Auth middleware narrowed A redirect loop got "fixed" by emptying the route matcher, unprotecting everything it covered.
Reading the history

Finding it in git

If you know roughly when the agent worked, look at what it removed rather than what it added:

git log -p --since="3 weeks ago" -S "constructEvent" -- .
git log -p --since="3 weeks ago" -S "ENABLE ROW LEVEL SECURITY" -- .
git log --since="3 weeks ago" -p | grep -E "^-.*(locked|hasAccess|isPro|verify|auth)"

-S shows commits where the count of a string changed, so it finds the commit that deleted a line, which a plain search of the current code never will.

The leading - in the last command is the point: you are looking for removals. Additions get reviewed; deletions slide past, because a diff with fewer lines reads as a tidy-up.

Why review missed it

This is not a discipline problem

The usual advice — read the diff, write tests — assumes you can recognise the danger on sight. The people shipping fastest with agents are frequently not senior engineers, and a line like const locked = false does not look alarming unless you already know what locked gates.

Tests do not help either, because billing and auth are the two areas least likely to have any. A test suite that covers your UI thoroughly will pass with the paywall wide open.

Checking automatically

One command

ProdGuard reads your repository and reports this specific class of change — twelve checks, in plain English rather than security jargon, with the file and line for each:

npx prodguard check --demo   # see what it catches, without touching your code
npx prodguard check          # then run it on yours

It is free, MIT, has zero dependencies and makes no network requests. npx prodguard init adds a GitHub Action so the check runs on every pull request — including the ones your agent opens.

It reads text rather than parsing your program, so it is a safety net rather than a proof, and anything configured outside your repository — in a hosting dashboard, say — is invisible to it. The full limits are written out here.