AI coding tools have made it possible to go from idea to working app in a weekend. Getting from a working demo to a product that real customers can safely use is a different job.
Tools like Cursor, Lovable, Bolt, Replit and v0 have changed who can build software. Founders are validating ideas without hiring a team, and developers are shipping prototypes in days instead of months. As we wrote in Vibe Coding: A New Way to Build Software, that’s genuinely exciting. But a prototype that works in a demo isn’t necessarily ready for real users, real data or real payments. This guide covers the gaps we see most often in AI-built apps, and what to fix before you launch.
Why AI prototypes break in production
AI tools are optimised to make something work, quickly, for the request in front of them. They’re much less reliable at the things you don’t ask for: security, edge cases, scale and long-term maintainability. Research supports this. In Veracode’s 2025 GenAI Code Security Report, AI-generated code introduced a security flaw in 45% of the tasks tested.
| Area | Typical prototype | What production needs |
|---|---|---|
| Users | You and a few testers | Strangers, including some who will try to break it |
| Data | Sample records | Real personal and payment data, with legal obligations |
| Access control | Everyone can see everything | Each user sees only their own data |
| Errors | Shown on screen, or ignored | Handled gracefully, logged and alerted |
| Changes | Prompted straight into the live app | Version control, testing and a safe deploy process |
AI can build you a working demo. It can’t tell you what it forgot to build.
1. Secrets and API keys
One of the most common problems in AI-built apps is secret keys in the wrong place: payment, AI or database keys written directly into front-end code, where anyone can find them in the browser, or committed to a public code repository.
- Search your code for keys and move them into environment variables on the server
- Never expose secret keys in front-end code. Only public, restricted keys belong there
- If a key has ever been exposed, rotate it. Deleting it from the code isn’t enough
- Set spending limits on AI and cloud APIs, so a leaked key can’t run up a huge bill
2. Authentication and access to data
Many AI app builders use Supabase or Firebase as their backend. They’re excellent tools, but they rely on access rules that you must configure, such as Supabase’s Row Level Security. Without them, anyone who knows how can read or change every record in your database. In 2025, a vulnerability disclosed as CVE-2025-48757 showed exactly this, with missing Row Level Security exposing user data in more than 170 apps built with Lovable.
- Turn on Row Level Security (or Firebase security rules) for every table and collection, and write policies so users can only access their own data
- Check that permissions are enforced on the server, not just by hiding buttons in the interface
- Test as a logged-out user and as a second user: can you see or change anyone else’s data?
- Use a proven authentication service rather than custom login code
3. Input validation and common vulnerabilities
Every form, URL parameter and API endpoint is a way into your app. Check your code against the OWASP Top 10, the industry-standard list of web application risks:
- Validate and sanitise all input on the server, not only in the browser
- Use parameterised database queries to prevent SQL injection
- Escape user content before displaying it, to prevent cross-site scripting (XSS)
- Add rate limiting to logins, forms and expensive AI calls
- Keep dependencies updated, and remove packages the AI added but you don’t use
Our guide to website security basics covers the essentials for any site.
4. Data, backups and environments
In July 2025, an AI coding agent on Replit deleted a live production database during a code freeze, despite instructions not to make changes. The lesson isn’t that AI tools are dangerous. It’s that no one, human or AI, should be able to change production directly.
- Separate development, staging and production environments, each with its own database
- Turn on automated, off-site backups, and test that you can restore them
- Manage database changes with migrations you can review and roll back
- Give AI agents access to development environments only, never to live data
5. Performance, SEO and accessibility
Many AI-generated apps are single-page applications that render everything in the browser. That’s fine for a logged-in dashboard, but a problem for public pages that need to rank in Google or appear in AI search. Check:
- Public pages are server-rendered or pre-rendered, with unique titles, meta descriptions and structured data
- Images are compressed and the JavaScript bundle isn’t bloated with unused libraries
- Pages pass Core Web Vitals on mobile
- Forms, buttons and navigation work with a keyboard and a screen reader
See our guides to website performance and website accessibility for what to test.
6. Payments, privacy and compliance
If your app takes payments or stores personal data, the stakes go up. Verify payment webhooks on the server, never trust prices sent from the browser, and test failed and refunded payments as well as successful ones. Publish a clear privacy policy, collect consent where the law requires it, and know where your data is stored. If you serve Saudi customers, our guide to PDPL compliance explains the rules.
7. Code that someone can maintain
AI-generated code often works but is hard to understand, with duplicated logic, inconsistent patterns and no tests. That becomes a problem the moment you need to add a feature or hire a developer.
- Put the code in version control (Git) and deploy from it, not from the AI tool’s editor
- Add automated tests for the critical paths: sign-up, login, payments and core features
- Set up error tracking and logging, so you know about problems before customers report them
- Document how the app is set up, deployed and configured
Refactor or rebuild?
Not every prototype needs to be thrown away. A professional code review usually leads to one of three outcomes:
| Situation | Best approach |
|---|---|
| Sound structure, a few security and quality gaps | Harden and refactor the existing code |
| Validated idea, messy code, growing user base | Rebuild critical parts step by step while the app stays live |
| Proof of concept only, wrong stack for the product | Rebuild properly, using the prototype as a detailed specification |
Even when a rebuild is the right call, the prototype isn’t wasted. It has validated the idea, clarified the requirements and shown users what you mean, which makes the real build faster and cheaper.
Pre-launch checklist for AI-built apps
- No secret keys in front-end code or public repositories, and exposed keys rotated
- Row Level Security or equivalent access rules on every table
- Permissions enforced on the server and tested with multiple users
- Input validated server-side and checked against the OWASP Top 10
- Separate development, staging and production environments
- Automated off-site backups, with a tested restore
- Public pages server-rendered, fast and indexable
- Payment webhooks verified and failure cases tested
- Code in version control, with tests for critical paths
- Error tracking, logging and uptime monitoring in place
Vibe coding is a powerful way to start. Treat what you’ve built as a strong first draft, have it reviewed by someone who knows what to look for, and you’ll launch with the speed of AI and the reliability your customers expect.
Built an app with AI and want to know if it’s ready for real users? We’ll review the code, security and performance, and tell you what to fix first.
Get your app reviewed →

