---
title: "Safe-anything scans code, secrets, and AI agent files locally or via MCP"
id: "story-134"
canonical_url: "https://emergent.fm/stories/134"
markdown_url: "https://emergent.fm/stories/134/article.md"
published_at: "2026-11-24T03:32:48.169Z"
modified_at: "2026-11-24T04:56:41.528Z"
source_at: "2026-11-22T16:44:10.000Z"
topic: "memory_verification"
trust_label: "Reported"
publisher: "Emergent.FM"
---

# Safe-anything scans code, secrets, and AI agent files locally or via MCP

> Safe-anything also runs as an MCP server so Claude Code and Codex can scan before commits.

## Key points

- Safe-anything runs locally on macOS, Linux, and Windows with no account or code upload, working as a CLI, GitHub Action, or MCP server.
- The project reports that a release build on an Apple M4 scanned 1,195 files in OWASP Juice Shop in 0.03 to 0.13 seconds, flagging 67 issues with two to three false positives.
- Because the scanner matches known patterns rather than tracing data flow, the maintainers note that a clean scan does not guarantee safe code.

Released as v1.0.2 on 22 November 2026 under the MIT license, safe-anything is a Rust security scanner that checks repositories against 74 rules in a single command, according to its GitHub repository. The project targets application code across nine programming languages and SQL, leaked secrets, mobile and cloud configurations, locked dependencies, and AI agent setup files. Native binaries are distributed for macOS, Linux, and Windows alongside packages on crates.io and npm.

## One parallel pass reads files and parses configs

The scanner takes a repository path as input and performs one parallel walk over the files using the ignore crate, the repository documentation says. It reads each file once and applies compiled regular expressions, falling back to dedicated parsers for MCP (Model Context Protocol, a standard that lets AI agents call external tools) JSON configs with comments, Dockerfile stages, and ten lockfile formats. It respects .gitignore, skips directories such as node_modules and target, and supports .safe-anything-ignore files or inline safe-anything:ignore comments.

## Findings include fixes, exit codes, and MCP tools

Every finding reports the line number, reason, fix, a CWE (Common Weakness Enumeration, a standard list of software weaknesses) identifier, and an OWASP link, while redacting detected secrets, the repository says. The CLI exits with status 1 on high or critical findings for pre-commit hooks or CI, and supports --json or --sarif (Static Analysis Results Interchange Format, a standard format for security tools) for GitHub code scanning. When run as an MCP server for Claude Code or Codex, it exposes scan and list_rules tools so agents can check code before committing.

## Apple M4 runs flag 67 issues in Juice Shop

In benchmarks run by the project on 22 November 2026 using an offline release build on an Apple M4, every finding was reviewed by hand. On OWASP Juice Shop, safe-anything scanned 1,195 files in 0.03 to 0.13 seconds and flagged 67 issues, including two to three false positives. On DVWA, it scanned 233 files and reported 63 issues with about four false positives, while expressjs/express returned zero findings across 216 files and pallets/flask returned two low-severity false positives across 231 files.

## Offline mode and test filters limit noise and network calls

Building safe-anything from source requires Rust 1.88 under the 2024 edition, according to Cargo.toml. The repository notes that nothing is executed during a scan, and the only network request sends locked package names and versions to OSV.dev unless --offline is passed. The maintainers identify code.xss-inner-html as the noisiest rule because it flags any HTML built from a variable, and note that test files only report real provider keys and private keys unless --include-tests is set.

## Try it

1. Install the binary with `cargo install safe-anything` or run it via `npx safe-anything .`.
2. Scan the current repository with `safe-anything .`, or add `--offline` to skip OSV.dev dependency lookups.
3. Export machine-readable results with `safe-anything . --json` or GitHub code scanning output with `safe-anything . --sarif`.
4. Register the MCP server in Claude Code with `claude mcp add safe-anything -- safe-anything mcp` or in Codex with `codex mcp add safe-anything -- safe-anything mcp`.

## Sources

- [safe-anything](<https://github.com/erkamyaman/safe-anything>) (github.com/erkamyaman, 2026-11-22, release)
- [Safe anything Cargo.toml](<https://github.com/erkamyaman/safe-anything/blob/main/Cargo.toml>) (github.com/erkamyaman, documentation)

Canonical page: <https://emergent.fm/stories/134>
