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

sherscan

v0.1.1

Published

AI-aware security scanner — finds exposed secrets and checks if your AI agent can read sensitive files

Readme

🔍 sherscan

AI-aware security scanner, finds exposed secrets in your codebase and checks whether your AI coding agent (Cursor, Copilot, Windsurf, Claude Code, etc.) can actually read your sensitive files.

Most secret scanners stop at "you have a .env file." sherscan goes one step further: it checks whether that file is actually blocked from AI agents via .cursorignore, .aiexclude, .clineignore, Claude Code's deny rules.

Why

AI coding assistants can read almost any file in your project by default. If your .env, private keys, or credentials aren't explicitly excluded, your AI agent (and anything it shares context with) can see them. sherscan audits this blind spot in seconds.

Features

  • 🔎 Sensitive file detection, flags .env files, private keys (.pem, .key, id_rsa), cloud credentials (.aws/credentials, .npmrc), keystores, and more.
  • 🔑 Secret scanning, greps file contents for real leaked credentials: AWS keys, GitHub tokens, Stripe keys, Supabase keys, Anthropic keys, SendGrid keys, private key blocks, JWTs, and generic hardcoded secrets.
  • 🤖 AI exposure check, cross-references every sensitive file against the ignore files of 9+ AI tools (Cursor, Windsurf, Cline, Gemini, Codeium, Copilot, Claude Code, and generic .aiignore) to see if it's actually protected.
  • 🛡️ Masked previews, secrets are shown masked (e.g. AKIA********MNOP) so reports are safe to share/paste.
  • 📊 Readable or machine output, pretty colored terminal report by default, or --json for scripting.
  • 🚦 CI-friendly, --ci flag exits with code 1 when exposed secrets are found, so you can fail a pipeline on real risk.

Installation

Run it directly without installing anything (recommended):

npx sherscan

Or install globally:

npm install -g sherscan

Or add it as a dev dependency to run via npm scripts:

npm install --save-dev sherscan

Usage

Scan the current directory:

npx sherscan

Scan a specific project path:

npx sherscan ./path/to/project

Output JSON (for scripting or piping into other tools):

npx sherscan --json

Fail CI when a sensitive file with no AI-ignore coverage is found:

npx sherscan --ci

Options

| Flag | Description | | --------------- | ------------------------------------------------------------- | | [path] | Project directory to scan (defaults to .) | | --json | Output results as JSON instead of a colored report | | --ci | Exit with code 1 if any fully-exposed findings are detected | | -V, --version | Print the version number | | -h, --help | Print usage help |

Example output

────────────────────────────────────────────────────
  🔍 sherscan  · AI-aware security scanner
────────────────────────────────────────────────────

────────────────────────────────── SUMMARY ──────────────────────────────────

  Sensitive files found       1
  Secrets in content          1
  Files exposed to AI agents  1

    HIGH      1 file(s)

────────────────────────────── SECRETS DETECTED ─────────────────────────────

    HIGH    .env
           Line 1  ·  AWS Access Key
           Preview: SECRET_KEY=AKIA********MNOP

──────────────────────────────── AI EXPOSURE ────────────────────────────────

    HIGH    .env
           Status   fully exposed   has secret

──────────────────────────────── RECOMMENDATIONS ────────────────────────────

  ✖  No AI ignore files found in this project

  →  Create a .aiignore or .cursorignore and add:
       .env

  ⚠   Rotate these credentials immediately:
      .env

────────────────────────────────────────────────────
  ✖  Issues found — review recommendations above
────────────────────────────────────────────────────

What it checks

Sensitive files

sherscan flags files matching common sensitive-file patterns, including:

  • .env, .env.* (any environment file)
  • *.pem, *.key, id_rsa*, id_ed25519* (private keys)
  • *.p12, *.pfx, *.keystore (certificates/keystores)
  • credentials.json, secrets.*
  • .npmrc
  • .aws/credentials, .aws/config
  • Supabase's supabase/.temp/** directory

Secret patterns

File contents (for common source/config file types under 500 KB, skipping binaries) are scanned for:

  • AWS Access Keys
  • GitHub Tokens
  • Stripe Live/Test Keys
  • Supabase Keys
  • Anthropic API Keys
  • SendGrid Keys
  • Private key blocks (-----BEGIN ... PRIVATE KEY-----)
  • Generic JWTs
  • Hardcoded SECRET / API_KEY / PRIVATE_KEY / AUTH_TOKEN assignments

Matches inside comments are skipped, and all detected secrets are masked in the report.

AI exposure

For every sensitive file found, sherscan checks whether it's covered by any of these AI-tool ignore mechanisms:

| Tool | Ignore file | | ----------- | -------------------------------------------------- | | Cursor | .cursorignore, .cursorindexingignore | | Windsurf | .windsurfignore | | Cline | .clineignore | | Gemini | .aiexclude, .geminiignore | | Codeium | .codeiumignore | | Copilot | .copilotignore | | Claude Code | .claude/settings.json (permissions.deny rules) | | Generic | .aiignore |

A file is marked fully exposed if none of the detected AI tools' ignore rules cover it — meaning an AI agent working in that project could read it.

Using in CI

Add sherscan to your pipeline to catch exposed secrets before they ship:

# .github/workflows/security.yml
name: Security check
on: [push, pull_request]
jobs:
  sherscan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx sherscan --ci

The command exits with code 1 if any sensitive file is fully exposed to an AI agent, failing the build.

Requirements

  • Node.js >= 18

License

MIT