Stop API key leaks, eliminate LLM code bloat, and verify regression tests before any commit or push hits GitHub.
Why • Privacy & Zero Retention • Demo • Architecture • Quickstart • The 5 Laws • Supported Agents • CI/CD
Autonomous AI coding agents (Claude Code, Google Antigravity, Cursor, Windsurf, OpenCode, Codex, Devin) write code 10x faster than humans.
However, they introduce three critical enterprise risks:
- Accidental Secret Leaks: Agents generate inline
sk-ant-...,sk-...,AKIA..., orgsk_...keys during rapid local debugging and push them straight into public repositories. - LLM Code Slop & Bloat: Agents invent speculative abstractions, leave commented-out draft code, generate redundant wrapper helpers, and import heavy packages for tasks solved by standard library one-liners.
- Silent Test Regressions: Fast iterations break subtle edge cases that never get caught until CI fails or production crashes.
pre-push-verify fixes this permanently. It acts as an uncompromising pre-push and pre-commit firewall. It analyzes only the working git diff HEAD, scans for 30+ secret patterns with Shannon entropy detection, enforces the 5 Ponytail Pruning Laws, executes your project's native test suite, and blocks the push if anything fails.
Your code, your credentials, and your intellectual property NEVER leave your machine.
Unlike cloud-based linters or SaaS security scanners that upload your codebase and diffs to external ingestion servers, pre-push-verify is built from the ground up on a 100% Local-First, Zero-Trust Architecture:
| Security Invariant | Guarantee | Technical Implementation |
|---|---|---|
| 0% Data Retention | Guaranteed | No files, diffs, AST logs, code hashes, or detected credentials are ever stored in remote databases or disks. |
| 100% Local CPU Execution | Guaranteed | All regular expressions, Shannon entropy calculations, and test runners execute exclusively in the local machine process. |
| Zero Telemetry / No Tracking | Guaranteed | Absolutely no tracking pixels, analytics beacons, Sentry, Mixpanel, or phone-home pings. Completely air-gap compatible. |
| In-Memory Masking | Guaranteed | All detected secret tokens are redacted (***REDACTED***) before printing to terminal output or JSON, preventing terminal history and CI log pollution. |
| Enterprise Compliance | Ready | Safe for use in strictly regulated environments: SOC2, HIPAA, GDPR, ISO 27001, defense, and banking. |
$ pre-push-verify --strict========================================================================
___ ___ ___ ___ _ _ ___ _ _ __ _____ ___ ___ _____ __
| _ \ _ \ __| _ \ | | / __| || | \ \ / / __| _ \_ _| __\ \ / /
| _/ / _|| _/ |_| \__ \ __ | \ V /| _|| /| || _| \ V /
|_| |_|_\___|_| \___/|___/_||_| \_/ |___|_|_\___|_| |_|
========================================================================
Automated Agent Security & Anti-Slop Verification Gate
[🔒 100% Local-First • 🛡️ 0% Data Retention • Zero External Telemetry]
========================================================================
🔍 [1/3] Scanning git diff for secrets & credential leaks...
✓ 0 secrets found. Clean!
✂️ [2/3] Inspecting diff for AI code bloat (Ponytail Laws)...
⚠️ [PRUNE] Found 1 opportunity to cut bloat:
- [Line 42]: [DELETE] Temporary debug print statement found in diff.
💡 Run pruning to keep diff lean and maintainable.
🧪 [3/3] Running automated regression tests...
Detected runner: pytest
Command: pytest tests/ -q
.................................................. [100%]
✓ Tests passed successfully (14 passed in 0.11s)
========================================================================
🚀 VERIFICATION PASSED — "Lean already. Ship."
========================================================================
flowchart TD
A[Agent or Developer executes git push] --> B[pre-push-verify Gate]
subgraph STAGE 1: Secret Leak Scanner
B --> C{Scan Working Diff}
C -->|Pattern Detected| D[🚨 CRITICAL: Secret Leak Blocked]
C -->|Clean| E[Entropy & Heuristic Check]
E -->|High Entropy Token| D
E -->|Safe Placeholders| F[Stage 1 Passed]
end
subgraph STAGE 2: Ponytail Anti-Slop Review
F --> G{Inspect 5 Pruning Laws}
G -->|Debug prints / comments / dead wrappers| H[⚠️ Pruning Recommendations]
G -->|Strict Mode & Violations| I[🛑 Rejected: Code Bloat]
G -->|Diff is Lean| J[Stage 2 Passed]
end
subgraph STAGE 3: Adaptive Test Engine
J --> K{Detect Project Ecosystem}
K -->|Python| L[pytest / unittest]
K -->|Node / TypeScript| M[npm test / pnpm / yarn / vitest]
K -->|Rust| N[cargo test]
K -->|Go| O[go test ./...]
L & M & N & O --> P{All Green?}
P -->|Fail| Q[❌ Build Broken: Push Aborted]
P -->|Pass| R[Stage 3 Passed]
end
R --> S[🎉 All Gates Green: Proceed to Git Push]
You can use pre-push-verify in 3 distinct modes:
Install the agent skill into your workspace so Claude Code, Antigravity, OpenCode, or Cursor can invoke it autonomously before pushing:
# In your project repository:
mkdir -p .agents/skills/pre-push-verify
curl -sSL https://raw.githubusercontent.com/jeevesh2515/pre-push-verify/main/skills/pre-push-verify/SKILL.md \
-o .agents/skills/pre-push-verify/SKILL.mdNow, prompt your agent or type the slash command:
"/pre-push-verify"or"verify security and run pre-push checks"
The agent will automatically scan the diff, prune dead code, run tests, and only push if 100% clean!
Prevent anyone (including yourself and local agents) from pushing bad code to GitHub:
# Option A: Via Python CLI
pip install git+https://github.com/jeevesh2515/pre-push-verify.git
pre-push-verify --install-hook
# Option B: Via NPX (Node / JS environments)
npx pre-push-verify --install-hookThis installs .git/hooks/pre-push. Whenever git push runs, pre-push-verify executes automatically!
# Install locally
git clone https://github.com/jeevesh2515/pre-push-verify.git
cd pre-push-verify
pip install -e .
# Run manual verification
pre-push-verify
# Enforce strict zero-warning mode
pre-push-verify --strict
# Skip long-running tests during rapid local iterations
pre-push-verify --skip-tests
# Output machine-readable JSON for agent parsing
pre-push-verify --jsonInspired by the Ponytail philosophy ("The best code is the code never written"), pre-push-verify actively guards against LLM over-engineering:
| Law | Principle | What Gets Flagged & Pruned |
|---|---|---|
1. delete |
Dead Code & Speculative Features | Unused variables, leftover debug logs (console.log, print()), commented blocks, speculative abstractions built for hypothetical future needs. |
2. stdlib |
Reinvented Wheels | Custom padding/math/datetime/path helpers when pathlib, itertools, collections, or native JS URL/Array already solve it. |
3. native |
Platform Over Dependency | Heavy external npm/pip packages imported for single operations where standard browser/Node/Python primitives suffice. |
4. yagni |
Premature Abstractions | Single-implementation interfaces, 3-layer deep wrapper classes, factory patterns around single functions. |
5. shrink |
Logic Condensation | Verbose 20-line if-else ladders that can be written in 3 clear, idiomatic lines without sacrificing readability. |
Non-Negotiable Safety Invariants:
pre-push-verifynever cuts security checks, tenant-isolation filters (tenant_id), error handling, or test assertions.
pre-push-verify detects high-risk credentials across all major AI and Cloud providers before they leak:
- AI Providers: OpenAI (
sk-...), Anthropic (sk-ant-...), Groq (gsk_...), HuggingFace (hf_...), Cohere, Pinecone - Cloud Infrastructure: AWS (
AKIA...), Google Cloud Service Accounts, Azure Client Secrets - Payment & SaaS: Stripe Live Keys (
sk_live_...), GitHub PATs (ghp_...), GitLab Personal Tokens, Slack Tokens, Discord Bots - Databases & Crypto: Postgres / MySQL / MongoDB connection URIs, RSA/SSH/PGP Private Key Headers
- Heuristic Engine: Shannon Entropy calculation for unstructured base64/hex token detection.
| Agent / Tool | Integration Method | Capability |
|---|---|---|
| Google Antigravity | .agents/skills/pre-push-verify |
Native Slash Command /pre-push-verify |
| Claude Code | ~/.claude/commands/pre-push-verify |
Slash Command /pre-push-verify |
| Cursor / Windsurf | Pre-push Git Hook | Automatic gate before push from editor |
| GitHub Actions | CI Workflow | Pull Request and Branch Protection Gate |
| OpenCode / Codex | CLI execution | Subprocess & Tool Calling verification |
Add pre-push-verify to your GitHub Actions workflow to block PRs containing secrets or slop:
# .github/workflows/verify.yml
name: Pre-Push Verify Gate
on: [push, pull_request]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install pre-push-verify
run: pip install git+https://github.com/jeevesh2515/pre-push-verify.git
- name: Run Verification
run: pre-push-verify --strictContributions are warmly welcomed! If you want to add new secret patterns, support new test runners, or refine Ponytail pruning heuristics:
- Fork the repo (
https://github.com/jeevesh2515/pre-push-verify) - Create your feature branch (
git checkout -b feature/new-scanner) - Commit your changes (
git commit -m 'feat: add Databricks token scanner') - Verify tests pass (
pytest tests/ -v) - Push to the branch (
git push origin feature/new-scanner) - Open a Pull Request!
If pre-push-verify saved your repository from an API key leak or pruned AI slop from your codebase, please consider giving this repo a star ⭐️! It helps other AI engineers discover the project.
Distributed under the MIT License. See LICENSE for details.
Built with passion for the AI Engineering community by Jeevesh Singale.