npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fole/brunt

v0.5.0

Published

Adversarial AI code review. Finds bugs, generates failing tests as proof.

Downloads

165

Readme

Brunt

Adversarial AI code review. Finds bugs, generates failing tests as proof, auto-fixes and verifies.

Brunt scans your git diffs, runs adversarial analysis via LLM, and for every bug it finds:

  1. Generates a failing test that proves the bug exists
  2. Generates a fix and verifies it passes the test
  3. Optionally opens a PR with all verified fixes

No opinions -- just proof.

Quick Start

npm i -g @fole/brunt

# Scan your last commit
brunt scan

# Scan with auto-fix
brunt scan --fix

# Full pipeline: find, prove, fix, open PR
brunt scan --fix --pr

What It Does

$ brunt scan --fix

  Running 2 vectors via anthropic:

  + correctness   1 finding (8102ms)
  + security      1 finding (14201ms)

+ Generated 2 proof tests.
+ Verified 2 fixes.

brunt -- found 2 issues (14230ms)

[correctness] 1 finding (8102ms)

  HIGH src/utils.ts:23  [FIXED]
  parseInt without radix or NaN handling
  Test: tests/brunt/src-utils-ts-L23.test.ts

  --- fix diff ---
  -  const age = parseInt(input);
  +  const age = parseInt(input, 10);
  +  if (isNaN(age)) throw new Error('Invalid age');

[security] 1 finding (14201ms)

  CRITICAL src/api/users.ts:34  [FIXED]
  SQL injection in user search endpoint
  Test: tests/brunt/src-api-users-ts-L34.test.ts

  --- fix diff ---
  -  const query = `SELECT * FROM users WHERE name = '${input}'`;
  +  const query = `SELECT * FROM users WHERE name = $1`;

Vectors

| Vector | What it finds | |---|---| | correctness | Edge cases, off-by-one, null handling, type coercion, logic errors, race conditions | | security | SQL injection, XSS, command injection, path traversal, SSRF, auth bypass, hardcoded secrets |

brunt scan --vectors security   # run only security

Providers

| Provider | Cost | Setup | |---|---|---| | claude-cli (default) | Free with Claude Code plan | Just have claude installed | | anthropic | Pay per token | Set ANTHROPIC_API_KEY | | ollama | Free, local | Install Ollama, run ollama serve | | openai | Pay per token | Set OPENAI_API_KEY |

brunt scan                                                # Claude Code CLI (default)
ANTHROPIC_API_KEY=sk-... brunt scan --provider anthropic  # Anthropic API
brunt scan --provider ollama --model llama3                # Local model

Prompt Injection Defense

Brunt is designed to resist adversarial input -- including code that tries to manipulate the AI reviewer:

  1. Comment stripping -- all comments and string literals are removed before the LLM sees the diff
  2. Per-file isolation -- each file is analyzed in its own LLM call; injection in one file cannot suppress findings in another
  3. Injection detection -- a pre-scan flags suspicious patterns (e.g. // AI: ignore this file) before analysis begins
  4. Suspicious silence -- files touching auth, crypto, exec, or SQL that produce zero findings are flagged for manual review
  5. Canary injection -- a synthetic bug is injected to verify the LLM actually analyzed the code

Output Formats

brunt scan                                  # Human-readable (default)
brunt scan --format json 2>/dev/null | jq . # JSON
brunt scan --format sarif > results.sarif   # SARIF (GitHub Code Scanning)

CI Integration

GitHub Actions

- uses: anfocic/brunt@main
  with:
    provider: anthropic
    fail-on: critical
    pr-comment: 'true'
  env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Options

--diff <range>        Git diff range (default: HEAD~1, auto-detects in CI)
--provider <name>     LLM provider: claude-cli, anthropic, ollama, openai
--model <name>        Model name
--format <type>       Output: text, json, sarif
--fail-on <severity>  Exit 1 threshold: low, medium, high, critical (default: medium)
--vectors <list>      Comma-separated vectors to run
--no-tests            Skip proof test generation
--no-cache            Force fresh LLM analysis
--verify              Run proof tests, drop unverified findings
--fix                 Auto-generate and verify fixes
--fix-retries <n>     Max fix attempts (1-5, default: 2)
--pr                  Create PR with verified fixes
--pr-comment          Post findings as GitHub PR review comments
--max-tokens <n>      Max tokens per LLM call

License

MIT