Why an app built with AI needs a security audit

With Claude, Cursor or Lovable you can build an internal tool or customer portal in a few days. The app works, the code looks clean and your coworkers are happy. But nobody has checked whether another user can reach your data, or whether there is an API key in the code. A security audit is that check: someone reviews the code and configuration for security flaws before the app goes live or starts handling business data.

Dark illustration of a tower of black, blue and cream blocks with a gap in the middle where blue light shines through
Code that works is not the same as code that is secure.

Why AI code looks good but is not secure

An AI tool builds what you ask for. Ask for a login, and you get a login. Whether that login also keeps out people who should not get in is rarely part of the prompt. The tool usually tests the path where everything goes right: the right user, the right input, the expected result. An attacker does the exact opposite.

That is not just a hunch. Veracode had more than 100 language models write code and found that "AI-generated code introduced risky security flaws in 45% of tests" (GenAI Code Security Report, 2025). Larger and newer models did not do better.

There is more. Stanford researchers had participants solve programming tasks with and without an AI assistant (Perry et al., 2023). People who used an AI assistant wrote less secure code, and were more likely to believe their code was secure. Building fast gives you confidence. That confidence is not always earned.

What goes wrong in apps built with AI

These are rarely exotic attacks. Most of the time it is the same flaws the OWASP Top 10 has listed for years, with access control in first place. These six are the ones to watch:

RiskHow it happensWhat can go wrong

Secrets in the code

An API key or password sits in the code or in the repository history, because the tool put it there for convenience

Anyone who sees the code or repository can use your accounts, and you pay the bill

Missing permission checks

The app checks whether you are logged in, but not whether the data belongs to you

A user changes a number in the link and sees another customer’s invoices

Unchecked input

Text from a form goes straight to the database or to a language model (SQL injection, prompt injection)

Someone reads or changes data, or makes the AI feature in your app do something it should not

Outdated dependencies

The tool picks a package with a known vulnerability (CVE), or a package you do not need

A known flaw in someone else’s code becomes a flaw in your app

Settings that are too open

Database rules, CORS and security headers are left open so everything works right away

The database can be read from outside without logging in

Too much detail in logs and error messages

Error messages and log files show internal details or personal data

An attacker learns how your app is built, or you have a data breach under the GDPR

The article on the seven most common security flaws in AI-generated code explains how to spot and fix each one. About to launch? Then also go through the vibe coding security checklist.

If your app has AI features of its own, such as a chatbot or an assistant that reads documents, a second list applies: the OWASP Top 10 for LLM Applications. Prompt injection is in first place there. A document or email with hidden instructions can make the model do what the attacker wants, especially if the model is also allowed to take actions. More on that risk, and on API keys, is in the article on prompt injection and API keys.

A real example: open databases in apps built with Lovable

In 2025 it turned out that apps built with Lovable could have a database with access rules that were too loose. According to the vulnerability report CVE-2025-48757, Lovable through April 15, 2025 allowed attackers to read or write database tables of generated sites without logging in. The apps worked fine. Only the rule that says who may see which row was missing or too loose.

That is the pattern. Nobody did anything stupid. The tool delivered a working app, the builder saw a working app, and the access check fell through the cracks between the two. A security audit looks for exactly those gaps.

When should you get an audit?

Not every small change needs a full audit. But there are four moments when you are better off not skipping it:

  1. 01

    Before the app goes live

    As soon as people outside your team can open the app, someone with bad intentions can try too. Closing a gap before launch is cheaper and calmer than after.

  2. 02

    Before you connect real business data

    A prototype with test data is different from an app with customer data, invoices or HR files. From that moment on, a flaw is a potential data breach, and you may have to report it under the GDPR.

  3. 03

    After a big change made by AI

    If you had an AI tool build a new module, a payment integration or a permission structure, that is new code nobody has reviewed for security yet.

  4. 04

    When someone else built the app

    If the app came from an agency, a freelancer or a coworker who builds with AI, you want to know what you are taking on. An audit gives you an independent view before you sign off or take it over.

What a security audit does and does not do

A security audit is first of all a thorough code review with a security focus. We go through the code, the dependencies and the configuration looking for the flaws above. You get a report with every finding, how severe it is and how to fix it. The article on how Voltti runs a security audit with AI describes each step.

A pentest is something else. In a pentest, someone attacks your running app from the outside, the way an attacker would. The two complement each other: an audit finds flaws in the code that a pentest can miss, and a pentest finds problems in the environment that you cannot see in the code. Neither makes an app 100% secure. They do make the risk a lot smaller, and you know where you stand.

Can’t you just have AI check it yourself?

A first pass is definitely possible. Ask your AI tool to check the code for security flaws, and you will often find a few things. Go ahead and do that. But it has limits. The model that wrote the code looks at it with the same blind spots. It also flags things that are not a problem, and misses the flaws you only notice if you know how the app is used. So who decides what is real and what comes first?

In a security audit by Voltti, AI models and our own skills do the broad search. Then a person with 20+ years of experience in web development reviews every finding before it goes into the report. We remove false alarms. We also work with local models, so your code does not have to leave your network. If you want help with the fixes, that is possible, followed by a recheck. How Voltti secures its own Hermes installations is covered separately under security and privacy.

Five things you can check today

You do not have to wait for an audit to reduce the biggest risks. You can do these checks in an afternoon:

  • Search your code and your repository history for API keys and passwords. If you find one, replace the key itself; just deleting the line is not enough.

  • Log in with a second test account and change numbers in links and API calls. If you see the first account’s data, a permission check is missing.

  • Have your package manager check your dependencies, for example with npm audit or pip-audit, and update packages with known vulnerabilities.

  • Check your database access rules. Can someone read tables without logging in?

  • Trigger an error in production and look at what the visitor sees. A stack trace or database error does not belong there.

If a developer or agency works with you, point to the OWASP Top 10 as a shared framework. Want to know what you need to arrange yourself when your team works with AI tools and business data? Read the practical safety checklist for AI and business data. And if you want someone to really go through your app, for businesses in Belgium and the Netherlands, we are happy to discuss what an audit would cover for your app.

Portrait of Seppe Gadeyne

Seppe Gadeyne is a developer and the owner of Voltti. He sets up AI agents for companies in Belgium and the Netherlands.

Updated on

Frequently asked questions

01What is a security audit of an app?

A security audit is a focused review of your app’s code and configuration for security flaws, such as secrets in the code, missing permission checks and unchecked input. You get a report with every finding, how severe it is and how to fix it.

02Is code written by AI less secure?

Not always, but often. In 2025 Veracode found a security flaw in 45% of tests of code written by language models. The main problem is that the AI tool does what you ask and rarely checks on its own whether the app can withstand abuse.

03What is the difference between a security audit and a pentest?

A security audit looks at the code and configuration from the inside. A pentest attacks the running app from the outside, the way an attacker would. They complement each other; neither guarantees that an app is 100% secure.

04Can I have AI check my app for security myself?

A first check with your own AI tool is useful and often finds a few problems. But the model looks at the code with the same blind spots and also raises false alarms. A person who reviews every finding makes the difference between a long list and a useful report.

05When should you have an app built with AI checked?

At four moments: before the app goes live, before you connect real business data, after a big change made by an AI tool and when someone else built the app for you.

A security audit for your app?

Discuss your pilot