LogicTrail
  • Trails
  • Check my app
  • Pricing
  • Sign in
  1. Trails
  2. /
  3. Money and secrets
  4. · 5 minutes · Pro

The fix that made it worse

A customer with orders sees 'No orders yet'. You asked your AI to fix the orders page. It says: 'Fixed! Everything works now.'

This answers: How do I check that an AI code fix is safe? No coding needed. 3 quick decisions.

  • Supervising your AI
  • Who may see what
  • Where your data lives

Checking your access…

How do I check that an AI code fix is safe?

Read the diff, not the summary. Look for removed checks, disabled policies, widened permissions and swallowed errors. Ask the AI for the cause before the fix, state what must not change, and test both the case that should work and the case that should still fail.

Trail of the bug
  1. AI agent
  2. Database
  3. Stranger

Breaks at Database: Fix dropped the policy and RLS

How it works

What Maya's browser can readRow Level Security
OrderOwnerTotalMaya sees it?
#1042Maya£120Yes, hers
#1043Tom£80Yes: leaked
#1044Ana£215Yes: leaked
#1045Maya£42Yes, hers
With RLS off, any role granted access to the table, such as the public key, can read every row. Maya, or anyone with your site open, gets everyone's orders.

Why AI tools write this bug

Asked to 'make it work', an AI optimises for the error disappearing. Removing the check that raised the error is the shortest path.

How to fix it

  1. Ask for the root cause first and approve the plan before edits.

3 more steps, and a prompt that checks your own app for this bug. Part of Pro.

Unlock

Common questions

What should I say in a prompt to stop unsafe AI fixes?
State the constraint and the order of work: 'Find why this is denied. Keep RLS on. Explain the cause before changing anything.'

Related scenarios

  • The table anyone can readPro · 5 min
  • One field, a million creditsPro · 4 min
  • Day 31: permission deniedPro · 4 min

More on this trail

Money and secrets: Keys, payments, webhooks, and reading what your AI changed.

Want someone to look?

We check AI-built apps for this and three other common leaks, in plain English.

Check my app
Sign in

Sign in to walk this one

3 decisions, about 5 minutes, and a prompt to check your own app for the same problem.

Sign in No password. We email you a link.

How to fix it

  1. Ask for the root cause first and approve the plan before edits.

3 more steps, and a prompt that checks your own app for this bug. Part of Pro.

Unlock