Your repository now contains two kinds of instructions. The first kind is your code: routes, queries, templates, the things scanners have read for decades. The second kind is newer and quieter — the configuration that tells an AI coding agent which tools it may call, which commands are pre-approved, and which external servers it should trust. That second kind runs with your permissions, on your machine, often before you have read a line of it. Until recently, almost no general-purpose scanner looked at it.

That is the gap safe-anything was built to close. Created on 22 November 2026 by erKam Yaman and released under the MIT license, the Rust scanner reached roughly 700 GitHub stars within three days — a small number in absolute terms, but a telling one. Developers were not excited about another pattern matcher. They were excited that someone finally treated agent configuration as part of the attack surface.

01One pass, five families of problems

safe-anything walks a repository in parallel, reads each file once, and runs the applicable rules as compiled regular expression patterns. Where a pattern cannot tell right from wrong, it parses instead: MCP configurations as JSON with comments, Dockerfile stages, and dependency lockfiles. It never executes the code it scans.

As documented in late November, it shipped 92 rules, each mapped to a CWE identifier and an OWASP category, with a link to the explanation. The families are familiar until the last one:

  • Code — SQL injection, command injection, cross-site scripting patterns, eval, SSRF, path traversal, unsafe deserialization, JWT none, and weak hashes such as MD5 and SHA-1.
  • Secrets — cloud and AI provider keys, committed .env files, real values left in .env.example, and hardcoded secret values hidden behind public prefixes such as NEXT_PUBLIC_ or VITE_, which ship to the browser by design.
  • Config — Dockerfiles running as root, GitHub Actions using pull_request_target or unpinned @main, privileged containers, and Terraform with open ingress.
  • Dependencies — versions from 14 lockfile formats checked against OSV.dev. This is the tool's only network call, and --offline skips it.
  • Agents — bypassPermissions, --dangerously-skip-permissions, MCP servers launched through unpinned npx, plain-text tokens in MCP configuration, and hooks or skills that pipe curl into sh.

That last family is the point. A skill file that reads ~/.ssh, a hook that downloads and executes a script, or an MCP server fetched fresh from a registry on every start is not documentation. It is code with a trust decision attached, and the decision is usually made by whoever wrote the file, not by you.

02Running it without adopting it

The quick start needs no account and no configuration file:

cargo install safe-anything
safe-anything .

It exits with code 1 when it finds anything high or critical, so it works as a pre-commit check or a CI/CD step as-is. For machine-readable output there are --json and SARIF modes, the latter feeding GitHub code scanning. On a repository with existing debt, a baseline keeps the tool from blocking everything on day one:

safe-anything . --write-baseline .safe-anything-baseline.json
safe-anything . --baseline .safe-anything-baseline.json

The baseline stores the rule, the path, and a SHA-256 hash of the offending line — not the line itself — so it is safe to commit. New findings still fail; old ones are acknowledged rather than silently ignored. There is also a GitHub Action, an MCP server mode (safe-anything mcp) so an agent can scan before it commits, and a Claude Code plugin whose triage guidance includes the reminder that a leaked secret must be rotated, not merely deleted.

One installation note matters for a security tool: npx safe-anything . downloads and runs an npm package from a very young project. If that makes you uneasy — and for a scanner, a little unease is healthy — install from source with Cargo or use the release binaries, which are easier to audit before they touch your code.

03Honest numbers, stated limits

The README publishes hand-checked results from the author's own runs on an Apple M4. On OWASP Juice Shop, an intentionally vulnerable application, it scanned 1,195 files in 0.03 seconds and reported 67 findings with two or three false positive results. On Express it reported none; on Flask, two findings that were false positives in practice; on the MCP servers repository, one finding — a pull_request_target workflow worth a look. These are the author's measurements, not an independent benchmark, and they should be read that way.

The limits are stated just as plainly. safe-anything matches known patterns; it does not trace data through your program the way a deeper static analysis engine does. Its noisiest rule flags any HTML built from a variable as possible XSS. A clean scan therefore means none of its known problems showed up — not that the code is safe. It is also a single-author project that was days old when it trended, so running it in report-only mode (--fail-on never) for a few weeks before letting it block deploys is the sensible adoption path.

04Where it fits next to Semgrep and Gitleaks

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; Gitleaks has years of tuning behind its secret patterns. What neither targets is the layer safe-anything was built for: agent permissions, MCP wiring, hooks, skills, and .env mistakes. For a small team with nothing in place, one binary in CI in five minutes is a reasonable start. For a team with mature tooling, the value is narrower and still real — run it for the agent-configuration family alone, and treat the rest as a second opinion.

That framing follows least privilege in both directions. Your agent should hold only the permissions its task needs, and your scanner should be trusted only for the class of problems it actually checks. safe-anything is explicit about both, which is rarer than it should be.

05The rule to keep

Every file that can make your agent act is part of your security perimeter, whether it ends in .py, .json, or .md. Review agent configuration with the same suspicion you would give a shell script from a stranger — because functionally, that is what a hook, a skill, or an unpinned MCP server is. A scanner that reads those files will not make the decision for you, but it will at least make sure you know a decision is being made.

06Sources

  • Jorge Turbica — "Repo of the day: safe-anything, a scanner that also checks what your agent may do" — https://blog.jorgeturbica.dev/en/repo-of-the-day-safe-anything-a-scanner-that-also-checks-what-your-agent-may-do
  • Hybrd Studio — "safe-anything: scan your vibe-coded app before someone else does" — https://www.hybrdstudio.com/blog/safe-anything
  • ilpunto AI — "safe-anything scans AI agent code, secrets and configurations" — https://www.ilpunto-ai.it/en/news/safe-anything-scans-ai-agent-code-secrets-and-configurations
written by

kou documents what’s learned about threat intel, attack surface, and practical defense — from the dark side of the internet.