Skip to main content

A pre-publish security analysis tool to detect AI hallucinated dependencies and slopsquatting

Project description

VibeScan ๐Ÿ”

VibeScan is a cross-platform, pre-publish security analysis tool built for the modern AI-assisted development era. It detects hallucinated dependencies, typosquatting ("slopsquatting"), and risky packages before they enter your codebase.

๐ŸŽฏ Why VibeScan?

As developers increasingly rely on LLM code generators, the risk of introducing non-existent or malicious packages has skyrocketed. VibeScan acts as your first line of defense, catching AI hallucinations and slopsquatting attempts before they reach production.

โœจ Features

  • ๐Ÿ”Ž Hallucination Detection: Verifies packages exist in npm and PyPI registries
  • ๐ŸŽญ Typosquatting Defense: Detects names similar to popular packages
  • ๐Ÿ“Š Risk Scoring: Assigns explainable risk scores (0-100) to each dependency
  • โšก Fast & Local: Runs in seconds without sending source code to remote servers
  • ๐Ÿ”„ Cross-Ecosystem: Supports both Python and Node.js projects
  • ๐ŸŽจ Beautiful Output: Color-coded results with clear explanations

๐Ÿ“ฆ Installation

Python (PyPI)

pip install vibescan

Node.js (npm)

npm install -g vibescan-js

๐Ÿš€ Usage

Command Line

Scan your current project:

vibescan

Scan a specific directory:

vibescan ./my-project

Enable debug output:

vibescan --debug

Pre-commit Hook

Add to your .pre-commit-config.yaml:

repos:
  - repo: local
    hooks:
      - id: vibescan
        name: VibeScan Security Check
        entry: vibescan
        language: system
        pass_filenames: false
        always_run: true

CI/CD Integration

GitHub Actions

name: Security Scan
on: [push, pull_request]

jobs:
  vibescan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.x'
      - name: Install VibeScan
        run: pip install vibescan
      - name: Run VibeScan
        run: vibescan

GitLab CI

vibescan:
  image: python:3.11
  script:
    - pip install vibescan
    - vibescan
  only:
    - merge_requests

๐Ÿ“Š Risk Scoring

VibeScan assigns risk scores based on multiple factors:

Score Severity Description
0-9 โœ… Safe No risks detected
10-59 โš ๏ธ Suspicious Review recommended
60-100 โŒ Critical Action required

Risk Factors

  • Package doesn't exist: +100 (likely AI hallucination)
  • Typosquatting detected: +60 (similar to popular package)
  • Suspiciously new (<7 days): +40
  • Relatively new (<30 days): +10

๐Ÿ” What It Checks

Supported Files

  • package.json (npm dependencies & devDependencies)
  • requirements.txt (Python packages)

Detection Capabilities

  1. Registry Verification: Checks if packages exist on npm/PyPI
  2. Typosquatting: Detects names similar to popular packages:
    • reactt โ†’ Similar to react
    • reqeusts โ†’ Similar to requests
  3. Age Analysis: Flags newly created packages
  4. Popularity Heuristics: Identifies suspicious low-usage packages

๐Ÿ“ Example Output

=========================================
              VibeScan                   
=========================================
Analyzing dependencies for AI hallucinations and slopsquatting...

Analyzing 5 dependencies...

โœ“ 3 Safe Dependencies

โš  1 Suspicious Dependencies (Review Recommended)
  - new-package (npm) - Score: 40/100
    * Package is suspiciously new (Created 2 days ago)

โŒ 1 Critical Risk Dependencies (Action Required!)
  - crypto-secure-hash-v2-hallucinated (npm) - Score: 100/100
    * Package does not exist in registry (Likely AI Hallucination/Slopsquat target)

-----------------------------------------
VibeScan detected CRITICAL risks. Build failed.

๐Ÿงช Development

Running Tests

# Install dev dependencies
pip install -e .
pip install pytest pytest-mock responses

# Run tests
pytest tests/ -v

Project Structure

vibescan/
โ”œโ”€โ”€ vibescan/
โ”‚   โ”œโ”€โ”€ cli.py              # Command-line interface
โ”‚   โ”œโ”€โ”€ parsers.py          # Package file parsers
โ”‚   โ”œโ”€โ”€ scorer.py           # Risk scoring logic
โ”‚   โ”œโ”€โ”€ reporter.py         # Output formatting
โ”‚   โ””โ”€โ”€ checkers/
โ”‚       โ”œโ”€โ”€ registry_checker.py   # Registry verification
โ”‚       โ””โ”€โ”€ typosquat_checker.py  # Typosquatting detection
โ”œโ”€โ”€ tests/                  # Test suite
โ”œโ”€โ”€ js-wrapper/            # Node.js wrapper
โ””โ”€โ”€ setup.py               # Python package config

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

MIT License - see LICENSE file for details

๐Ÿ”’ Privacy

VibeScan respects your privacy:

  • Analyzes code locally
  • Only sends package names to public registries for verification
  • No proprietary code is transmitted

๐ŸŽฏ Roadmap

  • Support for more package managers (Cargo, Go modules)
  • Static code analysis (AST) for unusual imports
  • Configurable risk thresholds
  • JSON output format
  • Web dashboard for team visibility
  • Integration with popular IDEs

๐Ÿ’ก Use Cases

  • Pre-commit: Catch risky dependencies before committing
  • CI/CD: Block PRs with suspicious packages
  • Code Review: Verify external contributions
  • Security Audit: Scan existing projects for risks

๐Ÿ™ Acknowledgments

Built to address the emerging threat of "slopsquatting" - malicious packages targeting AI-generated code suggestions.


Stay safe in the AI coding era! ๐Ÿ›ก๏ธ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibescan-0.1.0.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibescan-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file vibescan-0.1.0.tar.gz.

File metadata

  • Download URL: vibescan-0.1.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for vibescan-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07b4fefad130914151b560a89910488df80f6411f672c0e3d2968ce79ebd8992
MD5 6d168ebe9275300e82a891d7ee2bd0f2
BLAKE2b-256 c1a774aed185d2c57ed6b79b7391d7cedfa24dc26ba2857594995cbf19d02fb5

See more details on using hashes here.

File details

Details for the file vibescan-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vibescan-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for vibescan-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a9eff59cf8fd9690d254bcb505a38ce1df001a944a91910102d445f67262729
MD5 3c0517bc2d3ab18b960ca6c07f5e0b13
BLAKE2b-256 f797256c29d3aff229f3b63d4f459df1549e19a3d141b735039854d36856b7d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page