One-command security sweep of code, secrets, stack config and AI agent setup
From README links · today
safe-anything scans a repo for vulns, secrets, risky config and agent
What they did
They installed safe-anything (via cargo or npx) and ran a single command against a repository to get a full security picture without any config, account or upload. The scan covered four surfaces at once: application code across nine languages plus SQL (SQL and command injection, XSS, eval, SSRF, path traversal, unsafe deserialization, weak crypto), secrets (cloud and AI keys, tokens, private keys, passwords, and .env mistakes like committed env files, real values in .env.example, and secrets exposed behind NEXT_PUBLIC_ or VITE_ prefixes, always redacted in output), stack configuration (Android and iOS settings, Docker, GitHub Actions, Kubernetes, Terraform, nginx, and locked dependencies checked against OSV.dev), and the AI agent setup itself (MCP servers, Claude Code, Codex, Cursor, Gemini and OpenCode settings, hooks and skills — the files that decide what an agent may do). They then wired it into their workflow as a pre-commit or CI gate, relying on the exit code 1 for high or critical findings, and optionally used the Claude Code plugin and GitHub Action paths.
How it went
A single run on OWASP Juice Shop scanned 1,195 files in 0.03 seconds and surfaced 67 findings, including the SQL injection in routes/login.ts, eval in routes/userProfile.ts, seeded passwords and a token in localStorage. A second run on an agent setup caught a GitHub token in .mcp.json, bypassPermissions, pre-approved Bash, curl piped to sh in a hook, a skill reading ~/.ssh, invisible Unicode and unpinned MCP servers. Findings arrive with the line, the reason and the fix, and the nonzero exit makes it usable as a gate without extra scripting.
Worth knowing
It is a static pattern-and-rule scanner (92 rules), so it will not prove exploitability and can produce false positives or miss logic flaws; treat findings as leads to triage. Dependency checks depend on OSV.dev reachability, and the agent-setup coverage is tied to the specific tools it knows (Claude Code, Codex, Cursor, Gemini, OpenCode, MCP). Secrets are redacted in output, but you should still rotate anything it flags. No config is required, which also means tuning and suppressions need to be learned separately.
Wiring
Install with `cargo install safe-anything` or run `npx safe-anything .`; no config file or account is needed. Run `safe-anything .` from the repo root — it walks the tree, applies its 92 rules across code, secrets, stack config and agent settings, and queries OSV.dev for locked dependencies. Output lists each finding with file, line, reason and suggested fix, with secrets redacted. The process exits 1 when any high or critical finding exists, so wire it directly as a pre-commit hook or a CI step (a GitHub Action is provided) without extra parsing. For agent-driven workflows, add the Claude Code plugin so the agent can invoke the scan itself; pair with gitleaks if you want a dedicated secret-scanning gate alongside it, and with Anthropic Skills to encode the triage-and-patch procedure as a reusable skill.
Try it yourself
Run a full safe-anything security sweep on this repository and turn the results into a prioritized fix plan. Steps: 1) Install and run it (cargo install safe-anything, or npx safe-anything .) against the repo root and capture the full output. 2) Group findings into four buckets: code vulnerabilities, leaked secrets, stack/infra config, and AI agent setup (MCP servers, hooks, skills, permission settings). 3) For each high or critical finding, quote the file and line, explain the risk in one sentence, and propose the minimal patch. 4) Flag any secret that must be rotated and list the exact env var or file to change. 5) Review the agent config files for bypassPermissions, pre-approved shell commands, curl piped to sh, unpinned MCP servers and skills that read sensitive paths like ~/.ssh, and tighten them. 6) Add safe-anything to CI or a pre-commit hook so the exit code 1 blocks high/critical findings, and show me the workflow snippet. Do not modify files until you have shown me the plan.
Tools in this stack
Run this stack
Install the stack into this project. It writes AGENTS.md and the manifest, merges the MCP servers into .mcp.json, and — with --yes — runs the tool installs.
npx runchr install runchr/stack-anthropic-skills-and-gitleaks-and-safe-anythingcurl -s https://api.runchr.com/api/recipes/runchr/stack-anthropic-skills-and-gitleaks-and-safe-anything/manifestThis stack has no prompt yet. You get the tools and the wiring, not the prompt.
The manifest is also at api.runchr.com/api/recipes/runchr/stack-anthropic-skills-and-gitleaks-and-safe-anything/manifest.