____ ____ ____ _____ ____
/ ___/ __ \| __ )| ____| _ \
\___ \ | | | _ \| _| | |_) |
___) | |_| | |_) | |___| _ <
|____/\____/|____/|_____|_| \_\
๐ธ sober
The Vibe Coding Hangover Cure
Audit, sanitize, and proofread AI-generated code before pushing to production. Zero bloat. Maximum Flow.๐ Table of Contents
- โก The Problem: The Vibe Coding Hangover
- ๐ What is Sober?
- ๐ Core Detection Pillars
- โก Quick Start Guide
- ๐ป CLI Usage & Commands
- ๐ Real-Time Live Watcher (
sober watch) - ๐ค Agent Self-Healing Remediation (
sober explain) - โ๏ธ Configuration (
sober.toml) - ๐ก๏ธ Native Git Hooks & CI/CD SARIF
- ๐๏ธ Architecture
- ๐ค Contributing
โก The Problem: The Vibe Coding Hangover
You just spent 3 hours vibe-coding with Claude Code, Cursor, Windsurf, or Copilot. Your prototype spins up blindingly fast, but you have that familiar, sinking feeling:
- Did the AI hallucinate a typosquatted package like
reqeustsornummpythat leaves you vulnerable to slopsquatting supply-chain malware? - Did it invoke
requests.get()orfetch()without a timeout, causing production processes to hang forever on network stalls? - Did it generate authentication tokens using insecure
random.randint()orMath.random()? - Did it directly interpolate untrusted user strings into LLM prompt templates (
f"...{user_msg}..."), opening prompt injection vulnerabilities? - Did it leave 15 leftover
print(f"DEBUG: ..."),console.log("HERE"), markdown code fences, anddebugger;statements in production files? - Did it embed conversational assistant comments like
// Certainly! Here is the updated code...in source files? - Did it silently swallow fatal database errors with
except: passor emptycatch {}blocks? - Did it commit a live OpenAI, Anthropic, Gemini, Groq, Supabase, Stripe, or Hugging Face API key directly into your git history?
- Did it disable TLS certificates (
verify=False) or introduce unsafe deserialization vectors? - Did it re-invent helper functions that already existed in your repository three folders away?
Standard git diff was built for humans reviewing 5-line editsโnot humans auditing 500-line multi-file AI rewrites.
Enter sober.
๐ What is Sober?
sober is an ultra-fast, zero-config CLI that audits your uncommitted git changes, branches, or entire repositories in <200ms. It detects AI-introduced hallucinations, slopsquatting, reliability antipatterns, conversational chatter, slop residue, silent error swallows, duplicate logic, and secret leaks, providing a crystal-clear Sober Score (0โ100%) before you push to production.
๐ Core Detection Pillars
| Pillar | Detection Engine | Severity |
|---|---|---|
| ๐งช Hallucination & Slopsquatting | Cross-references new imports against local manifests, live PyPI/npm registries, and Damerau-Levenshtein similarity to popular libraries (e.g. reqeusts vs requests). |
CRITICAL |
| ๐ก๏ธ Dangerous AI Antipatterns | Catches omitted HTTP timeouts (requests.get, fetch), insecure pseudo-random tokens (random.choice), prompt injection vectors (f"...{user_input}..."), and client-side system prompt leakage. |
HIGH / CRITICAL |
| ๐ Secrets & Leaks | Catches hardcoded OpenAI, Anthropic, Gemini, Groq, Supabase, Hugging Face, GitHub PATs, AWS, Stripe Live, Pinecone, Slack, Discord, SendGrid, and trivial default passwords. | CRITICAL |
| ๐ก๏ธ Vulnerability Vectors | Detects raw SQL string formatting, shell=True command injection, disabled TLS/SSL (verify=False), unsafe pickle/YAML deserialization, and trivial JWT secrets. |
HIGH |
| ๐ป Ghost Code & Error Swallows | Flags blank except: pass, empty catch {} blocks, empty promise catches, and dangling debugger; breakpoints. |
HIGH |
| ๐ค AI Conversational Chatter | Detects assistant prompt leakage and conversational text (Certainly! Here is..., As an AI language model..., Let me know if you need adjustments). |
LOW (Auto-Cureable) |
| ๐งฉ AST Duplication | Catches AI agents re-inventing existing project helper utilities across files instead of importing them. | MEDIUM |
| ๐งน Debug Debris & Fences | Finds temporary print(f"DEBUG..."), console.log("here"), lingering breakpoints, and stray markdown code fences. |
LOW (Auto-Cureable) |
โก Quick Start Guide
Installation
Install directly via pip:
pip install sober-audit
Or run directly with pipx or uv:
pipx install sober-audit
# or
uv tool install sober-audit
๐ป CLI Usage & Commands
1. Default Working Tree Audit
Audit your staged and uncommitted git changes instantly:
sober scan
2. Air-Gapped Offline Audit (--offline)
Perform zero-network audits verifying dependencies strictly against local manifests and disk cache:
sober scan --offline
3. Auto-Cure AI Residue & Chatter
Automatically strip leftover debug print statements, console logs, dangling debuggers, stray markdown fences, and AI chatter comments:
sober scan --cure
# or via standalone cure command:
sober cure
4. Git Commit Range & PR Branch Auditing (diff)
Audit changes introduced across a PR branch or commit range:
# Audit changes between main and current branch
sober diff main..HEAD
# Audit the last commit
sober diff HEAD~1
5. Full Repository Scan
Scan all files in the project instead of just git diff changes:
sober scan --all
6. Strict Mode (Pre-Commit / CI)
Fails with exit code 1 if your Sober Score is below threshold (default: 95%) or if any critical issues are found:
sober scan --strict
# Custom threshold:
sober scan --strict --min-score 90
7. GitHub Security SARIF & PR Markdown Export
Generate SARIF 2.1.0 for GitHub Code Scanning or Markdown summary tables for automated PR review comments:
# Output SARIF format for GitHub Security tab
sober scan --sarif > sober-results.sarif
# Output GitHub Markdown table for PR comments
sober scan --markdown
8. Native Zero-Dependency Git Hook Manager
Install an automated pre-commit hook directly into .git/hooks/pre-commit:
# Install hook
sober hook install
# Check hook status
sober hook status
# Remove hook
sober hook uninstall
9. Automated GitHub Actions CI Workflow Setup
Bootstrap .github/workflows/sober-guard.yml in one command:
sober ci init
10. Project Configuration Initialization
Generate a starter sober.toml configuration file:
sober init
๐ Real-Time Live Watcher (sober watch)
Keep a live HUD open alongside your editor while vibe-coding with Cursor, Windsurf, or Claude Code:
sober watch
# Custom polling interval:
sober watch --interval 0.5
# Auto-cure debris on save:
sober watch --cure
Whenever files are saved, sober immediately re-audits the project and updates your sobriety score in real-time.
๐ค Agent Self-Healing Remediation (sober explain)
Feed diagnostic audit context directly back to your AI coding agent (Claude Code, Cursor Agent, Copilot Workspace, Aider, Devin):
sober explain
# Or pipe directly to clipboard / agent:
sober explain | your-agent-fixer
Outputs a high-density, zero-hallucination directive containing exact file locations, code snippets, and unambiguous surgical instructions to fix every defect.
โ๏ธ Configuration (sober.toml)
Configure sober on a workspace or project level using sober.toml or pyproject.toml ([tool.sober]):
# sober.toml (v2.0)
[sober]
min_score = 95.0
fail_on_critical = true
max_workers = 10
offline_mode = false
# Paths to ignore during audits
ignore_paths = [
"tests/*",
"docs/*",
"migrations/*",
]
# Allowed internal or proprietary packages that should never trigger hallucination alerts
allowed_packages = [
"@my-org/*",
"internal_company_sdk",
]
# Disable specific detectors if needed
# disabled_detectors = ["duplicates"]
# Custom proprietary secret regex patterns
# [[sober.custom_secret_patterns]]
# name = "Company Internal API Token"
# pattern = "comp_[A-Za-z0-9]{32}"
๐ก๏ธ Native Git Hooks & CI/CD SARIF
Native Pre-Commit Hook
Install sober directly into your repository with zero third-party dependencies:
sober hook install
Now, every git commit automatically triggers sober scan --strict, preventing AI slop or accidental credential leaks from ever entering git history!
One-Command GitHub Actions CI Generator
sober ci init
Generates .github/workflows/sober-guard.yml:
name: SOBER Code Sobriety Radar
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
jobs:
sober-audit:
name: AI Hangover & Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install SOBER
run: pip install git+https://github.com/shenald-dev/sober.git
- name: Run SOBER Audit (SARIF & Markdown)
run: |
sober scan --all --sarif > sober.sarif
sober scan --all --markdown > sober-summary.md
cat sober-summary.md >> $GITHUB_STEP_SUMMARY
continue-on-error: true
- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: sober.sarif
category: sober-hangover-guard
- name: Strict Sobriety Gate
run: sober scan --all --strict --min-score 90
๐ Telemetry & The Sober Score
โโโโโโโโโโโโโโโโโโโโโโโโ ๐ SOBRIETY HEALTH TELEMETRY โโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Sober Score: 100% [A+] โ
โ State: ๐ง Crystal Sober (Production Ready) โ
โ โ
โ โข Critical Issues: 0 โข High: 0 โข Medium: 0 โข Low (Debris): 0 โ
โ โข Auto-Fixable with --cure: 0 โ
โ โ
โ Scanned 18 files in 0.11s. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- 95% โ 100% โ
๐ง Crystal Sober: Production ready, strictly typed, pristine flow. - 80% โ 94% โ
โ Mild Buzz: Minor debug debris or unaddressed stubs detected. - 60% โ 79% โ
๐ธ Noticeable Hangover: Review required. High-risk patterns found. - < 60% โ
๐จ Complete Blackout: Critical security vulnerabilities or hallucinated dependencies. Do NOT deploy.
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Git Workspace / Targetโ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Scanner & Diff Engine โ (Uncommitted changes,
โ (git status & ranges) โ commit diffs, or all)
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ Manifest Inspector โ โ Disk Registry โ โ Config Engine โ
โ (package.json/pyproj)โ โ Cache (TTL) โ โ (sober.toml loader) โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ โโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโฌโโโโโดโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Detection Pillar Pool โ
โ โข Slopsquatting / PyPI โ
โ โข Dangerous Antipatternsโ
โ โข Secrets & Webhooks โ
โ โข AI Chatter & Fences โ
โ โข Silent Error Swallows โ
โ โข AST Duplication โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Sobriety Radar โ โ Live Vibe Watch โ โ Agent Remediationโ
โ โข Terminal HUD โ โ โข File monitor โ โ โข sober explain โ
โ โข SARIF 2.1.0 โ โ โข Real-time HUD โ โ โข Self-healing โ
โ โข Markdown PR โ โ โข Auto-cure โ โ directive โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
๐ค Contributing
Contributions are welcome! Please open an issue or PR on GitHub.
git clone https://github.com/shenald-dev/sober.git
cd sober
pip install -e ".[dev]"
pytest
ruff check .
๐ License
MIT License. Designed and built with โค๏ธ by shenald-dev.
Metadata
Release files for sober-audit 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sober_audit-2.0.0.tar.gz | 55.7 kB | Without provenance | Details for sober_audit-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sober_audit-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for sober_audit-2.0.0-py3-none-any.whl |
Total release size: 103.9 kB
Release files / sober_audit-2.0.0.tar.gz
| Download URL | sober_audit-2.0.0.tar.gz |
|---|---|
| Size | 55.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2d87dfc3cf3123ce56badbb0681afcdfa6a85416578ca6ebaf64800f47ac2b9
|
|
BLAKE2b-256 checksum How to use checksums |
cabae6e1789c6fb403b37b935a59a84be353286454d8f1a95a5dc414cf9957a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Release files / sober_audit-2.0.0-py3-none-any.whl
| Download URL | sober_audit-2.0.0-py3-none-any.whl |
|---|---|
| Size | 48.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfc5d7eccfaf8aa1827b0c6f9e94d578d3ff865986f6bc992d7ab0d6d9344fcc
|
|
BLAKE2b-256 checksum How to use checksums |
cae94128fc7f7332b8a93024aabdf19d6466df3c05fe5ac0ebe4254170da0568
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Security for sober-audit 2.0.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.