AleannLab

Security Prompts for Lovable, Bolt, Cursor and Replit: What to Ask Your AI

AleannLab team2 min read

"Make my app secure" gets you a reassuring answer and little else. Prompts that work are specific, ask for a list rather than a verdict, and require evidence: which table, which page, which test proves it. Below are prompts you can copy into Lovable, Bolt, Replit, Cursor or Claude Code, grouped by what they check, plus the follow-up questions that stop your AI from just saying "done".

On this page
  1. How to prompt for security
  2. 1. Data access
  3. 2. Pages and actions
  4. 3. Keys and secrets
  5. 4. Payments
  6. 5. Sign-up, login and password reset
  7. 6. Uploads and user content
  8. 7. AI features inside your app
  9. Prompts that keep the AI honest
  10. Use the built-in scanners too

You do not need to understand every word of the answers. You need answers that are concrete enough that you, or someone you hire, can check them.

How to prompt for security

Three habits make a big difference:

  1. Ask for an inventory first, fixes second. "List" before "fix". A list shows you what the AI thinks exists, and you can spot what is missing.
  2. Ask for evidence. "Show me the rule", "tell me how to test it", "what would a user see if...".
  3. One topic per prompt. A giant "check everything" prompt gets a shallow pass over everything.

And one habit to drop: do not accept "Your app follows security best practices." Ask "which ones, where, and how do I check?"

1. Data access

code
List every database table in this app. For each one, tell me:
- what kind of data it holds
- who can READ rows (everyone, any logged-in user, only the owner, only admins)
- who can CREATE, UPDATE and DELETE rows
- whether access is enforced in the database itself or only hidden in the interface
Use a table. Do not change anything yet.

Follow-up when something looks wrong:

code
For the [orders] table, change the rules so a logged-in user can only read and
change their own rows, and nobody who is not logged in can read anything.
Then tell me exactly how to test this with two accounts.

2. Pages and actions

code
List every page and every server action or API endpoint in this app.
For each, tell me who is allowed to use it, and where in the code that is
checked ON THE SERVER. If something is only protected by hiding a button or
redirecting in the browser, mark it clearly.
code
Check every place where the app loads a record by an ID from the URL or a
form (for example /invoice/123). Make sure it only returns the record if it
belongs to the logged-in user, and returns "not found" otherwise.
List what you changed.

3. Keys and secrets

code
List every API key, secret and environment variable this app uses.
For each: what service it is for, whether it is safe to be visible in the
browser, and where it is used (browser or server). Flag any secret key that
is used in browser code or written directly in a file.

If anything is flagged:

code
Move [the OpenAI call] to the server so the key is never sent to the browser.
Then tell me which keys I need to replace (rotate) at the provider because
they were exposed, and where to do that.

4. Payments

code
Walk me through the payment flow step by step. Where is the price decided:
in the browser or on the server? How does the app learn that a payment
succeeded? Is the Stripe webhook signature verified? What happens if the
same webhook arrives twice?

5. Sign-up, login and password reset

code
Review login, sign-up and password reset. Tell me: is there a limit on how
many times someone can try a password or request a reset email? Do reset
links expire and work only once? Does the app reveal whether an email is
registered? Fix what is missing and list the changes.

6. Uploads and user content

code
Where can users upload files or write text that other users will see?
For each: what file types and sizes are allowed (checked on the server),
who can download the files, and is user text shown as plain text or as HTML?

7. AI features inside your app

code
This app sends user input to an AI model. Check: can a user make it spend
unlimited money (rate limits, length limits, which model)? Can the AI read or
change data that belongs to other users? Is the API key only on the server?

More on this in prompt injection in LLM features.

Prompts that keep the AI honest

Use these after any security change:

code
What exactly did you change? List the files and, in plain language,
what each change does. Did you change, remove or weaken anything else?
code
How do I check this myself without reading code? Give me steps I can do
in the browser with two test accounts.
code
Did you turn off any security rule, use an admin/service key, or make
anything public to fix an error? If so, undo that and find another way.

That last one matters. When a permission error appears, the fastest way for an AI to make it disappear is often to remove the permission. Ask directly.

Use the built-in scanners too

The major builders now include security checks. Run them, read what they find, and still do the two-account test, because scanners check for known patterns, not whether your rules fit your business.

  • Lovable runs a quick security scan on every publish and offers a deeper scan on demand from the project's Security view.
  • Replit has Agent security scans on paid plans, with findings in the project's Security pane.
  • Bolt, Cursor and Claude Code: ask for a review with the prompts above, and see rules to set once so you do not have to repeat them.

Then run our 30-minute no-code check. If you want a person to do the review and fix what it finds, 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