Scan of 71 AI-Coded Repos: 65% Had Keys or Vulnerable Deps
A vendor scan of 71 repos built with Cursor, Claude Code and Lovable found credentials in 42% and vulnerable packages in 54%, plus a 5-minute check.

Two out of three AI-coded repos in a recent 71-repo scan carried a known-vulnerable package or a credential sitting in the source. Most were built with Cursor, Claude Code or Lovable.
The figure comes from the maker of Trust, a security checker aimed at apps built with AI coding tools, who published the breakdown this week and discloses the product up front. It is the vendor's own dataset, not an independent audit: the repos are ones outside users chose to scan in the last 30 days, counting the latest scan of each. Treat it as a signal about what AI-assisted codebases tend to ship with, not a population estimate.
What the scan counted
- 38 of 71 repos (54%) had packages with known vulnerabilities.
- 30 of 71 (42%) had API keys or credentials written into the code.
- 24 of 71 (34%) rendered raw HTML through
innerHTMLordangerouslySetInnerHTML. - 46 of 71 (65%) hit at least one of the first two.
The author's explanation for the dependency number is specific and worth repeating: the model picks a package version that worked in its training data, and that version often has a published security fix nobody installed. On credentials, the post draws a line that matters — some keys are meant to be public, such as a Firebase web key, but database URLs and server API keys showed up too, and a server key in a public repo is usable by anyone who finds it.
The third category is the one builders argue about. Raw HTML rendering is fine for static text and becomes a problem the moment anything a user typed can reach it. That is a review question about data flow, not a yes/no lint result, which is why it does not reduce to a single number.
The check that needs no tool
The post hands over its own method before pitching anything, and it runs in about five minutes:
- Run
npm audit, or your package manager's equivalent, and update the direct dependencies it lists. - Search the repo and its git history for
KEY,SECRET,postgres://andsk-. If a server key was ever committed, rotate it — deleting the line is not enough. - Search for
innerHTMLanddangerouslySetInnerHTML, then trace whether user input can reach either one.
Step two is the one people skip. A commit that leaked a key stays in history after the file is cleaned, and rotation is the only action that actually ends the exposure.
The exposure is wider than the repo
A separate roundup published the same day puts coding agents in a broader category of unreviewed AI access: agents, CLIs and MCP servers running on personal API keys, plus scripts hitting provider APIs with a key living in somebody's .env. Its concrete example — a developer wiring an MCP server into Claude Code with their own key so the agent can query a staging database — is the same credential problem one layer up from the codebase.
That roundup cites IBM's 2026 Cost of a Data Breach research, which it says found workers using unapproved AI tools figured in 43% of security incidents, more than double the year before, with about half of those incidents ending in data loss or compromise. The figure is IBM's as relayed by that piece, not something either source measured.
What to do with this
Run the three-step check on whatever you shipped most recently, before adding another scanner to the stack. If a server key turns up in history, rotation comes first and cleanup second. And if you have handed a coding agent its own API key, that key belongs in the same inventory as the ones in your code.
More from DangMua