VeilguardVeilguard
AI CODING AGENTS

The code your AI assistant writes isn’t automatically secure

The short answer

AI coding agents help you write code fast, but the code they produce ships insecure more often than not, and it’s the app you build and deploy that carries the risk. These tools don’t have apps or databases of their own, so there’s nothing to "breach" in the tool itself. The problem is what ends up in your codebase: Veracode’s 2025 study found AI writes insecure code about 45% of the time, and a Stanford study found developers using AI assistants wrote more vulnerabilities while feeling more confident their code was safe. Veilguard reads the actual code you built with these tools and shows you, in plain English, what’s insecure and how to fix it.

What these tools actually are (and aren’t)

Cursor, Windsurf, Claude, and Copilot are assistants that write and edit code inside your editor. You describe what you want; they generate code; you accept it. That’s the whole relationship. They don’t run your app, host your database, or hold your users’ data, so a "Cursor breach" or "Copilot breach" isn’t a thing. What is a thing: the code they suggest becomes part of your app, and if that code is insecure, your deployed app is insecure. The vulnerability is yours, in your repo, on your stack.

Why AI-written code is so often insecure

These models learn from enormous amounts of public code, which contains insecure patterns right alongside secure ones, so they reproduce both, confidently. When the fastest way to make a feature "work" is the insecure way (put the auth check in the browser, hardcode the key, skip input validation), that’s frequently what they suggest, and a non-expert accepts it because it works. Studies back this up: NYU found 40% of Copilot’s suggestions were vulnerable; a 2025 study of real GitHub projects found ~30% of Copilot snippets had weaknesses across 43 different vulnerability types.

There’s also a risk unique to these tools: rules/instruction files (.cursorrules, CLAUDE.md, AGENTS.md, Copilot instructions). These shape how the agent writes code across your entire project. Pillar Security showed in 2025 that a poisoned rules file (the "Rules File Backdoor") can steer an agent into writing insecure code everywhere, and both GitHub and Cursor said reviewing the output is your responsibility.

What tends to be wrong in AI-assisted code

  • Authorization in the browser access checks the visitor can flip. (Enrichlead, a SaaS built with Cursor, was breached this way: the paywall was bypassed and its exposed API keys abused. Source: Revolter Tech.)
  • Hardcoded / committed secrets keys embedded to fix an error, then shipped or committed. (28.6M secrets hit public GitHub in 2025, GitGuardian.)
  • Missing input validation & injection request data used directly in queries and commands.
  • Weak error handling raw errors and stack traces leaked to users.
  • Risky rules files insecure directives that affect every file the agent writes.

Pick your tool for guidance tuned to it

How to check the code you built

These issues live in your source code, not on a URL, so connect your GitHub repo or upload your project to Veilguard, and it reads the actual files, flags the insecure patterns, and gives you the exact fix (code, or a prompt to paste back into your agent).

Sources

Other categories

Scan your code free

Paste your app's link and get a plain-English A to F grade in about 60 seconds, plus the exact fix for every issue.

Free · No signup · Your code stays yours · Results in ~60s