Prompts

Every prompt I've used to check or fix an AI-built app, in one place. They're grouped by problem. Each one says when to use it and links to the post where I tested it, so you can see what happened when I ran it.

Copy them as they are. Where a prompt names something from my demo app, like a column called has_pets, swap in your own.

A prompt isn't a fix on its own. AI output varies between runs, so check the result the way each post shows you.

Before you launch

The pre-launch security review

Use when: you're about to put an app online and want an AI review that checks the usual holes, and makes you decide what's private.

Do a security review of this app before launch. Check every one of these and tell me pass/fail with the file and line:

1. Can a signed-in user change their own role or permissions anywhere (auth metadata, profile columns, API calls)?

2. For every Supabase table: is RLS on, and does every policy actually restrict rows to the right user? Treat using (true) as public.

3. Can a user update columns on their own row that they shouldn't (role, plan, price, owner)?

4. Is any user-supplied text rendered as raw HTML?

5. Which keys in the frontend are secret, and which are public by design?

6. List every column someone who isn't signed in can read, table by table. Don't decide whether that's OK. Ask me which ones should be private.

Also list anything you can't check from the code, like settings that only exist in the Supabase dashboard.

Item 6 is newer, and I haven't run it as many times as the rest. Check what it lists against what you meant to be public.

From: Cursor Told Me About the Hole. Its Security Review Still Missed It.

What can a signed-out visitor read?

Use when: you want a quick look at what your database shows to someone who isn't signed in, without a full review.

List every database table and, for each one, what someone who isn't signed in can read. Don't decide whether that's OK. Ask me which ones should be private.

From: The Welcome Email Forgot to Mention This

Can anyone download your .env file?

Use when: your app is deployed and you keep keys in a .env file.

Check whether any file starting with a dot, like .env or .git, can be downloaded from my deployed site. If it can, block it and tell me how to test that it's blocked.

If it could be downloaded, replace every key that was in it.

From: My App Had No Users. Someone Still Stole the Key.

Data strangers can read

Lock contact details to signed-in users

Use when: a public page shows people's email addresses or phone numbers that only signed-in users should see. This is the exact prompt from my demo. Change the page name and the fields to match your app.

The public Team page shows every staff member's email and phone number to anyone who isn't signed in. Visitors should only see name, job title, role badge and bio. Signed-in staff should still see email and phone. Enforce this in the database for signed-out visitors, not just in the page, and update the Team page so it only asks for those public fields when nobody is signed in. Add the database change as a new migration.

The line that matters is "enforce this in the database, not just in the page." Hiding the data on the page still leaves it one request away.

Don't paste the error's suggested fix. After this change, a signed-out request may come back with an error suggesting something like GRANT SELECT ON public.profiles TO anon;. Don't run it, and don't hand the error to your AI and accept whatever it says. A grant on the whole table opens every column again.

From: Cursor Told Me About the Hole. Its Security Review Still Missed It.

Users changing each other's data

The ownership check

Use when: your app saves changes through its own API routes or server functions, and a request includes a record ID.

