v0.3.0 · GitHub Action · pre-commit · SARIFv0.3.0 · GitHub Action · pre-commit · SARIF

Your AI wrote it.
Verify it before you ship it.

代码是 AI 写的,
上线前先验证。

One command type-checks your project, runs the tests, finds hardcoded secrets, catches packages your assistant made up, and checks every dependency for known CVEs. It runs on your machine, needs no account and costs nothing.

一条命令:类型检查、跑测试、找出硬编码密钥、揪出 AI 编造的依赖包、检查每个依赖的已知漏洞。在你自己电脑上跑,不用注册,完全免费。

$pipx install git+https://github.com/LucasYanzy/vericode
MIT licensedMIT 开源 Python, Node, Go, Rust支持 Python / Node / Go / Rust Secrets never printed密钥默认打码

Is this package real?

这个包真的存在吗?

Paste a package name from AI-written code. This asks the real registry, the same way VeriCode does.

粘贴 AI 写的代码里的包名。这里会直接问真实的包注册表,和 VeriCode 的检查方式一样。

Try:试试:
Results appear here.结果会显示在这里。

Your browser asks pypi.org or npmjs.org directly. Nothing is sent to us.

由你的浏览器直接查询 pypi.org 或 npmjs.org,不会发送到我们这里。

One command一条命令

Everything an AI pull request can get wrong, in one run

AI 写的代码可能出错的地方,一次跑完

Code that looks right still breaks types, fails tests, leaks a key or installs a package nobody has ever published. VeriCode checks all of it before you commit.

看起来没问题的代码,照样可能类型不对、测试不过、泄露密钥,或者装了一个从来没人发布过的包。VeriCode 在你提交前把这些全查一遍。

~/projects/invoice-api

    
Why the package check matters为什么要查依赖包

AI assistants invent packages. Attackers register them.

AI 会编造包名,攻击者会抢注这些名字。

It's called slopsquatting. A model suggests pip install for a name that sounds right but doesn't exist. The same made-up names come back again and again, so an attacker only has to publish one and wait.

这叫 slopsquatting(AI 幻觉包抢注)。模型推荐 pip install 一个听起来很合理、但其实不存在的名字。同样的假名字会被反复推荐,攻击者只要抢先发布一个,然后等着就行。

21.7%
of packages suggested by open-source models didn't exist
开源模型推荐的包里,有这么多根本不存在
5.2%
on average, even for commercial models
即使是商用模型,平均也有这么多
205,474
unique made-up package names across 576,000 code samples
在 57.6 万段生成代码里出现的不重复假包名

Source: Spracklen et al., “We Have a Package for You!”, USENIX Security 2025. 16 code-generating models, Python and JavaScript.

来源:Spracklen 等,“We Have a Package for You!”,USENIX Security 2025。测试了 16 个代码生成模型,Python 和 JavaScript。

1. The model guessesYour assistant adds fastapi-auth-helper to requirements.txt. It sounds real.
1. 模型瞎猜AI 助手把 fastapi-auth-helper 写进 requirements.txt,名字听起来很真。
2. Someone registers itThe name was free, so an attacker publishes a package under it with an install script.
2. 有人抢注这个名字没人用,攻击者就用它发布一个带安装脚本的包。
3. You install itCI runs pip install -r requirements.txt. VeriCode would have stopped it at step 1.
3. 你装上了CI 执行 pip install -r requirements.txt。VeriCode 在第 1 步就会拦下。
What it checks检查什么

Four checks, zero setup

四项检查,零配置

VeriCode detects the project type and uses the tools you already have. If a tool isn't installed it says so instead of pretending the check passed.

VeriCode 自动识别项目类型,用你已经装好的工具。工具没装就直说跳过,不会假装检查通过。

👻

Hallucinated packages

AI 编造的包

Every package in requirements, pyproject.toml and package.json is looked up on PyPI or npm. Missing is critical, published in the last 30 days is high, one letter off a popular name is medium.

