Cehpoint

Vibe coding security: how to make AI-built apps safe

Vibe coding security for small teams: the usual problems in apps built with AI coding assistants, and a practical checklist to fix them before launch.

A monitor and a laptop showing code on a desk

AI coding assistants let a small team build a working app in days rather than months. That speed is useful, but the assistant writes what you ask for, and "make it work" is not the same request as "make it safe". This guide covers the problems that turn up most often in quickly built apps and gives you a checklist you can work through before launch.

What is vibe coding and why does it create security problems?

Vibe coding means building software mainly by describing what you want to an AI coding assistant and accepting the code it writes, often without reading every line. The security risk comes from that gap: nobody checks whether keys are exposed, whether every page checks who is logged in, or which libraries were pulled in.

None of the problems below are new. They are the same weaknesses that appear in the OWASP Top 10 (a widely used list of the most critical web application security risks, now in its 2025 edition). What changes with AI-assisted building is the pace: an app can go from idea to public website before anyone has asked the basic security questions.

The UK's National Cyber Security Centre (NCSC) puts it simply in its secure development and deployment guidance: the first of its eight principles is that "secure development is everyone's concern". That still applies when the developer is an assistant.

How do secrets and .env files leak from AI-built apps?

Secrets (passwords, API keys and database credentials) leak when they are written straight into the code, committed to a Git repository, or left in a .env file (a plain text settings file) that the web server will hand to anyone who asks for it. Assistants often put keys inline to get a feature working quickly.

The common routes are:

  • Keys in the source code. The OWASP Secrets Management Cheat Sheet lists secrets "hardcoded within the source code in plaintext" as a widespread problem.
  • Keys in the repository history. Deleting a key in a later commit does not remove it from earlier ones.
  • Files the web server should never serve. A .env file, a .git folder or a database backup placed inside the public web folder can be downloaded by anyone who guesses the address.

The NCSC guidance on protecting your code repository recommends keeping secret credentials separate from source code and scanning repositories automatically for secret keys. OWASP adds that secrets detection should start "at the developer level", for example with a pre-commit hook (a check that runs before code is saved to the repository).

If a key has leaked, OWASP's advice is that "keys that were exposed should undergo immediate revocation", followed by a new key. Deleting the file is not enough: assume the old key is in someone else's hands and change it.

Can AI coding assistants suggest packages that do not exist?

Yes. An assistant can recommend a library that does not exist, and attackers can publish a malicious package under that name. The OWASP Top 10 for LLM Applications entry on misinformation describes exactly this: attackers look for commonly hallucinated package names and publish packages under them.

The wider issue is dependencies in general. Every library you add brings its own dependencies with it, and the 2025 OWASP list includes Software Supply Chain Failures as its own category. OWASP recommends that you:

  • know which components and versions you use, including the libraries your libraries depend on;
  • remove unused dependencies;
  • obtain packages only from official sources;
  • monitor vulnerability sources such as CVE, NVD and OSV (an open database of vulnerabilities in open source packages).

In practice: before accepting a new package, check it exists on the official registry, has a real history and is the one you meant. Then check your lock files (the files that record the exact version of every package installed) against a vulnerability database regularly, not just once.

Why do AI-built apps often have missing login and permission checks?

Assistants tend to build what the prompt describes, such as a page that shows an order, and may not add a check that the person viewing it owns that order. Broken access control (users reaching data or functions they should not) is number one in the OWASP Top 10 2025.

The OWASP Authorization Cheat Sheet sets out three rules that are worth giving to your assistant word for word:

  1. "Developers must never rely on client-side access control checks." Hiding a button in the browser does not protect the data behind it.
  2. "Permission should be validated correctly on every request." Getting it right on most pages is not enough.
  3. Configure the application to "deny access by default", so a new page is locked until someone opens it deliberately.

A simple test: log in as one test user, copy the address of something that belongs to them, then log in as a second test user and paste it. If the second user can see it, the check is missing.

Are admin panels and servers left exposed when apps are built quickly?

Often, yes. Quick builds tend to ship with a database admin tool, a debug page or a demo account still reachable from the internet, on a server that nobody has updated since launch. OWASP calls this security misconfiguration, the second item in its 2025 list.

OWASP's examples include unnecessary features "enabled or installed", default accounts with unchanged passwords, and error messages that reveal stack traces (internal details of the code) to users. Each one gives an attacker a head start.

The server matters as much as the app. A web server that is not receiving security updates, has password login for SSH (remote administration) switched on, or has old test applications running is exposed whether the app on top is well written or not. The NCSC principle "secure the build and deployment pipeline" covers this: the path from your laptop to the live server is part of the system. Our guide to web server security explains what to watch on a small Linux server once it is live.

What should a vibe coding security checklist include?

A useful checklist covers five areas: secrets, dependencies, access control, configuration and the server. Run it before the first public launch and again whenever the assistant has made large changes. Each item takes minutes, and most can be repeated by asking the assistant to check its own work.

Area Check How to confirm
Secrets No keys, passwords or tokens in the code or repository history Run a secret scanner on the repository; search for "key", "secret", "password"
Secrets .env, .git and backups are not downloadable Try opening yoursite/.env and yoursite/.git/config in a browser
Dependencies Every package exists and is the one intended Look each new package up on its official registry
Dependencies No known vulnerable versions Check lock files against a vulnerability database such as OSV
Access control Every page and API checks the user on the server Two-user test: can user B open user A's record?
Access control New routes are closed by default Review any route added without a login check
Configuration No debug mode, sample apps, default accounts or admin tools exposed Visit common admin paths; check error pages show no code details
Server Security updates installed and SSH password login off Check the update status and SSH settings on the server
Monitoring Someone is alerted to attacks and new problems after launch Decide who receives alerts and test that they arrive

How can I check an AI-built app for security problems as I go?

Make checking part of the same workflow you build in. Ask the assistant to scan dependencies and look for leaked secrets after each large change, review the proposed fixes yourself, and keep the live server watched after launch, because new vulnerabilities in existing libraries are published all the time.

This is the approach behind Cehpoint's security tools for AI coding agents. The Cehpoint skill runs inside your coding assistant: you ask it to check the project, it sends package names and versions (never source code, file contents, secrets or environment files) and gets back the vulnerable libraries with the fixed versions. It also flags files that look like leaked secrets, checked locally. Each proposed fix is shown to you and applied only after you confirm. More detail is on the source code security page.

Frequently asked questions

Is code written by an AI assistant less secure than code written by a person?

Not necessarily. The weaknesses are the same ones people introduce: exposed secrets, missing permission checks, outdated libraries. The difference is speed and review. When code is accepted without being read, nobody catches those weaknesses before launch, so you need deliberate checks to replace the review that did not happen.

What should I do if I find an API key in my Git repository?

Treat the key as compromised. Revoke it with the provider and issue a new one, then move it out of the code into a secret store or environment setting that is not committed. Removing the line in a new commit does not remove it from history, so changing the key is the step that matters.

How often should I check dependencies for vulnerabilities?

Check whenever you add or update packages, and on a regular schedule after launch, weekly at minimum for a live app. New vulnerabilities are published against versions you already have installed, so a project that was clean at launch can become vulnerable without any change to your code.

Can I ask the AI assistant to fix the security problems it created?

Yes, and it is often the quickest route, but review each change before accepting it. Give the assistant specific instructions, such as checking permissions on every request and denying by default, and then test the result yourself with the two-user test and a direct request for files like .env.

If you are building with AI coding assistants and want a second pair of eyes on the code and the server it runs on, see how Cehpoint works with AI coding agents.

Sources checked on 2 December 2026.

See what your own servers need today.