AleannLab

Did Your AI Really Fix It? Checking a Security Fix Without Reading Code

AleannLab team3 min read

When your AI says "I've fixed the security issue", treat it as a claim to check, not a result. Re-run the exact test that showed the problem. Ask the AI what it changed and whether it turned anything off. Watch for the usual shortcuts: making data public, using an admin key, or hiding the problem on screen instead of fixing it on the server. You can do all of this without reading code.

On this page
  1. 1. Re-run the exact test
  2. 2. Ask what changed, in plain language
  3. 3. Ask about the shortcuts directly
  4. 4. Check it is fixed everywhere, not just where you looked
  5. 5. Get a second opinion
  6. Red flags in an AI's answer
  7. Keep a simple log
  8. When to stop trusting the loop

AI builders are trained to be helpful and to finish the task. With security, "finish" can mean "make the warning go away", which is not the same as "make the app safe". This is not the AI lying. It is optimising for what you can see.

1. Re-run the exact test

The single most useful habit. Whatever showed you the problem, do it again after the fix, the same way.

  • If User A could see User B's order at /orders/2051, log in as A and open /orders/2051 again.
  • If a secret key was visible in the website, search the Sources tab again, after the new version is published.
  • If a scanner flagged it, run the scanner again.

Make sure you are testing the new version: publish or redeploy, then hard-refresh the page (Ctrl+Shift+R, or Cmd+Shift+R on Mac).

2. Ask what changed, in plain language

code
List every file you changed and explain each change in one plain sentence.
Did you change anything that was not needed for this fix?

A good answer is specific: "Added a rule so users can only read their own rows in the orders table." A weak answer is vague: "Improved security and fixed the issue." Ask again until it is specific.

3. Ask about the shortcuts directly

These are the common ways a "fix" makes things worse. Ask every time:

code
To make this work, did you do any of these?
- turn off or loosen a database security rule
- make a table, bucket or page public
- use an admin, service or secret key
- move a check from the server to the browser
- delete or change a test
If yes, undo it and find another way.

The admin-key shortcut is the most dangerous. An app that suddenly "works" after a permission error was often fixed by switching to a key that ignores all permissions. In a Supabase app, that key in the browser hands the whole database to anyone.

4. Check it is fixed everywhere, not just where you looked

AI tends to fix the exact place you pointed at. If the same problem exists on three other pages, they may still be broken.

code
Are there other pages, actions or tables with the same problem?
List all of them, fix them the same way, and tell me how to test each.

Then spot-check at least one of the others yourself.

5. Get a second opinion

Open a new chat (or a different AI tool) with no memory of the fix, and ask it to attack it:

code
Act as someone trying to see other users' data in this app.
Look at how [orders] are loaded and protected. List every way a logged-in
user could still see or change someone else's order. Do not fix anything.

The AI that wrote the fix tends to agree with itself. A fresh session does not. Treat what it finds as things to test, not as facts.

Red flags in an AI's answer

  • "This should now be secure" with no test you can run.
  • The fix only changed what the screen shows: a button hidden, a page redirected, an error message removed.
  • The error went away right after a change to "permissions", "policies", "keys" or "environment variables".
  • New packages were added for a small fix.
  • It cannot tell you which file holds the fix.

Keep a simple log

A note per problem saves you later: what was wrong, how you tested it, what the AI changed, and the date you re-tested. When you bring in a developer or face an investor's due diligence, this is exactly what they will ask for.

When to stop trusting the loop

If the same problem comes back twice, or each fix breaks something else, or the AI keeps saying it is fixed when your test says it is not, the AI is stuck. That is the point to bring in a person. The technical version of this post is check your coding agent's security work, and if you want someone to untangle it and fix it properly, see our app rescue and security audit.

All articles →

Ready to discuss your project with us?

idea
*
*
*
I'm interested in...
Web Development
App Development
UX/UI Design
DevOps
Artificial Intelligence And Machine Learning
QA Testing
Mobile Development
Consultation
OutSource
Project budget (USD)
≤ $5K
$10K-$20K
$30K-$40K
$50K-$60K
>$100K
Upload file