707 stars in three days: safe-anything was created on November 22, 2026 and was already close to that number on GitHub by the 25th. It is a Rust security scanner that, in a single pass, looks for code vulnerabilities, leaked secrets, risky Docker, Kubernetes or Terraform config, dependencies with known CVEs and something almost nobody checks yet: your AI agent setup.
It comes from erKam Yaman, the author of rust-anything, under the MIT license.
What it is and how it works
A single binary that walks the repository in parallel with the ignore crate (the same walker ripgrep uses), reads each file once and runs the applicable rules as compiled regular expressions. Where a pattern cannot tell right from wrong, it parses the file: MCP configs as JSON with comments, Dockerfile stages and lockfiles. It never executes anything.
It ships 92 rules, each with a CWE id, an OWASP category and a link to the explanation. They fall into these families:
| Family | Examples |
|---|---|
| Code | SQL and command injection, XSS, eval, SSRF, path traversal, unsafe deserialization, JWT none, MD5 and SHA-1 |
| Secrets | AWS, GitHub, Stripe, OpenAI, Anthropic and other keys; committed .env files; real values in .env.example; secrets behind NEXT_PUBLIC_ or VITE_ |
| Agents | bypassPermissions, --dangerously-skip-permissions, MCP servers run with unpinned npx, plain-text MCP tokens, curl | sh in hooks and skills |
| Config | Dockerfiles running as root, Actions using pull_request_target or @main, privileged containers, Terraform with open ingress |
| Dependencies | Versions from 14 lockfile formats checked against OSV.dev |
The only network call is the dependency check, which sends package names and versions to OSV.dev; --offline skips it.
How to use it
Per the README, no config and no account:
cargo install safe-anything # or: npx safe-anything .
safe-anything .
safe-anything . --sarif-file out # SARIF for GitHub code scanningIt exits with 1 when it finds anything high or critical, so it works as a pre-commit hook or CI step out of the box. On a repo with existing debt, a baseline keeps it from blocking everything on day one:
safe-anything . --write-baseline .safe-anything-baseline.json
safe-anything . --baseline .safe-anything-baseline.jsonThe baseline stores the rule, path and a SHA-256 of the line, not the line itself, so it is safe to commit. There is also a GitHub Action (erkamyaman/[email protected]), an MCP server (safe-anything mcp) and a Claude Code plugin with a skill that tells the agent how to triage and fix findings, including the reminder that a leaked secret must be rotated, not just deleted.
Installing via npx downloads and runs an npm package from a three-day-old project; if that worries you, cargo install from source or the release binaries are easier to audit.
What I like and what I don't
I like how honest the measurements are. The README publishes hand-checked results: 67 findings on OWASP Juice Shop with 2 or 3 false positives, 0 on Express, 2 on Flask (both false positives in practice) and 1 on the MCP servers repo, a pull_request_target worth a look. Juice Shop, 1,195 files, scans in 0.03 seconds on an Apple M4.
I also like that it treats agent configuration as attack surface. An .mcp.json that runs unpinned npx, or a hook that pipes curl into sh, runs with your permissions, and until now no general-purpose scanner looked at them.
What I don't: the author is upfront that it matches known patterns and does not trace data through your program. A clean scan means none of those 92 problems showed up, not that the code is safe. The noisiest rule, code.xss-inner-html, fires on any HTML built from a variable. And it is a single-author project, three days old, with 19 open issues: before letting it block deploys, run it in report-only mode (--fail-on never) for a few weeks.
safe-anything vs Semgrep and gitleaks
The usual setup today pairs two tools: Semgrep for static analysis and gitleaks for secrets.
| safe-anything | Semgrep | gitleaks | |
|---|---|---|---|
| Approach | Regex rules plus selective parsing, all-in-one | Code-like rule syntax, many languages | Secrets only |
| Scope | Code, secrets, config, dependencies and agents | Static code analysis | Secrets |
| License | MIT | LGPL-2.1 | MIT |
| Maturity | 3 days, ~700 stars | ~18,000 stars | ~31,000 stars |
When to use which. If you already run Semgrep with custom rules and gitleaks in your pipeline, safe-anything does not replace them: Semgrep understands code structure and lets you write your own rules, and gitleaks has spent years tuning its patterns (the README itself credits it). Where safe-anything adds value is in what neither of them targets, above all agent configuration and .env mistakes, and for small teams with nothing in place that want one binary in CI in five minutes.
Sources
- erkamyaman/safe-anything (GitHub)
- semgrep/semgrep (GitHub)
- gitleaks/gitleaks (GitHub)