Safe-anything: fast vulnerability scanning in Rust

A magnifying glass hovering over a circuit board made of intertwined code brackets and keys, with faint glimmers of red at hidden gaps, lit by cool daylight from above, symbolising proactive security

A new open-source tool, safe-anything, is gaining attention among developers for offering fast, comprehensive vulnerability detection with no configuration, account, or data upload. Built entirely in Rust by erKam Yaman — also behind rust-anything — it scans for security issues including SQL injection, XSS, leaked secrets, misconfigured cloud and mobile settings, dependency CVEs, and risky AI agent configurations. The tool runs locally with a single command: safe-anything ., making it suitable for pre-commit hooks or CI pipelines.

How it works and what it finds

Safe-anything applies 75 rules based on OWASP, CWE, and OSV.dev data to scan across nine languages (including JavaScript, Python, Go, Java, PHP) and SQL. It checks for code-level flaws like eval, unsafe deserialization, SSRF, and path traversal. It identifies secrets such as AWS, GitHub, OpenAI, and Anthropic keys, especially when exposed in client-side environments via prefixes like NEXT_PUBLIC_. It also flags unsafe mobile configurations (e.g. debuggable Android apps), Docker misconfigurations (unpinned images, root usage), and Kubernetes or Terraform exposures like open ingress rules.

The tool parses lockfiles (e.g. package-lock.json, Cargo.lock, go.mod) and checks versions against OSV.dev for known CVEs, suggesting fixed versions. It respects .gitignore and skips large files (>2 MB), binaries, and build directories. Users can silence specific lines with safe-anything:ignore comments. Findings include the file, line number, reason, and fix guidance.

Agent and CI integration

Safe-anything integrates directly into developer workflows. It supports GitHub Actions for code scanning via SARIF output, enabling findings to appear in pull requests and the repository’s Security tab. Example workflow:

- uses: erkamyaman/safe-anything@v1.0.2
  with:
    fail-on: high
- uses: github/codeql-action/upload-sarif@v4
  if: always()
  with:
    sarif_file: safe-anything.sarif

It also functions as an MCP (Model Context Protocol) server, allowing AI coding agents like Claude Code or Codex to run scans before committing code. Users can add it via claude mcp add safe-anything -- safe-anything mcp. A plugin for Claude Code includes a skill to triage and fix findings. This positions safe-anything as both a developer tool and a guardrail for AI-generated code.

Performance and accuracy

Benchmarks on an Apple M4 show sub-second scan times: 0.03–0.13 seconds depending on system load. In tests on deliberately vulnerable apps like OWASP Juice Shop (1,195 files), it found 67 issues, including SQL injection, eval usage, and MD5 hashing. On DVWA, it detected 63 findings. On clean codebases like expressjs/express (216 files), it reported zero findings. False positives were limited — for example, Flask triggered two low-severity reports (SHA-1 for key derivation, shell startup file eval) that were not exploitable in context.

The most frequent rule trigger is code.xss-inner-html, which flags any dynamic HTML insertion. While many are false positives in internal tooling, the rule remains active because real XSS exploits look identical. The tool does not perform data flow analysis; it identifies patterns, not execution paths. A clean result means none of its 75 rules matched — not that the code is fully secure.

What it means

For UK, UAE, US, and Kazakhstani tech teams, safe-anything offers a lightweight, auditable way to enforce baseline security without vendor lock-in. Its offline mode (--offline) skips dependency checks but ensures no data leaves the machine — critical for regulated sectors. The lack of telemetry or accounts aligns with data sovereignty requirements.

The focus on AI agent setups (MCP servers, skills, hooks) is timely as companies adopt AI coding assistants. By scanning agent configurations for risks like curl | sh in skills or unsecured MCP tokens, it helps prevent supply chain compromises via AI tools.

However, it complements — not replaces — deeper tools like SAST or penetration testing. Teams should treat it as a first-line defence, especially in pre-commit or CI stages.

Adoption and support

The tool is MIT-licensed, free, and sponsored transparently: sponsors get only a logo and link, with no influence over recommendations. Development is supported via GitHub Sponsors. The creator encourages contributions, especially fixtures where the tool misfires.

Given its speed, precision, and local execution, safe-anything is a strong candidate for integration into modern development pipelines — particularly where control, cost, and data privacy are priorities.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *