The AI-code security toolkit: 23 tools, 11 run on a test repo

If AI writes your code, something else should check it. Secret scanners, dependency checkers, static analysis, AI reviewers and pre-commit guards, with what each one caught on a deliberately vulnerable repo.

Blurred close-up of colourful JavaScript code on a dark screen (Photo: Markus Spiske / Pexels)
Blurred close-up of colourful JavaScript code on a dark screen (Photo: Markus Spiske / Pexels)

The short answer

If AI writes your code, check it with different tools: a history-aware secret scanner (Gitleaks or TruffleHog), a dependency auditor (OSV-Scanner or Trivy), a static analyser (Semgrep, plus Bandit for Python) and pre-commit hooks. It's all free, and on our test repo no single tool caught everything.

Key takeaways

  • Georgia Tech's Vibe Security Radar confirmed 74 AI-linked CVEs by spring 2026; by 27 Nov 2026 it listed 310 findings, and it calls that a floor.
  • The minimum solo stack is free: Gitleaks or TruffleHog, OSV-Scanner or Trivy, Semgrep or Opengrep (plus Bandit), and pre-commit.
  • On our test repo only TruffleHog found all five planted secrets; only history-aware scanners found a key deleted in a later commit.
  • Vulnerability scanners don't catch slopsquatting: a made-up package name sailed past Trivy and OSV-Scanner's results table.
  • AI code reviewers are a useful second reader, not a security gate; none of the five promises to catch everything.
  • Pin your security tools too: Trivy's GitHub Action tags were hijacked in March 2026.

If an AI writes your code, a different tool should check it before it ships. The minimum stack for a solo builder is free: a secret scanner that reads your git history, a dependency auditor, a static analyser and a pre-commit hook to run them. We installed and ran 11 of the 23 tools below against a deliberately vulnerable repo, and this post reports what each one actually caught. The rest are listed from their docs and labelled that way.

Blurred close-up of colourful JavaScript code on a dark screen
Code you didn’t write still ships under your name. Photo: Markus Spiske / Pexels

Why does AI-written code need its own checks?

Because the bugs are now countable. Georgia Tech’s Systems Software & Security Lab runs the Vibe Security Radar, which traces public CVEs and GitHub advisories back to the commit that introduced them and flags the ones with an AI coding tool’s fingerprints on them. In April 2026 Georgia Tech reported 74 confirmed cases, 14 of them critical and 25 high, including command injection, authentication bypass and SSRF. March 2026 alone had 35, more than all of 2025 combined. The Cloud Security Alliance’s research note carried the same 74 figure.

That number has kept climbing. When I checked the radar on 27 November 2026, it listed 310 findings across 144 projects, with data through 26 September. Authentication and access control (90) and injection and unsafe execution (85) were the top root causes. The team says plainly that this is a floor, not a census: the radar can only see code that kept its AI signature, like a co-author trailer or a bot email. It also says it doesn’t compare AI and human defect rates, so nobody should quote it as “AI code is X% worse”. The verification pipeline has been tightened since the spring, too, so the radar’s monthly chart now shows slightly different early-2026 numbers (33 for March rather than 35). The trend hasn’t changed.

Here’s the part I find more useful than the headline. Hanqing Zhao, who leads the project, told Georgia Tech that models repeat the same mistakes, so “find one pattern in one AI codebase, you can scan for it across thousands of repositories.” That cuts both ways. Attackers can scan for the patterns, and so can you, cheaply, before you push. That’s what this directory is for.

(If you’re comparing vibe-coding platforms themselves, I wrote a security test plan for five of them. This post is the toolbox you run on whatever they produce.)

How did tools get on this list, and how did we test them?

Same rules as The Agent Builder’s Stack: the tool has to be shipping and maintained, do one job clearly, and have public pricing or say plainly that pricing goes through sales. Nobody paid to be here, there are no affiliate links, and no vendor saw this before it went live.

Then we ran what we could. I built a small test repo the way an over-eager assistant might: a Flask “user lookup API”, an Express endpoint and a Dockerfile. It contains:

  • Secrets (five in total): a fake AWS key ID and secret, a fake Stripe live key and a Postgres URL with a password in config.py, plus a fake GitHub token that was committed and then “removed” in the next commit, so it only lives in git history.
  • Code flaws: SQL built with an f-string, subprocess with shell=True, yaml.load and pickle.loads on request data, requests.get(url, verify=False) on a user-supplied URL (SSRF), MD5 password hashing, exec and eval on query strings in the Node app.
  • Dependencies: five old Python pins (Flask 0.12.2, requests 2.19.1, PyYAML 5.3, Jinja2 2.10, urllib3 1.24.1) and four old npm pins (express, lodash, minimist, jsonwebtoken), plus a Dockerfile on python:3.7-slim running as root.

Every key was randomly generated and never valid. Each tool ran once with default or near-default settings on 27 November 2026, and the raw outputs are saved. “Not run, listed from docs” means exactly that: the tool needs an account, a hosted repo or a paid plan, and I didn’t fake a run.

What’s the minimum security stack for a solo builder?

A handful of free tools and one config file. If you do nothing else on this page, do this:

  1. Gitleaks or TruffleHog on the full git history, because deleting a key in a later commit doesn’t remove it.
  2. OSV-Scanner or Trivy on your lockfiles, plus npm audit or pip-audit if you live in one ecosystem.
  3. Semgrep (or Opengrep) for code patterns across languages, plus Bandit if you write Python.
  4. pre-commit to run the secret scanner and a fast linter on every commit, so the agent’s next “quick fix” can’t sneak a key in.
  5. Turn on Dependabot alerts and, for public repos, GitHub’s free secret scanning and push protection.

The total cost is $0, and on our repo the whole pass took well under a minute once the tools were installed. The pre-commit hooks took 23 seconds on their first run, most of it one-off environment setup.

What each tool caught on our test repo

Tool (version run) What it caught What it missed
Gitleaks 8.30.1 (git mode) 4 of 5 secrets: AWS key ID and secret, Stripe key, and the GitHub token buried in history The password inside the Postgres URL
TruffleHog 3.100.1 (git mode) All 5 secrets, in 4 findings (it reports the AWS pair as one): AWS, Stripe, the history-only GitHub token and the Postgres URL. All marked unverified, which is correct, because they were fake Nothing we planted. It did try to log in to the fake database host to verify, so know that it makes network calls
detect-secrets 1.5.55 3 of 5: the AWS secret, Stripe key and DB password lines The AWS key-ID line, and the GitHub token, because it scans the working tree, not history
Semgrep 1.187.0 (p/default) 25 findings: SQLi, command injection, both deserialisation bugs, SSRF, disabled TLS checks, hardcoded AWS/Stripe keys, eval and exec in Node, root user in the Dockerfile MD5 hashing, the Postgres password, vulnerable dependencies
Opengrep 2.1.0 (community rules) 32 findings on the same files, including MD5 and the unpinned base image Dependencies and history. It used a broader rule set than our Semgrep run, so this isn’t an engine head-to-head
Bandit 1.9.4 11 findings: SQLi, shell=True, yaml.load, pickle, verify=False, MD5, binding to 0.0.0.0, two hardcoded keys The SSRF, and everything in JavaScript (it’s Python-only)
pip-audit 2.10.1 30 unique advisories across all 5 Python pins (59 rows with duplicates) On its default setting it refused to run at all, because two of our pins conflict. It needed --no-deps
npm audit (npm 11.21.1) 10 vulnerable packages: 1 critical (minimist), 6 high (incl. lodash, express, jsonwebtoken), 3 low, transitive ones included Anything outside npm
OSV-Scanner 2.7.1 30 vulnerability groups in the Python pins, 24 in the npm lockfile. It also named the exact conflicting pin (urllib3) Secrets and code flaws (not its job)
Trivy 0.76.2 (fs) 30 Python and 26 npm vulnerabilities, 3 secrets (AWS pair, Stripe), and two Dockerfile misconfigurations (root user, no HEALTHCHECK) The Postgres password and the history-only token
pre-commit 4.7.0 (Gitleaks + detect-secrets + Bandit hooks) Blocked a commit adding an OpenAI-style key and a shell=True helper. All three hooks failed it independently Nothing it was configured for

Two things stood out. No two secret scanners agreed. The Postgres password got past Gitleaks, Trivy and Semgrep but not TruffleHog or detect-secrets. Only the history-aware scanners found the “deleted” GitHub token, and only TruffleHog got all five. Run two. And pip-audit’s refusal was a real catch, not a bug. My hand-written pins were mutually incompatible, which is exactly the kind of thing an assistant produces when it pins from memory. OSV-Scanner told me which pin was wrong.

Secret scanners: which one should catch leaked keys?

Leaked keys are the cheapest bug for attackers to exploit and the cheapest for you to prevent. Use a history-aware scanner in CI and a fast one in pre-commit.

Tool Catches Best for Skip if Pricing (checked 27 Nov 2026) Link
Gitleaks Regex and entropy secrets in files and full git history. Run: 4 of 5 planted secrets A fast, single-binary scanner for pre-commit and CI You want live verification of whether a key works. Note that the GitHub Action needs a free licence key for organisation repos Free, MIT. Action free for personal accounts; free licence key for orgs github.com/gitleaks/gitleaks
TruffleHog 800+ detectors, with optional live verification against the provider. Run: 5 of 5 Separating real, working credentials from noise, across git, S3, Docker and more You can’t allow outbound verification calls from CI, or the AGPL licence is a problem Open source: free (AGPL-3.0). Enterprise: contact sales trufflesecurity.com
detect-secrets (Yelp) Secrets in the working tree, managed with a baseline file. Run: 3 of 5 Legacy repos where you need to freeze existing findings and block new ones You need history scanning. Its last commit was in April 2026, slower than the others here Free, Apache-2.0 github.com/Yelp/detect-secrets
GitGuardian Secrets across repos, CI and containers, with validity checks and the ggshield CLI. Not run (needs an account), listed from docs Small teams who want a dashboard and incident workflow without running anything You only need a local scanner. Gitleaks does that for free Free up to 25 devs; Growth and Enterprise: contact sales gitguardian.com/pricing
GitHub Secret Protection Secret scanning plus push protection that blocks the push. Not run (needs a hosted repo), listed from docs Teams on GitHub who want leaks stopped at the server, whatever runs locally You’re not on GitHub, or your repos are public, where scanning and push protection are already free $19 per active committer/month for private repos; free on public repos github.com/security/plans

Dependency checkers: is that package vulnerable, or even real?

AI assistants pin versions from training data, which means old versions. They also invent packages. The USENIX Security 2025 study by Spracklen and colleagues generated 576,000 code samples from 16 models and found that 19.7% of recommended packages didn’t exist (5.2% on average for commercial models, 21.7% for open-source ones). Attackers register those names. That’s “slopsquatting”.

So I ran one more test: a requirements.txt with Flask and one made-up package, flask-secure-auth-toolkit-pro, which I confirmed returns a 404 on PyPI. pip-audit listed it as “not found on PyPI and could not be audited”. OSV-Scanner logged a resolution error naming it, but its results table showed only Flask. Trivy said nothing. The real lesson: a vulnerability scanner checks names against known advisories. If an attacker had already registered that name, all three would have scanned it and found nothing to report. Catching that takes a tool that judges the package itself, like Socket below, or simply a human checking that a dependency is real before installing it.

Tool Catches Best for Skip if Pricing (checked 27 Nov 2026) Link
OSV-Scanner (Google) Known vulns in lockfiles and manifests across ecosystems, via osv.dev. Run: 30 Python + 24 npm groups One free, polyglot dependency scanner for CI You need malware or package-reputation checks. It only knows published advisories Free, Apache-2.0 google.github.io/osv-scanner
Trivy (Aqua) Vulns, secrets, IaC and Dockerfile misconfigs, containers and SBOMs. Run: 56 vulns, 3 secrets, 2 misconfigs One binary that covers deps, Docker and infrastructure You install it unpinned. In March 2026 attackers published a malicious v0.69.4 and hijacked the GitHub Action’s tags, so pin versions or commit SHAs Free, Apache-2.0 trivy.dev
pip-audit Known vulns in Python environments and requirements files (PyPA). Run: 30 advisories Python-only projects, especially in CI Your requirements don’t resolve. Fix that first, or use --no-deps Free, Apache-2.0 github.com/pypa/pip-audit
npm audit Known vulns in the npm dependency tree, built into npm. Run: 10 packages Zero-install checks on any Node project You want fewer false alarms. It reports transitive issues whether or not your code reaches them Free, ships with npm docs.npmjs.com
Dependabot Alerts and automated upgrade PRs for vulnerable dependencies. Not run (needs a hosted repo), listed from docs Anyone on GitHub. It’s the “turn it on and forget it” baseline You’re not on GitHub Alerts, security updates and version updates included on all GitHub plans docs.github.com
Socket Malicious, typosquatted and suspicious packages, judged by behaviour, plus known vulns. Not run (CLI needs an account), listed from docs The slopsquatting problem: catching a bad package before install You only need CVE matching. OSV-Scanner does that for free Free (1 dev seat, 1,000 scans/mo); Team $25/dev/mo; Business $50/dev/mo; Enterprise custom socket.dev/pricing
Snyk SCA, SAST, IaC and container scanning with fix advice. Not run (needs an account), listed from docs Small teams who want one commercial dashboard with IDE plugins You’ll hit the free test limits (200 open-source tests, 100 code tests) and can’t justify paying Free (limited tests); Team from $25/month, for teams of up to 10 devs; Enterprise: prepaid credits snyk.io/plans

Static analysis: what catches injection and unsafe code?

This is where the AI-shaped bugs live: string-built SQL, shell calls, unsafe deserialisation, SSRF. On our repo, the taint-tracking tools (Semgrep, Opengrep) found the SSRF and Bandit didn’t.

Tool Catches Best for Skip if Pricing (checked 27 Nov 2026) Link
Semgrep Pattern and taint rules across 35+ languages, plus secrets and SCA on the platform. Run: 25 findings The best free first pass across a polyglot repo, with easy custom rules You need more than 10 private repos or 10 contributors on the platform without paying CLI: free (LGPL-2.1). Platform: free up to 10 contributors; Teams from $30/contributor/mo (Secrets $15) semgrep.dev/pricing
Opengrep A Semgrep-compatible open-source engine with cross-file taint tracking, backed by a vendor consortium. Run: 32 findings Teams who want a fully open engine and community rules with no platform You want a managed dashboard, PR comments and support Free, LGPL-2.1 github.com/opengrep/opengrep
Bandit Common Python security issues (PyCQA). Run: 11 findings Python repos, especially as a pre-commit hook. It’s fast and quiet Your code isn’t Python, or you need cross-function data flow Free, Apache-2.0 bandit.readthedocs.io
CodeQL Deep semantic queries and data-flow analysis behind GitHub code scanning. Not run: its licence only covers open-source codebases and research, and our fixture isn’t OSS-licensed Public repos on GitHub, where it’s free and very thorough Your repo is private and you don’t want to pay for GitHub Code Security Free on public repos; GitHub Code Security $30 per active committer/month for private repos codeql.github.com
SonarQube Bugs, vulnerabilities and security hotspots across 35+ languages, in the cloud or self-hosted. Not run (needs an account or server), listed from docs Teams who want code quality and security gates on every PR You only care about security findings and want something lighter Free for private projects up to 50k LOC; Team from $34/mo (100k LOC); Community Build self-hosted free sonarsource.com

AI-aware code review: should an AI check the AI?

Yes, as a second reviewer, not as a security gate. These bots read the diff in context and catch logic bugs a regex never will, but none of them promises to find everything. GitHub’s own docs say that Copilot “is not guaranteed to spot all problems”. I couldn’t run any of these without accounts and hosted repos, so all five are not run, listed from docs.

Tool Catches Best for Skip if Pricing (checked 27 Nov 2026) Link
CodeRabbit PR reviews with pre-merge checks and “slop detection”. Continuous security monitoring on Advanced and above Teams who want a review on every PR, in GitHub or GitLab You need the security features cheaply. They start on the Advanced tier ($72/user/mo billed annually) Free for public repos; Essentials $30/dev/mo ($24 annual); Team $60 ($48); Advanced $72 annual coderabbit.ai/pricing
GitHub Copilot code review PR reviews on GitHub.com and in IDEs, with suggested fixes, using repo-wide context Builders already paying for Copilot You’re not on GitHub, or you want review without AI-credit usage to watch Included from Copilot Pro ($10/mo); reviews use AI credits github.com/features/copilot/plans
Cursor Bugbot Background PR reviews focused on logic bugs, with custom rules Teams already using Cursor You want a predictable flat fee. It’s usage-based, at an average of $1.00–1.50 per review Usage-based; included in Premium ($30/mo) and above cursor.com/bugbot
Greptile PR reviews with codebase-wide context, and no seat fees Small teams with many reviewers but few PRs Your PR volume is high. Credits add up Starter free (1 dev, 50 credits/mo); Pro $1/credit (base review = 1 credit); Enterprise custom greptile.com/pricing
Claude Code Security Review A GitHub Action that has Claude review each PR for security issues, with false-positive filtering Repos where you want an AI security pass on every trusted PR You accept outside PRs. The README says it’s “not hardened against prompt injection attacks” Action free (MIT); you pay for Anthropic API usage github.com/anthropics/claude-code-security-review

My honest take: if you’re a solo builder, add one of these after the free deterministic stack above, not instead of it. A scanner gives the same answer every time. A reviewer bot sometimes has a great day.

A hand holding a small brass padlock against a dark background
A lock is only useful if you actually close it. Photo: Nathan Thomas / Pexels

Pre-commit guards: how do you stop it before the commit?

CI catches mistakes after they’re in history. A pre-commit hook stops them on your laptop, which matters more when an agent is making the commits. This is the config I ran:

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.30.1
    hooks:
      - id: gitleaks
  - repo: https://github.com/Yelp/detect-secrets
    rev: v1.5.0
    hooks:
      - id: detect-secrets
        args: ['--baseline', '.secrets.baseline']
  - repo: https://github.com/PyCQA/bandit
    rev: 1.9.4
    hooks:
      - id: bandit
        args: ['-ll']

Then detect-secrets scan > .secrets.baseline and pre-commit install. When I staged a new file with an OpenAI-style key and a shell=True helper, the commit failed on all three hooks. One upgrade I’d make: run pre-commit autoupdate --freeze, which pins each hook to a commit hash instead of a tag. After what happened to Trivy’s GitHub Action tags in March, tags are a suggestion, not a guarantee.

Tool Catches Best for Skip if Pricing (checked 27 Nov 2026) Link
pre-commit Runs any of the scanners above as git hooks, in isolated environments. Run: blocked our test commit Every repo, the moment an agent can commit for you Nobody on the team will keep hooks installed. Back it with the same checks in CI Free, MIT pre-commit.com

What should be on the pre-ship checklist for AI-written code?

Run through this before any AI-assisted change goes to production. It takes about ten minutes once the tools are set up.

  • History scanned for secrets with Gitleaks or TruffleHog. Any key that ever touched a commit is rotated, not just deleted.
  • Every new dependency is real. Check it exists, check who publishes it, and look at its age and download count before you install anything the model suggested.
  • Lockfile audited with OSV-Scanner, Trivy, npm audit or pip-audit, with no criticals left unexplained.
  • Static analysis is clean or triaged. Semgrep/Opengrep, plus Bandit for Python, with every SQLi, shell=True, eval and deserialisation finding fixed or justified in writing.
  • Every new endpoint has auth. The scanners above won’t tell you an admin route is public. Authentication and access control is the top root cause on the radar for a reason.
  • Outbound requests are constrained. No user-controlled URLs without an allowlist, and TLS verification stays on.
  • Containers don’t run as root, and base images are pinned and still supported.
  • Security tooling is pinned to versions or SHAs, including the scanners themselves.
  • A human read the diff. An AI reviewer is a bonus, not a substitute.

If you’re running agents with real permissions, the same thinking applies one level up. I wrote about why developers use agents daily but still don’t trust them, and the answer is verification, every time.

How this directory stays honest: the changelog

Security tools change pricing and ownership as fast as they ship detectors. Every refresh re-checks links and tiers, re-runs the open-source tools on the same test repo, and drops anything that stops earning its row.

Changelog: Winter 2026 edition, verified 27 Nov 2026; tools run on our test repo the same day; next refresh 27 Feb 2027.

Think a tool deserves a row, or caught me with a wrong price? Tell me. Vendors are welcome too, but rows still aren’t for sale.

Frequently asked questions

What is the best free secret scanner for AI-generated code?

Use Gitleaks for fast pre-commit and CI checks and TruffleHog when you want to know whether a leaked key actually works. In our test, TruffleHog found all five planted secrets including a database URL password that Gitleaks missed, so running both is cheap insurance.

Does deleting a leaked API key in a later commit make it safe?

No. The key stays in git history. Scanners that read history, such as Gitleaks and TruffleHog in git mode, will still find it, and so will anyone who clones the repo. Rotate the key with the provider, then clean history if you need to.

Can npm audit or pip-audit detect slopsquatting?

Not reliably. They match package names and versions against known advisories. pip-audit did flag our made-up package as not found on PyPI, but if an attacker had registered the name it would look like any clean package. Behaviour-based tools like Socket, or a manual check before installing, cover that gap.

Is Semgrep still free after its licence changes?

The Semgrep CLI is open source under LGPL-2.1, and the Semgrep platform is free for up to 10 contributors and 10 private repos. Opengrep is a fully open, Semgrep-compatible engine if you want an engine and community rules with no platform attached.

Should I use an AI code reviewer instead of static analysis?

No. Use one in addition. Deterministic scanners give the same answer every run and are free, while AI reviewers like CodeRabbit, Copilot code review, Bugbot and Greptile catch logic issues but don't guarantee coverage. Anthropic's own security-review action warns it isn't hardened against prompt injection.

How many CVEs have been linked to AI coding tools?

Georgia Tech reported 74 confirmed cases in April 2026. Its Vibe Security Radar listed 310 findings across 144 projects when we checked on 27 November 2026, and the researchers stress this is a lower bound limited to code that kept an AI signature.

Sources

  1. Bad Vibes: AI-Generated Code is Vulnerable, Researchers Warn Georgia Tech Research News
  2. Vibe Security Radar: CVEs traced to AI-generated code Georgia Tech SSLab
  3. How we verify · Vibe Security Radar Georgia Tech SSLab
  4. Vibe Coding's Security Debt: The AI-Generated CVE Surge Cloud Security Alliance
  5. We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs USENIX Security 2025
  6. Trivy ecosystem supply chain temporarily compromised (GHSA-69fq-xp46-6x23) Aqua Security / GitHub
  7. Gitleaks Gitleaks
  8. gitleaks-action README (licence key for organisations) Gitleaks
  9. TruffleHog pricing Truffle Security
  10. detect-secrets Yelp
  11. GitGuardian pricing GitGuardian
  12. GitHub Advanced Security plans and pricing GitHub
  13. GitHub Advanced Security license billing GitHub Docs
  14. OSV-Scanner Google
  15. Trivy Aqua Security
  16. pip-audit PyPA
  17. npm audit npm Docs
  18. Dependabot GitHub Docs
  19. Socket pricing Socket
  20. Snyk plans and pricing Snyk
  21. Semgrep pricing Semgrep
  22. Opengrep Opengrep
  23. Bandit documentation PyCQA
  24. CodeQL GitHub
  25. CodeQL CLI licence GitHub
  26. SonarQube plans and pricing Sonar
  27. CodeRabbit pricing CodeRabbit
  28. GitHub Copilot plans GitHub
  29. GitHub Copilot code review GitHub Docs
  30. Bugbot Cursor
  31. Cursor pricing Cursor
  32. Greptile pricing Greptile
  33. claude-code-security-review Anthropic
  34. pre-commit pre-commit

Found this useful?

Clap (up to 50×) so more people find it.

Written by

Noaman

Markdown version