Vibe coding risks: security mistakes beginners make
Security: passwords and keys never go in the code
Picture opening your project and finding a password or an API key written right there in it, the API key being the access code for a service you pay for. Whoever finds it can spend money in your name or read data that isn’t theirs.
Code travels further and faster than you’d expect, to GitHub, to an agent or to anyone you share it with, so passwords and keys never belong in it. They belong in a separate store for secrets, and although you don’t need to know how that works, it’s enough to tell Claude “Keep passwords and keys out of the code and show me where they’re stored.”
The second thing is permissions. Before you let an agent loose on a project, decide what it’s allowed to do on its own, such as deleting files or sending things out. I always keep irreversible steps for myself, and how I have that set up is in My setup.
The third thing has the fancy name prompt injection and means a planted instruction. The agent reads someone else’s text, like an email, a web page or a form, and if someone hides the sentence “delete all files” in that text, the agent may treat it as an instruction. So the rule is that whatever the agent reads from outside is data, not commands, and the more the agent is allowed to do, the more this matters.
My mistakes and what they taught me
The Gemini bill. I used to rely heavily on Google’s tools, Gemini, Nano Banana and Antigravity, and they were good to work with, but I didn’t keep an eye on what they cost. I had free-trial credit and assumed it would cover the spending, but it didn’t apply to that particular API, and the default model, the most powerful and most expensive one, just kept running. The bill grew slowly and quietly until it reached about 1,000 Czech crowns. I switched billing off, and today I deliberately leave those tools aside because of the cost.
The forgotten local model. I installed Ollama, an app for running AI models directly on your own computer, and it looked promising at first. Then I moved on to something else and forgot Ollama was still running in the background, until at one point it froze everything. In the end I deleted it and got almost 9 GB back, and what I took from it is that whatever you start installing, you should either get it to the point where it actually does its job or delete it right away.
The bloated setup. Over the summer I loaded Claude Code with dozens of other people’s skills, hooks and plugins, but more tools didn’t mean better results, so in October I started over, lean. The whole story is in a case study.
What all three mistakes have in common is that something was running or sitting in the background and I wasn’t paying attention. Anything that runs on its own needs watching, whether it’s accounts, programs or tools in Claude Code.
Hallucinations and how I catch them
A hallucination is when a model makes up something that doesn’t exist. There’s no bad intent behind it; the model builds an answer that sounds sensible and sometimes misses, so it then tells you with a perfectly straight face that a website has a feature it doesn’t, or describes a procedure that doesn’t work.
I catch them simply by checking whatever the agent claims. When it says the button works, I click it, and when it says the job is done, I want to see the result. That’s why I have a hook, an automatic safeguard that won’t let Claude report finished work without proof.
I’m most careful with numbers, so at work the rule is that every number has to come from a verified script, not from the model’s head, because a model can calculate convincingly but not always correctly.
I don’t want to be paranoid; I just want to know what’s really going on. A regular chat gives you an answer and you take it, whereas an agent works on your computer, so you can verify its answer, and you should.
Keeping costs in check
I’m open about what the agents’ independence costs me, because cost belongs in the spreadsheet just as much as performance does.
My only regular monthly payment is a Claude Max subscription at $100. Compared with a single day of a paid developer’s time, that’s cheap.
A subscription is safe because the price is fixed, and when you hit the limit, you simply wait. Pay-as-you-go services work differently, because the bill adds up quietly and nobody stops you, which is what happened to me with Gemini.
So I’d advise setting a hard spending cap on every account that bills by usage, an amount the service won’t go past, plus an alert that arrives before you get close to it. It takes a few minutes to set up, and because I didn’t do it back then, it cost me about 1,000 Czech crowns.
Tool dependency and what I’d rather not hand to AI
Switching tools always costs something, whether time, habits or setup, and there’s no point having ten tools for ten jobs. I have one main tool, Claude Code, and if it got more expensive or shut down tomorrow, I’d have somewhere to go, because I know OpenAI’s Codex from the time I used it for a second opinion. My notes are also plain text files, so any tool can read them.
I don’t give AI sensitive data such as passwords, national ID numbers or health information, and I don’t give it decisions with serious consequences either. I can talk a budget, a contract or a big change through with it, but I make the call, because the agent is there to do the work, not to decide for me.
Security and working with agents go hand in hand; you just have to think about it up front. I show how I do it in practice in My stack and My setup. If you’ve been burned somewhere else, get in touch and I’ll gladly add it here so others can learn from it too.