requirements、pyproject.toml、package.json 里的每个包都会去 PyPI 或 npm 查一遍。不存在是 critical,30 天内才发布是 high,和热门包只差一个字母是 medium。

critical fastapi-auth-helper does not exist medium numpi one letter from numpy
🔑

Hardcoded secrets

硬编码密钥

AWS, Stripe, GitHub, GitLab, Slack and npm tokens, private keys, JWTs and high-entropy strings. Values are masked in every output, so the report is safe to paste into a CI log.

AWS、Stripe、GitHub、GitLab、Slack、npm 令牌,私钥、JWT 和高熵字符串。所有输出里密钥值都会打码,报告可以放心贴进 CI 日志。

config.py:12 AWS Access Key AWS_KEY = "********"
🧪

Types and tests

类型检查和测试

mypy or pyright, tsc, go vet and cargo check, then pytest, npm test, go test or cargo test. It prefers the project's own virtualenv.

mypy 或 pyright、tsc、go vet、cargo check,然后跑 pytest、npm test、go test 或 cargo test。优先使用项目自己的虚拟环境。

typecheck pass mypy: no issues in 41 files tests fail 2 failed, 118 passed
🛡️

Known vulnerabilities

已知漏洞

Lockfiles for Python, Node, Go and Rust are checked against the free OSV database. No API key, no account, nothing to sign up for.

Python、Node、Go、Rust 的锁文件会对照免费的 OSV 漏洞库检查。不要 API 密钥,不要账号,什么都不用注册。

requests 2.19.0 GHSA-j8r2-6x86-q33q header leak
Automate it自动化

Stop it in CI. Or before the commit even happens.

在 CI 里拦下,甚至在提交之前就拦下

The GitHub Action fails the job and marks each finding on its line in the Security tab. The pre-commit hook blocks the commit on your laptop.

GitHub Action 会让任务失败,并在 Security 页面把每个问题标到具体那一行。pre-commit 钩子则直接在你电脑上拦下这次提交。

# .github/workflows/vericode.yml
name: VeriCode
on: [push, pull_request]
jobs:
  vericode:
    runs-on: ubuntu-latest
    permissions: { contents: read, security-events: write }
    steps:
      - uses: actions/checkout@v7
      - id: vericode
        uses: LucasYanzy/vericode@v0.3.0
      - if: always()
        uses: github/codeql-action/upload-sarif@v4
        with: { sarif_file: "${{ steps.vericode.outputs.sarif-file }}" }

SARIF 2.1.0 works with GitHub code scanning, GitLab, Azure DevOps and any SARIF viewer. Secret values are never written to it.

SARIF 2.1.0 可用于 GitHub 代码扫描、GitLab、Azure DevOps 和任何 SARIF 查看器,文件里永远不会写入密钥原文。

Security · Code scanning · VeriCodeSecurity · 代码扫描 · VeriCode
Critical Dependency does not exist依赖包不存在requirements.txt:7 · fastapi-auth-helper
High AWS Access Key hardcoded硬编码了 AWS Access Keyapp/config.py:12
High Dependency with a known vulnerability依赖有已知漏洞requirements.txt:3 · requests 2.19.0
Medium Name mimics a popular package包名在模仿热门包package.json:14 · expres → express
Compared对比

One tool instead of four

一个工具顶四个

VeriCodegitleaksSnykDependabotosv-scanner
Hallucinated / squatted packagesAI 编造 / 抢注的包✓————
Secret scanning密钥扫描✓✓✓——
Type-check and tests类型检查和测试✓————
Dependency CVEs依赖漏洞✓—✓✓✓
No account needed不需要账号✓✓—GitHub✓
SARIF + GitHub Action + pre-commitSARIF + Action + pre-commit✓✓no pre-commit无 pre-commit—✓

Check your project in 30 seconds

30 秒检查你的项目

Install it, run vericode . in any repository, and see what your AI left behind.

装好之后在任意仓库里运行 vericode .,看看 AI 给你留下了什么。

Star on GitHub去 GitHub 点个星 Check a package查一个包