Insights
How do you make an app built with AI tools safe before launch, a raise or a sale?
By Rare Agentics engineering teamLast updated First published 8 minute read
Apps built with AI tools usually work on the happy path and fail on the edges: access rules that let one customer read another's data, keys in the wrong place, missing rate limits and data sent where it should not go. Before real customers, a raise or a sale, check those gaps deliberately, fix each one with a test that proves it stays fixed, and make sure the code, accounts and data are owned by the company. An engineering-led security review does this in 1 to 3 weeks.
Is it a problem that the app was built with an AI tool?
Not in itself. Tools such as Lovable, Bolt, Cursor, Replit and v0 are good at producing something that works, quickly.
The issue is what they optimise for. An AI tool is asked to make the feature work, and it does. It is rarely asked who else should be prevented from using that feature, what happens at a thousand requests a minute, or where a secret key will end up once the code is in a browser. Those questions are not on the happy path, so they often go unanswered.
A prototype with ten friendly testers can live with that. A product with paying customers, personal data or a payment flow cannot. Neither can a company about to show its code to an investor's technical adviser or a buyer's due diligence team.
What are the most common gaps in AI-built apps?
The same handful of weaknesses come up again and again. They are also the ones attackers look for first.
Access rules that do not hold. The screen only shows you your own records, but the database will happily return everyone's if asked directly. On Supabase, for example, the public key that ships to the browser is meant to be public. What protects the data is row-level security on every table, with policies that actually check who is asking. A table with security switched off, or a policy that allows everything, is an open door. Our guide to checking Supabase row-level security shows how to find both, and how to test the policies as a real user.
Keys in the wrong place. Secret keys for the database, payment provider or AI provider pasted into front-end code, committed to the repository or left in an example file. Anything that reaches the browser is readable by anyone.
No rate limits or lockouts. Sign-in, password reset, sign-up and any endpoint that costs money (sending email, calling an AI model) with no limit on how often they can be hit. That invites password guessing, spam and a surprise bill.
Weak sign-in and account recovery. Reset links that never expire, recovery flows that reveal whether an email address has an account, and admin pages protected only by being hard to find.
Features left on by default. Test accounts, debug routes, open storage buckets and sample data that were useful while building and were never removed.
Data sent where it should not go. Customer records passed to an AI provider or an analytics service that your privacy policy and data agreements do not mention. What the code sends should match what your agreements say. If personal data leaks, UK GDPR requires you to report a breach that risks harm to people to the ICO within 72 hours of becoming aware of it.
AI features that can be steered. A chatbot or AI feature that reads customer data can be talked into revealing it, or into taking actions it should not, by text a user types or a document it reads. This is prompt injection, and it is fixed with access controls around the feature, not with better instructions to the model.
Cloud accounts with too much access. One all-powerful key used everywhere, shared logins, and nobody sure who can do what.
Backups nobody has tested. Backups switched on, perhaps, but a restore never proven. A backup you have not restored is a hope, not a plan.
Access that outlives the person. The freelancer from six months ago who still has an admin login, and the AI coding tool still connected to the repository with write access.
What checklist can you run before launch yourself?
You do not need to be a security specialist to run a first pass. You need a second browser, a test account and an hour or two.
| Check | How to test it | What good looks like |
|---|---|---|
| Data isolation | Sign in as two test users. Try to open, edit or delete one user's record while signed in as the other, including by changing IDs in the address bar, and by calling the API directly with one user's session | Every attempt is refused by the server, not just hidden in the interface |
| Database rules | Look at every table in your database dashboard | Row-level security on, with a policy on each table that checks the user |
| Secrets | Search the front-end code and the repository history for keys, and view the page source in a browser | Only keys designed to be public appear; secret keys live in server-side environment settings |
| Rate limits | Try ten wrong passwords in a row, then request ten password resets | Lockout or slowing down, and no flood of emails |
| Account recovery | Request a reset for an address that has no account | The same message as for a real account; reset links expire |
| Admin pages | Visit admin routes while signed out and as an ordinary user | Refused by the server in both cases |
| Leftovers | List test accounts, debug routes, sample data and public storage buckets | Removed, or deliberately kept and locked down |
| Outbound data | List every outside service the app sends data to, and what it sends | Each one is named in your privacy policy and data agreements |
| Backups | Restore last night's backup to a separate environment | The restore works, and you know how long it took |
| Access | List everyone and every tool with access to code, hosting and data | Only current people, each with only what they need |
If any row fails, do not panic. These are all fixable, usually quickly. What matters is that you find them before a customer or an attacker does.
A self-check has limits. It finds the obvious failures, not the subtle ones, and it gives you nothing to show an investor. For that you need a review with every finding written down, reproduced and fixed.
What changes before a raise or a sale?
Launch is about protecting customers. A raise or a sale adds a second audience: someone else's technical adviser, reading your code and your setup to decide what it is worth.
They will ask questions that have nothing to do with attackers.
- Does the company own the code? It should be in repositories owned by the company, not in a founder's personal account or a freelancer's.
- Does the company own the accounts? Hosting, database, domain, email sending and AI providers should be billed to and controlled by the company.
- Does the data match the agreements? What the code sends to outside services should match what the privacy policy and data agreements say.
- Can someone else run it? A new engineer should be able to set it up from the documentation, and there should be tests for the behaviour that matters.
- What is known to be wrong? A written list of known issues, ranked and with a plan, reads far better than a surprise found by the buyer.
Issues found in due diligence tend to become arguments about price. Issues you found, fixed and documented yourself become evidence that the company is well run. We cover the ownership side in more depth in how to own your code with a software partner.
Should you fix the app, rebuild it or start again?
Usually fix. Most AI-built apps have a sound core and a set of specific gaps, and closing the gaps is far cheaper than starting over.
Rebuild part of it when the same problem appears everywhere. If every screen talks to the database in its own way with no shared access layer, patching each one is slower and riskier than putting one proper layer underneath.
Start again only when the foundations cannot carry what the business needs next, for example a data model that cannot represent how your customers actually buy. That is rarer than people fear, and it is a decision to make on evidence, not on a feeling that "AI code" must be bad.
Whoever you ask, ask them to show their reasoning: which parts are worth keeping, which are not, and why. If you then want the product taken to production properly, our bespoke software builds start from exactly this kind of review.
Is a security review the same as a penetration test?
No, and it is worth knowing the difference before you buy either.
Our security review ends with every finding fixed and retested; a penetration test ends with a report of what testers could break into. Our comparison of a penetration test and a security review sets out when each is the right buy.
For most founders preparing to launch or raise, the review is the more useful first step, because it ends with the problems fixed rather than listed.
What should a good security review give you?
Whoever you hire, expect these, and be wary of any review that does not offer them.
- A signed scope before testing starts. Both sides agree what will be tested, and nothing outside the scope is touched.
- Every finding reproduced and ranked. No unverified scanner output. Each finding is shown to be real, ranked by severity and explained in terms your team can act on.
- Fixes, not only findings. Either the reviewer fixes what they find within the agreed price, or they guide your team through it.
- A test for every fix. So the same gap cannot quietly return in next month's release.
- A retest. A second pass that confirms each fix holds.
Ask, too, how the reviewer uses AI. We use agents to sweep sign-in, access, limits, stored keys, infrastructure and outside services, because they are fast and thorough. They work under supervision, and people check every finding and every fix. We run the same review on our own builds.
How Rare Agentics can help
Our security and hardening service takes apps built fast with AI tools and makes them safe for real customers: every finding reproduced and ranked, the fixes, a test for each and a retest, in 1 to 3 weeks. If your app was built with Lovable, Bolt, Cursor, Replit or v0, our security review for AI-built apps sets out what we check. Get in touch before your launch, raise or sale and you will get a first view within two working days.