# Vibe Coding

> The Vibe Coding is an approach to building software by describing what you want to an AI and accepting its code without reading it closely.

## What is vibe coding?

The approach where a person describes the desired result in natural language and accepts the generated code based on how the app behaves, without reviewing it. Fine for prototypes and personal tools, risky for production code.

- Topic: Agentic Coding
- Type: approach

## Example

Wrong:

```js
app.delete('/api/notes/:id', async (req, res) => {
  await db.notes.delete({ id: req.params.id });
  res.sendStatus(204);
});
```

Right:

```js
app.delete('/api/notes/:id', requireAuth, async (req, res) => {
  const note = await db.notes.find({ id: req.params.id });
  if (note?.ownerId !== req.user.id) return res.sendStatus(404);
  await db.notes.delete({ id: note.id });
  res.sendStatus(204);
});
```

The server checks the user and ownership, instead of trusting that the UI only shows the delete button to the owner.

## Common mistakes

- Shipping vibe-coded apps to production without reviewing auth, secrets and input validation.
- Installing packages the AI suggests without checking they actually exist.

## Key points

- API keys and secrets are read from environment variables on the server, never written in frontend code.
- Access rules are enforced on the server or in database policies, not only by hiding buttons in the UI.
- User input is validated on the server before it reaches the database.
- The project has a lock file and every installed package actually exists and is the intended one.

## Interview questions

### Is vibe coding bad?

No, it is fine for prototypes, demos and personal tools. It becomes risky when unreviewed code handles real users, money or private data.

### Vibe coding vs agentic coding: what is the difference?

In vibe coding you accept code by how the app behaves. In agentic coding you delegate tasks to agents but still review the changes and own the result.

### How do I make a vibe-coded app safe for production?

Review authentication, access rules, secrets and input validation, add tests, and check every dependency before real users rely on it.

## Related cards

- [Agentic Coding](https://wonderium.dev/ai/agentic-coding.md)
- [Slopsquatting](https://wonderium.dev/ai/slopsquatting.md)
- [Coding Agent](https://wonderium.dev/ai/coding-agent.md)
- [Technical Debt](https://wonderium.dev/processes/technical-debt.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/vibe-coding
- Last updated: 2026-11-25