Check every API route and server function that reads or changes a record using an id from the URL or request body. For each one: (1) get the signed-in user from the verified session on the server, never from the request; (2) only allow the action if the record belongs to that user (or they're explicitly allowed, like an admin checked on the server), and return 403 otherwise; (3) if the route uses the Supabase secret / service_role key, switch it to the user's own session so row-level security applies, or keep the ownership check in code and tell me why the secret key is needed. Treat "0 rows updated" as a failure, not a success. Then give me a request I can run as one user against another user's id to prove it's refused.

Then test it with two accounts of your own: as account A, try to change account B's data.

From: My Database Said No. My API Said Yes.

Cursor rule: ownership checks on every route

Use when: you build in Cursor and want it to apply the ownership check to every route it writes. Save this as .cursor/rules/api-ownership.mdc:

---
description: Ownership checks for API routes that take a record id
alwaysApply: true
---
- In any API route or server function, get the current user from the verified session on the server. Never trust a user id from the URL, query string or body.

- Before reading or changing a user-owned record by id, check it belongs to the current user (or a server-checked role allows it). Otherwise return 403.

- Don't use the Supabase secret / service_role key for user-initiated reads or writes. Use the user's own session so RLS applies. If the secret key is truly needed, keep an explicit ownership check next to the query.

- Treat 0 rows affected by an update or delete as an error.

I tested that Cursor picks this rule up. I haven't tested how much it changes the code it writes, so still run the two-account test.

From: My Database Said No. My API Said Yes.

Email sent from the browser

Four prompts, in order

Use when: your app sends email through EmailJS or another service that sends straight from the web page. Send these in the same chat where the AI built the feature, one at a time.

1. Ask the plain question.

Is this safe to put online? Could someone who isn't one of my staff use it to send emails?

2. If it offers a server-side version, take it.

Yes, do the server version.

3. Make it check its own fix.

Before I put this live, check your fix. Can anyone still send an email they shouldn't, or see anything they shouldn't?

4. Ask for only what it missed. In my test, these were the two things prompt 3 didn't catch. Change it to fit what yours missed.

Staff shouldn't be able to see employees' email addresses. And I want every email logged, even if something goes wrong.

Half this fix lives in dashboards, not code: rotate your keys and replace the old template. The post has the full list.

From: Your EmailJS Setup Can Send Phishing Emails As You

Play

Three questions for whoever built your app

Use when: someone else built your app, whether that's a contractor or an AI, and you don't want to read the code.

  1. Who fills in the "To" box: my server, or the web page?
  2. Who fills in the sender name and the reply address?
  3. Can someone who isn't logged in reach the mailroom window?

If the answers are "the page", "the page" and "not sure", you need the four prompts above.

From: Your App Leaves Signed, Blank Letterhead in the Lobby

Your whole app in one row

Is your data all in one place?

Use when: your app is built on Supabase and you're not sure how it stores its data, or one bad save once wiped more than it should have.

List every database query this app makes when a page loads, and what data each one returns. Tell me if the app stores most of its data in a single row or a single JSON column, and flag any query that returns another user's private information.

From: I Clicked Post Once. My App Deleted Everything

Play

Removing a form field

Quick: where is this field used?

Use when: you're about to remove a question from a form and want the list first.

Before removing the "[question]" field, list every page, rule, calculation and email that reads or displays it. Don't change anything yet.

From: Your AI Knows Where. Only You Know Why.

Full map, including what the AI can't see

Use when: the field might feed a price, a rule or anything in the database. Swap has_pets and the other names for your own column.

Before changing anything: list every file, query, type, component, test, email template and API call that reads, writes or displays `has_pets` (also search for `hasPets`, `pets` and `pet_`). For each one, tell me what happens for new records where the value is null. Then tell me what you could NOT check, such as database functions, triggers or third-party services. Don't edit anything yet.

The AI can't see logic that lives only in your database. The post has a read-only query that finds it.

From: My AI Removed One Form Field. It Never Mentioned the Price

Play

Make "unknown" safe before you remove it

Use when: you've decided to stop asking the question, and old records keep their answers. Fill in your question and column.

We're removing the "[question]" question from the form. Existing records keep their value. New records store null, which means "unknown", not "no". Before removing the input, update every place that reads `[column]` so that null shows "Unknown", is flagged for a person to confirm, and never gets the "no" behaviour automatically. Then remove the input. Don't drop the column. Show me each change.

From: My AI Removed One Form Field. It Never Mentioned the Price

Play

Answer these yourself first

Use when: before any of the prompts above. The AI can find where a field is used. Only you know why it's there.

  • Why did you start asking this?
  • What does it feed (fees, rules, assignments)?
  • Should that still happen?
  • What happens to the answers you already have?

Give those answers to your AI along with the request.

From: Your AI Knows Where. Only You Know Why.