Skip to main content

vibesafex

CI Python 3.9+ License: Apache 2.0 PyPI

Stop shipping AI-generated code you haven't reviewed.

vibesafex catches the bugs your AI coding agent won't tell you about: hallucinated imports, hardcoded secrets, security vulnerabilities, and dead code.

Built for the vibe coding era. Works with code from Claude Code, Cursor, Copilot, Windsurf, and any AI coding tool.

Quick Start

pip install vibesafex
vibesafex scan .

What It Catches

Code Category Severity What
VS100-VS110 Security error eval(), exec(), shell=True, SQL injection, os.system(), unsafe YAML, weak hashes
VS200-VS210 Secrets error OpenAI/AWS/GitHub/Anthropic/Stripe API keys, private keys, JWTs, hardcoded credentials
VS300 Imports warning Hallucinated imports — packages that don't exist (AI's favorite mistake)
VS400-VS403 Dead Code warning Unused imports, unreachable code, empty except: pass, bare except
VS500-VS507 AI Patterns warning TODO/FIXME left by AI, placeholder functions, NotImplementedError stubs, mutable defaults, star imports

Usage

Scan a directory

vibesafex scan src/

Scan specific files

vibesafex scan main.py utils.py

Check code from stdin

echo 'x = eval(input())' | vibesafex check

JSON output (for CI/CD)

vibesafex scan . --format json

Filter by severity

vibesafex scan . --severity error          # Only errors
vibesafex scan . --fail-on warning         # Fail CI on warnings too

Python API

from vibesafex import scan_code, scan_file, scan_directory

# Scan a string
issues = scan_code('x = eval(input())')
for issue in issues:
    print(f"{issue.code}: {issue.message}")

# Scan a file
issues = scan_file("main.py")

# Scan a project
result = scan_directory("src/")
print(f"{result.error_count} errors found in {result.files_scanned} files")

Custom scanner configuration

from vibesafex import Scanner

scanner = Scanner(
    severity_threshold="warning",  # Skip info-level
    exclude_dirs={".venv", "migrations"},
)
result = scanner.scan_directory(".")

Example Output

vibesafex scan report vibesafex checks
  ✗ main.py:5:0 [error] VS100: Use of eval() - potential code injection vulnerability
  ✗ main.py:8:0 [error] VS200: Possible OpenAI API key
  ⚠ main.py:12:0 [warning] VS300: Import 'magic_ai_lib' - package 'magic_ai_lib' not found (hallucinated import?)
  ⚠ main.py:15:0 [warning] VS501: Function 'process' has empty body (pass) - placeholder
  ℹ main.py:20:0 [info] VS500: TODO comment - AI may have left incomplete implementation

5 files scanned: 2 errors, 2 warnings, 1 info

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: vibesafex
        name: vibesafex
        entry: vibesafex scan --fail-on error
        language: python
        types: [python]
        additional_dependencies: [vibesafex]

Why Not Just Use Ruff/Pylint?

vibesafex focuses specifically on AI-generated code patterns that traditional linters miss:

  • Hallucinated imports: AI confidently imports packages that don't exist. vibesafex checks against stdlib, installed packages, and 200+ known popular packages.
  • Secret leakage: AI copies real-looking API keys into code. vibesafex detects patterns for 12+ providers.
  • Placeholder code: AI leaves pass, ..., NotImplementedError stubs that slip through review.
  • AI anti-patterns: Mutable defaults, star imports, excessive Any — patterns AI generates more often than humans.

Use vibesafex alongside your existing linter, not instead of it.

See Also

Part of the stef41 LLM toolkit — open-source tools for every stage of the LLM lifecycle:

Project What it does
tokonomics Token counting & cost management for LLM APIs
datacrux Training data quality — dedup, PII, contamination
castwright Synthetic instruction data generation
datamix Dataset mixing & curriculum optimization
toksight Tokenizer analysis & comparison
trainpulse Training health monitoring
ckpt Checkpoint inspection, diffing & merging
quantbench Quantization quality analysis
infermark Inference benchmarking
modeldiff Behavioral regression testing
injectionguard Prompt injection detection

License

Apache 2.0

Metadata

Release files for vibesafex 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vibesafex 0.3.0
File Size Uploaded Provenance
vibesafex-0.3.0.tar.gz 36.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for vibesafex 0.3.0
File Interpreter ABI Platform
vibesafex-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.8 kB

Release files / vibesafex-0.3.0.tar.gz

Download URL vibesafex-0.3.0.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c252a1996313fa1e570a885087ea9e3cc2e8e5a509d51934639986a9f487d13e
BLAKE2b-256 checksum
How to use checksums
6bf07cd84a625f110657ea6c5430665ec95dfeeeceef88c214b6edc826472b05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / vibesafex-0.3.0-py3-none-any.whl

Download URL vibesafex-0.3.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8de8348ea7a53e6c003079792bf80a143968c058e0b3908822526b4e123cb2c7
BLAKE2b-256 checksum
How to use checksums
c7b5980a7a30c860ce076568c2ecc684421fd0da7dcc32f03096e9c19ed2782d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for vibesafex 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page