Vibe coding

Vibe coding security: the traps that cost you dearly

Five vibe coding security traps: a visible secret key, poorly protected data, an AI acting on the live site, unprotected forms and no backups VIBE CODING Five security traps Secret keysnever in the code or the chatThe datawho can read it? who can change it?The live sitethe AI works on a copy, you installFormsprotected, every entry checkedBackupsbefore every installationAsk for security, then check it

Updated November 28, 2026.

A tool that works isn’t necessarily a safe tool. AI writes code that works, but it doesn’t always think about security unless someone asks it to. Good news: the most serious traps are easy to avoid, even if you can’t code.

The problem, in two numbers

In 2025, the security company Veracode had more than a hundred AI models write code: in 45% of cases, the code contained a known security flaw. And newer models did no better. That same year, a flaw in apps built with a popular vibe coding platform left the databases of more than 170 apps readable by anyone: names, emails, sometimes secret keys.

These numbers don’t say that vibe coding is dangerous. They say that security doesn’t come on its own: you have to ask for it, and check it.

The five costly traps

Trap 1: the secret key pasted into the code. An API key is like a credit card for a service. Pasted into the code or into a web page, anyone can read it and use it at your expense.
Fix: never paste a key or a password into the conversation or into the code. Ask the AI: “Where should I keep this key so it’s never visible?”

Trap 2: the database open to everyone. Many tools keep their data in an online service. If it’s set up badly, that service lets anyone read or change the data.
Fix: ask outright: “Who can read this data? Who can change it? Show me how it’s protected.” And start with fake data.

Trap 3: the AI acting directly on the live site. Some AI tools can change files or click for you. One mistake, and your site is down.
Fix: the AI works on a copy. You are the one who installs each version on the real site, after trying it.

Trap 4: unprotected forms. A poorly protected form can let a stranger inject code into your site or your database.
Fix: put this in your project brief: “every form is protected, every piece of data entered by a visitor is checked, every text displayed is cleaned.” The AI knows how; it just needs to know it’s mandatory.

Trap 5: no backup. Without a backup, the smallest mistake can erase data for good.
Fix: a backup before every installation, and the previous version always on hand. We cover this in Versions and backups.

The security review to ask the AI for

Before putting a tool into service, ask the AI to go over the whole project with these questions:

SECURITY REVIEW
1. Is there a key, a password or a secret visible anywhere?
2. Who can see the data? Who can change it?
3. Is every form protected against fraudulent submissions?
4. Is data entered by a visitor checked before it's used?
5. If I delete the tool, is any data left behind anywhere?
6. What happens if someone tries to use it without permission?

Ask for answers in plain language, with proof: “show me where that’s done.”

The win: in the example project, security was part of the rules written down on day one: only authorized people see the data, every form is protected, every database request is prepared, every text displayed is cleaned, and even exports to a spreadsheet are protected against booby-trapped formulas. These rules were repeated and checked with every version. And when, one day, the AI agent wanted to click a button on the live site itself, the tool’s safeguard stopped it. I clicked it myself. That’s exactly what you want: any action on the real site always goes through a human.

These precautions match the ones that apply to any use of AI at work: see Using AI at work safely.

In this guide: Vibe coding for beginners · previous: Testing without coding · next: Getting a bug fixed

For WordPress, the course WordPress Security (in French) that I teach at the Institut des communications graphiques et de l’imprimabilité.

Frequently asked questions

Is AI-generated code secure?

AI-generated code isn’t always secure: a Veracode study published in 2025 found a known flaw in 45% of the cases tested. It becomes much safer when security is part of the instructions and a review is done before the tool goes into service.

Where should you keep an API key in a vibe coding project?

In a vibe coding project, an API key must never be written in the code or in a web page. It belongs in a protected setting or a secret file, depending on the tool: ask the AI to show you the right method for your case.

Should you let an AI change your website directly?

It’s better not to let an AI change your live website directly. The AI should work on a copy, and each version should be installed by a person, after it has been tried and backed up.

Share this article