Observed since 21 Oct, 10:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Catch AI-generated code mistakes before they cause problems
Catch AI-generated code mistakes before they cause problems.
A CLI tool that analyzes AI-generated code for hallucinations, security vulnerabilities, and outdated patterns. Get a confidence score before you commit!
66% of developers are frustrated with AI-generated code that's "almost right, but not quite"
45% say debugging AI code is more time-consuming than writing it themselves
20% of AI-generated code suggests non-existent packages (creating "slopsquatting" security risks)
62% of AI code contains security vulnerabilities, even from the latest models
AI Code Validator solves this by automatically detecting:
pip install or npm install thempip install ai-code-validator
# Check a single file
aivalidate check myfile.py
# Check entire directory
aivalidate check src/
# Check with JSON output (for CI/CD)
aivalidate check . --format json
# Install git pre-commit hook
aivalidate install-hook
==================================================================
🤖 AI CODE VALIDATOR - RESULTS
==================================================================
Confidence Score: 67/100 (FAIR)
Total Issues: 5
Critical: 2 | High: 1 | Medium: 1 | Low: 1
Recommendation:
⚠️ CRITICAL: Hallucinated dependencies detected! Do NOT install these packages.
==================================================================
🚨 CRITICAL ISSUES (2)
==================================================================
[HALLUCINATED_DEPENDENCY]
File: app.py:3
Package "ai-utils-helper" does not exist on PyPI
💡 Suggestion: AI may have hallucinated this package. This creates a "slopsquatting" security risk.
[SQL_INJECTION]
File: database.py:45
Potential SQL injection: String concatenation in SQL query
💡 Suggestion: Use parameterized queries or prepared statements instead
==================================================================
⚠️ HIGH SEVERITY ISSUES (1)
==================================================================
[MISSING_INPUT_VALIDATION]
File: api.py:23
User input without validation detected
💡 Suggestion: AI often omits input validation. Add validation before using user input.
# Single file
aivalidate check app.py
# Multiple files
aivalidate check app.py utils.py models.py
# Entire directory (recursively)
aivalidate check src/
# Current directory
aivalidate check .
# Only critical issues
aivalidate check . --severity critical
# Critical and high only
aivalidate check . --severity high
# All issues (default)
aivalidate check . --severity all
# Human-readable colored output (default)
aivalidate check .
# JSON output for parsing
aivalidate check . --format json
# Skip dependency checking (faster, but less thorough)
aivalidate check . --no-deps
# Install pre-commit hook
aivalidate install-hook
# Now runs automatically on git commit!
# To bypass (not recommended):
git commit --no-verify
AI Code Validator uses a multi-layer analysis approach:
.py).js, .jsx).ts, .tsx).java).kt)name: AI Code Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install AI Code Validator
run: pip install ai-code-validator
- name: Run validation
run: aivalidate check . --format json --severity high
ai-validation:
image: python:3.9
script:
- pip install ai-code-validator
- aivalidate check . --format json --severity high
Contributions are welcome! Here's how you can help:
# Clone the repository
git clone https://github.com/ashishmahawal/ai-code-validator.git
cd ai-code-validator
# Initialize development environment (installs deps + pre-commit hooks)
make init
# Or manually:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements-dev.txt
pip install -e .
pre-commit install
# Run tests
make test
# or: pytest tests/
# Run tests with coverage
make test-cov
# Run linters
make lint
# Format code
make format
See CONTRIBUTING.md for detailed contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
If this tool saved you from debugging AI-generated code, give it a star! ⭐
It helps others discover the project and motivates continued development.
Built based on research into AI code generation issues:
Made with ❤️ by developers frustrated with AI hallucinations
Don't let AI fool you. Validate before you commit!
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 16 Oct 2025 | 4 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 10:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c2eec6f280d7ac41042960a84a9f3b9ff8547e57ed1affd0abc930c6af0dbd36