Vibe coding is writing software by describing what you want to a language model, accepting the code it produces without reading it closely, and iterating on behavior: run it, see what happens, tell the model what's wrong, repeat. You judge the program by whether it does the thing, not by what's in the diff. The phrase was popularized by Andrej Karpathy in February 2025 and spread fast, mostly because it named something a lot of people were already doing and felt slightly guilty about.
This post defines the term properly, separates it from its more disciplined cousins, and then spends most of its time on the part the definition skips: if nobody reads the code, something still runs it. Where that happens matters more than which model wrote it.
Vibe coding, defined without the vibes
Strip away the memes and vibe coding has three defining traits:
- The spec is natural language. You say "make a habit tracker with a streak counter and dark mode," not "add a
streakcolumn and a reducer." - Review is skipped or skimmed. You may glance at the output, but you are not reading it line by line, and you probably couldn't defend every line in a code review.
- The feedback loop is behavioral. Errors get pasted back into the chat. Wrong colors get described back into the chat. The model is the only one who has read the whole codebase, and it has also forgotten half of it.
None of that is inherently bad. For prototypes, internal one-offs, demos, and learning, it's a genuinely fast way to get from idea to working thing, and it lets people who don't write code professionally build tools they need. The honest critique isn't that vibe coding is lazy. It's that the trait which makes it fast, not reading the code, is the same trait that removes the last human checkpoint before the code executes.
Vibe coding vs AI-assisted coding vs agentic coding
These three get used interchangeably, and they shouldn't be. The useful axis is who reads the code and who runs it:
| AI-assisted coding | Vibe coding | Agentic coding | |
|---|---|---|---|
| Who writes the code | You, with autocomplete and suggestions | The model, from your prompt | The model, in a loop with tools |
| Who reads it | You, line by line | Mostly nobody | Ideally you, at the PR; often nobody mid-loop |
| Who runs it | You, deliberately | You, hopefully | The agent itself, many times per task |
| Feedback loop | Compiler, tests, your judgment | "It still doesn't work" pasted into chat | Tool results: test output, errors, file reads |
| Where it typically runs | Your machine | Your machine, or a hosted builder's | Wherever the agent's shell lives |
AI-assisted coding keeps you as the author; the model is a fast typist. Agentic coding hands the model tools, so it writes code, runs it, reads the error, and fixes it without waiting for you. I covered that loop in What Is an AI Agent? and won't repeat it. Vibe coding sits in between and borrows the riskiest property of each: the volume of an agent with the execution environment of a human, which usually means your laptop.
In practice the lines blur. Most vibe-coding tools now run commands for you, which makes them agents with a friendlier name. The question that survives the blurring is still the same one: when this code runs, what can it touch?
The real risk surface: running code nobody reviewed
The common worry is that the model writes buggy code. It will, and that's the least of it; bugs show up as behavior, and behavior is exactly what vibe coding watches. The dangerous failures are the ones that don't show up as behavior at all, because they happen during setup or quietly in the background. Here is what an unread project can do on the first run:
- Install dependencies you never chose. A generated
package.jsonorrequirements.txtcan list dozens of packages. Models also invent plausible package names that don't exist, and attackers register those names in advance so the install succeeds. This has a name now, slopsquatting, which tells you it happens often enough to need one. - Run install-time scripts.
npm installexecutespreinstallandpostinstallscripts from every package in the tree by default, and Python packages built from source run arbitrary code at build time. You haven't run the app yet and arbitrary code has already executed as your user. - Delete things. A cleanup step that does
rm -rf "$BUILD_DIR/"with an unset variable isrm -rf /'s polite cousin. No malice required; a model trying to be tidy is enough. - Read your secrets. Code running as you can read
~/.ssh,~/.aws/credentials, browser profiles, every.envfile in your home directory, and the environment variables of the shell you launched it from, including the API key for the model that wrote it. - Phone home. Unread code can make network requests: analytics you didn't ask for, a dependency with a compromised release, or an exfiltration call that looks like any other HTTPS request.
- Persist. A cron entry, a shell rc edit, a launch agent. The app gets deleted; the side effect doesn't.
The pattern across that list: the blast radius is set by the environment, not the code. The same postinstall script is a catastrophe on a laptop with production credentials and a non-event in a box that holds nothing and is deleted in ten minutes. So the useful move isn't to make vibe coders read code (they won't; that's the point). It's to change where the code runs.
Laptop vs container vs microVM
There are three realistic places for generated code to run. They differ in what an escape, or just a bad command, can reach:
- Your laptop — Reach: everything you can reach, which is your files, your keys, your logged-in sessions, your employer's VPN. Cleanup: manual, and you won't know what to clean. Fine for: code you've actually read.
- A container on your laptop — Reach: much less by default, if you don't mount your home directory and don't pass your environment in (people do both, constantly, because it makes things work). The container still shares your host kernel, so a kernel bug or a misconfigured socket mount is a path out. A container is a polite suggestion to the kernel. Fine for: generated code you're fairly sure is benign, with nothing sensitive mounted.
- A microVM — Reach: one disposable guest with its own kernel behind hardware virtualization. A destructive command trashes the guest; a kernel exploit has to break out of KVM, not just out of a namespace. Nothing of yours is inside unless you put it there. Fine for: code nobody has read, which is the definition of vibe coding.
I've made the long argument for that middle bullet in Why Docker Isn't a Sandbox, and the general version (what an agent sandbox is and what makes one good) in What Is an AI Agent Sandbox?. The short version for vibe coding: the default should be a fresh, empty, disposable machine per attempt, because the cost of being wrong on your laptop is unbounded and the cost of being wrong in a throwaway VM is one VM.
The objection is speed. Vibe coding is a tight loop, and nobody will tolerate waiting a minute for a VM each time the model rewrites the app. That used to be a fair objection. On PandaStack each create restores a pre-booted template snapshot, so a fresh Firecracker microVM is ready in about 179 ms at p50 (the very first spawn of a new template does a roughly 3 s cold boot, then the snapshot is baked and reused). That's faster than most dev servers take to print their banner, which removes speed as an excuse.
A practical safe loop: generate, sandbox, preview, keep or discard
Here's the loop I'd recommend to anyone vibe coding something that installs dependencies or runs a server, which is nearly everything:
- Generate. The model produces files. Your machine stores them as text and does not execute them.
- Sandbox. Create a fresh microVM, write the files in, and run install and build there. Install scripts, hallucinated packages, and tidy-minded
rm -rfall happen in a box with nothing in it. - Preview. Start the app inside the sandbox and open it through a preview URL. You judge the behavior, which is what vibe coding was going to do anyway, without the code ever running on your machine.
- Keep or discard. If it works, pull the source out (or snapshot the sandbox) and kill it. If it doesn't, feed the error back to the model and kill it anyway. The next attempt starts clean, so a broken attempt can't poison the next one.
With the PandaStack Python SDK, that loop is about forty lines. generate_files() stands in for whatever model call you use; it returns a dict of path to file contents. The base template ships Ubuntu 24.04 with Node 22, Python 3.12, Go, and Bun via mise, so a generated Vite or Express app runs without extra setup.
import time
from pandastack import Sandbox # reads PANDASTACK_API_KEY from the env
from my_llm import generate_files # your model call: prompt -> {path: contents}
prompt = "A habit tracker in React + Vite with a streak counter. Dev server on port 3000."
for attempt in range(1, 4):
files = generate_files(prompt)
# Fresh microVM per attempt. ttl_seconds is an IDLE timeout: if this
# script dies, the sandbox reaps itself after 15 quiet minutes.
sbx = Sandbox.create(template="base", ttl_seconds=900,
metadata={"job": "vibe", "attempt": str(attempt)})
try:
for path, contents in files.items():
sbx.filesystem.write(f"/work/{path}", contents)
# postinstall scripts and hallucinated packages run HERE, not on your laptop.
install = sbx.exec("cd /work && npm install", timeout_seconds=300)
if install.exit_code != 0:
prompt += f"\n\nnpm install failed:\n{install.stderr[-2000:]}"
continue
# Start the dev server detached; its output goes to a log inside the VM.
sbx.exec("cd /work && setsid nohup npm run dev -- --host 0.0.0.0 --port 3000 "
"> /tmp/app.log 2>&1 < /dev/null &")
time.sleep(5)
url = sbx.preview_url(3000) # https://3000-<id>.<suffix>
print(f"Attempt {attempt}: open {url}")
verdict = input("keep / retry / quit? ").strip()
if verdict == "keep":
# Bring back the SOURCE (text), not node_modules, and read it this time.
for path in files:
data = sbx.filesystem.read(f"/work/{path}")
print(f"--- {path} ({len(data)} bytes)")
break
if verdict == "quit":
break
log = sbx.exec("tail -n 50 /tmp/app.log").stdout
prompt += f"\n\nIt runs but is wrong. Feedback: {verdict}\nServer log:\n{log}"
finally:
sbx.kill() # discard: everything the attempt installed or broke is goneA few details in there are doing real work. The model's API key lives in your script's process, not in the sandbox, so generated code can't read it. Install errors and server logs flow back into the prompt, which is the vibe-coding feedback loop running against a box that can't hurt you. And kill() sits in a finally, so a crash or Ctrl-C still discards the VM; the idle TTL is the backstop if your whole process dies.
What a sandbox doesn't fix
Isolation bounds what unread code can do while it runs. It doesn't make the code good. Specifically:
- Shipping it is a different decision. The moment you deploy vibe-coded output to real users with real data, "nobody read it" becomes a security posture. Read the code before production, or have something that can (tests, a reviewer, a static analyzer) read it for you.
- Anything you put inside is exposed. If you write your cloud credentials into the sandbox so the app can deploy itself, the generated code can read them. The sandbox protects your machine, not secrets you hand to it.
- Network access is still a choice. A sandbox with open egress can still be used to send things outward or hammer someone else's API. See Controlling Network Egress for Untrusted Code for how to think about locking that down.
- It doesn't review dependencies. A malicious package that runs harmlessly in your sandbox will run less harmlessly in production. The sandbox buys you a safe place to find out what the code does, not a guarantee about what it will do later.
None of these are reasons to skip the sandbox. They're reasons to treat it as the floor: vibe code all you like, but let the unread code run somewhere that's built to be thrown away. For the fuller operational checklist (resource limits, timeouts, egress, teardown), see How to Run AI-Generated Code Safely: a 2026 Playbook.