🔍 Open Source · MIT · Zero Config

Your AI coder is hallucinating.
Here's the proof.

Claude, Copilot, Cursor, ChatGPT — they all invent functions, leak API keys, and use deprecated APIs. aiverify catches it in 3 seconds. pip install aiverify-cli

...
GitHub Stars
👁️ ...
Repo Visitors
🔍 15
Detection Rules
🌐 3
Languages Supported

Why aiverify?

15 tree-sitter-powered rules that catch what traditional linters miss. Built specifically for AI-generated code.

🧠

Hallucination Detection

Catches invented function names, phantom imports, and API calls that don't exist. AI models hallucinate 15-30% of code — aiverify proves it.

🔑

Credential Leak Prevention

Detects hardcoded API keys (sk-...), passwords, AWS secrets, database URLs, and tokens before they ship to production.

🌳

Tree-Sitter AST Parsing

Not regex. Full Abstract Syntax Tree parsing — the same engine used by VS Code. Accurate, false-positive-free analysis.

⏱️

3-Second Scans

Zero configuration. Point at any Python, JavaScript, or TypeScript file and get results instantly. Perfect for pre-commit hooks.

🔌

CI/CD Native

JSON output with --json, exit code 0/1, and GitHub Actions integration. Block AI-hallucinated code from shipping automatically.

🆓

Free & Open Source

MIT licensed. Zero cost. Zero API keys. Built by a solo founder who got tired of debugging AI-generated code in production.

15 Detection Rules

Every rule uses tree-sitter AST queries — not fragile regex — for accurate, reliable detection with minimal false positives.

🐍 Python

PY001unused-import — Imported module never used anywhere in the file
PY002hallucinated-func — Function called but not defined, imported, or built-in
PY003deprecated-api — pkg_resources, distutils, imp, inspect.getargspec, logging.warn
PY004wrong-arg-order — Duplicate keyword args, suspicious argument patterns
PY005type-mismatch — str + int, len() compared to string, integer dict keys

🌐 JavaScript / TypeScript

JS001unused-import — Imported symbol never referenced
JS002hallucinated-func — Function call with no definition or import
JS003deprecated-api — substr(), createClass, console.exception, Array.observe
JS004wrong-arg-order — Callback params swapped: (data, error) instead of (error, data)
JS005null-undefined — Property access on variables without null checks

🔧 Generic (All Languages)

GEN001hardcoded-creds — API keys, passwords, tokens, database connection strings
GEN002infinite-loop-risk — while True without break or return in reachable path
GEN003unused-variable — Variable assigned but never read
GEN004commented-deadcode — Large blocks of commented-out code (failed AI generation)
GEN005magic-number — Same numeric literal 3+ times with no named constant

How It Works

Tree-sitter parses your code into an AST. Rules inspect the AST for patterns unique to AI-generated code.

Parse

aiverify reads your file and builds a full Abstract Syntax Tree using tree-sitter — the same parser used by VS Code, GitHub, and modern IDEs.

Analyze

15 rules run against the AST, each looking for specific patterns: invented functions, deprecated APIs, type mismatches, hardcoded credentials, and more.

Report

Color-coded results with file paths and line numbers. JSON output for CI/CD. Exit code 1 blocks bad code from shipping.

aiverify vs Alternatives

Existing linters find style issues. aiverify finds the issues that prove your code was written by an AI.

Featureaiverifypylintflake8eslintsemgrep
AI hallucination rules✅ 15 rules
Invented function detection
Hardcoded credentials
Infinite loop detection
Commented dead code
Magic number detection
Tree-sitter AST (not regex)
Zero config, 3s scans
Python + JS + TS🐍 only🐍 only🌐 only

FAQ

Everything you need to know about aiverify.

aiverify is a free, open-source CLI tool that detects AI hallucinations in code. It scans Python, JavaScript, and TypeScript files using tree-sitter AST parsing and catches issues like invented functions, deprecated APIs, hardcoded credentials, type mismatches, and infinite loops.
aiverify works with code generated by any AI assistant — Claude (Sonnet, Opus), GitHub Copilot, Cursor, ChatGPT (GPT-4, GPT-4o), Tabnine, Replit AI, Amazon CodeWhisperer, Codex, and more. It doesn't matter which AI wrote the code — aiverify finds the telltale patterns of AI generation.
Traditional linters find style and syntax issues — unused variables, missing semicolons, formatting problems. aiverify specifically targets AI hallucination patterns: invented function names that don't exist, deprecated APIs that AIs frequently suggest, swapped argument orders, hardcoded credentials, infinite loops, and blocks of commented-out dead code. These are patterns unique to AI-generated code that traditional linters completely miss.
Install: pip install aiverify-cli (PyPI package name, requires Python 3.11+). The CLI command is aiverify. Then run: aiverify your-code.py. To scan a directory: aiverify src/. For CI/CD: aiverify src/ --json. To filter specific rules: aiverify app.py --rules PY002 GEN001.
Yes, completely free and open source under the MIT license. This is a solo founder project — it's supported by GitHub Sponsors. If aiverify saves you time or prevents a production incident, please consider sponsoring or starring the repo.
No. aiverify uses tree-sitter, the same parsing engine used by VS Code, GitHub, and modern IDEs. Tree-sitter builds a full Abstract Syntax Tree (AST) for accurate, reliable analysis with minimal false positives. Regex-based parsing is fragile and breaks on formatting changes — aiverify doesn't use it.
Yes. aiverify supports --json flag for machine-readable output and returns exit code 0 (clean) or 1 (issues found). It integrates natively with GitHub Actions, GitLab CI, pre-commit hooks, and any CI/CD system. See the GitHub README for CI configuration examples.
Currently: Python (.py), JavaScript (.js, .jsx), and TypeScript (.ts, .tsx). Go, Rust, Java, and Ruby support are on the roadmap — the more stars and community interest, the faster they ship.

Install in 3 Seconds

One command. No dependencies beyond Python 3.11+. Works on Linux, macOS, and Windows.

pip install aiverify-cli

Then run: aiverify your-code.py

or scan a whole project: aiverify src/

📎 Embed badge in your README [![aiverify](https://img.shields.io/badge/verified%20with-aiverify-58a6ff?style=flat-square)](https://fmathenomad.github.io/aiverify/)

Help Others Discover aiverify

If this tool saves you time, share it with your community.

Usage

Designed for both local development and automated CI/CD pipelines.