Skip to content
VITI Security

Vibe Coding with AI: The Hidden Risks in Your Cursor and Claude Code Sessions

by VITI Security TeamMay 11, 2026
Vibe Coding with AI: The Hidden Risks in Your Cursor and Claude Code Sessions - VITI Security

"Vibe coding" — letting an AI agent drive most of the implementation while you steer at a high level — is the dominant mode of writing software in 2026 for an enormous number of developers. It is also where the new class of supply-chain risks lives. Three years of Cursor, Aider, Claude Code, Cline, and a dozen others later, the patterns are clear.

The agent has more reach than you think

Modern coding agents read your repo, write files, run tests, install packages, and execute shell commands. Many also have web access. The blast radius is your local environment — and through committed credentials, your production environment.

Risk 1: Committed secrets

The agent does not know your `.env` is sensitive unless told. It cheerfully writes config files, paste-completes example values that turn out to be your real keys, and commits them into "fix the bug" commits. Use git pre-commit hooks (gitleaks, trufflehog) and configure a global gitignore for files like `.env*`, `*.pem`, `id_rsa*`.

Risk 2: Poisoned dependencies

The agent autocompletes a `pip install` or `npm install` based on guess. Typo-squat packages live for exactly this — `reqeusts` for `requests`, `pyhton-dotenv` for `python-dotenv`. Restrict installs to confirmed names, ideally pin from a lockfile, and treat the agent like a junior engineer who has never been hardened against supply-chain attacks.

Risk 3: Tool confused-deputy

Indirect prompt injection through README files, documentation pages, code comments, or even error messages can manipulate the agent into reading or sending data outside its intended scope. Treat any text that comes from outside your repo as untrusted — even error stacks from a remote service.

Risk 4: Local privilege creep

Agents that run shell commands inherit your user permissions. They can read SSH keys, browser cookies, password manager auto-fills, and any cloud CLI tokens. Run them in containers or restricted environments where stakes are real.

Risk 5: License and IP contamination

The agent paste-completes from training data. Some of that is GPL-licensed, some is proprietary patterns, and some is unfortunate copies of identifiable code. For commercial codebases, that is real legal exposure. Audit generated code against your dependency policy before merging.

Hardening checklist

  • Pre-commit secret scanning (gitleaks, trufflehog).
  • Lockfile-pinned package installs only.
  • Run agents in containers with no host credential mounts.
  • Block agent shell access to credential paths (`.aws`, `.ssh`, password manager files).
  • Code-review every agent-generated PR like you would a junior engineer's.
  • Require an approver who is not the prompter.

Vibe coding is genuinely faster. Treat it like a power tool — useful, and dangerous when handled like a toy.

vibe coding ai risks

Further reading

Frequently asked questions

How much access does an AI coding agent have?

Modern coding agents read your repo, write files, run tests, install packages, and execute shell commands. Many also have web access. The blast radius is your local environment - and through committed credentials, your production environment.

How do AI coding agents leak secrets?

The agent does not know your `.env` is sensitive unless told. It cheerfully writes config files, paste-completes example values that turn out to be your real keys, and commits them into "fix the bug" commits.

How can an AI coding agent install a malicious package?

The agent autocompletes a `pip install` or `npm install` based on guess. Typo-squat packages live for exactly this - `reqeusts` for `requests`, `pyhton-dotenv` for `python-dotenv`.