The admin key is not a fix for a policy error
grep -rhoE "eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+" . next/ dist/ | sort -u | while read t; do echo "$t" | cut -d. -f2 | base64 -d 2>/ dev/ null | grep -o '"role": "[a-z_]*"'; done
Get the free fixes for code AI gets wrong
Each one shows what the AI wrote, what it should have written, and how to check your own app
What is going on
When a policy blocks a query, the fastest thing that makes the error go away is the service-role key, which bypasses every policy. The model reaches for it. Now the browser, or an edge function that trusts the browser, owns the database. One app in the research ran 41 days like that.
Where it bit
Research only. The detection is trivial, which is what makes it a good receipt: fetch the bundle, find a JWT, decode it, read the role claim.
The practice
Service-role key in server env only. Every server route verifies the caller's JWT before it does anything as admin. A CI grep of the built bundle for any JWT whose payload decodes to service_role.
Get this check as a script you can run tonight

Make your coding agent prove it didn't cheat
Coding agents special-case, skip or edit tests so the check goes green. A five-sentence prompt Anthropic tested took Claude Opus 4 from cheating in 47% of runs to 5%- 3 min read
How to pick who fixes your vibe-coded app
Your app was built fast with AI and now something is wrong. Here is who can fix it, what they should do before they quote, the questions to ask and the red flags to walk away from - 3 min read
What an app check covers
An app check is an engineer reading the app your AI tools wrote, ranking what will break and writing the fix for each problem. Here is every area it covers, how the five days run and what you keep at the end
If this check came back with more than you expected, that is worth a conversation