DEV Community

Aaditya Singh
Aaditya Singh

Posted on Edited on

I built a zero-API-key, <50ms CLI to catch what coding agents quietly break

Coding agents can generate a 500-line diff in 60 seconds, which has shifted the bottleneck from writing code to reviewing it. Most of the bugs that slip through aren't dramatic syntax errors — they're quiet shortcuts:

  • Skipping a failing test (it.skip, pytest.mark.skip) or deleting assertions
  • Adding an empty catch {} block or bare except: pass
  • Loosening security (cors({ origin: '*' }), rejectUnauthorized: false)
  • Leaving hardcoded test keys or debugger statements behind
  • Quietly bumping dependencies in package.json or requirements.txt

Most AI review tools either just render the raw diff or require an API key and cloud round-trip. So I built diffvet — a zero-API-key, sub-50ms local CLI that triages your git diff deterministically by risk and intent.

Try it in 1 command (zero install)

# Preview on a built-in sample AI PR
npx diffvet --demo

# Vet your current working tree (or last commit)
npx diffvet

# Interactive walkthrough (press 'c' to copy a fix prompt back to your agent)
npx diffvet -i
Enter fullscreen mode Exit fullscreen mode

How it works

  1. Deterministic Risk Engine (Zero LLM required): Scans added/removed diff hunks across 7 high-signal rules (test-deletion-or-skip, silent-error-swallow, dangerous-exec-sink, auth-security-loosened, hardcoded-secrets, supply-chain-drift, debug-leftover).
  2. Intent Bucketing: Separates files into High Risk, Logic, Tests & Docs, and Noise (lockfiles, formatting-only diffs, pure renames).
  3. Optional --ai mode: Off by default — if you want a 3-bullet summary of the high-risk hunks, it uses native Node fetch with GEMINI_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, or local OLLAMA_HOST.
  4. CI / Pre-commit Ready: Run npx diffvet --fail-on high to block risky agent commits automatically.

Repo (MIT): https://github.com/WaifuPuller/diffvet

If you try npx diffvet --demo or run it on one of your recent agent PRs, let me know what rules or languages you'd want added next!

Top comments (0)