R236 · AI-built software and its verification › Security scanning for AI-written code

safe-anything: scanning the coding agent's own config as attack surface

Read the original

Authors André Lindenberg (shared), Cole Medin (shared)

appsecagent-configmcpagent-skillsmodel-supply-chainopen-source

Sources: a LinkedIn post by André Lindenberg (2026-11-23) on erkamyaman/safe-anything (MIT, Rust, first published 2026-11-22). Second source: a same-day LinkedIn post by Cole Medin arguing the same point and offering a free agent-setup audit skill.

What it is

A single-binary static scanner (cargo install safe-anything or npx safe-anything .) with 74 regex-and-parser rules, each mapped to a CWE and an OWASP page. No config, no account, no upload; it exits non-zero on high or critical findings, so it drops straight into pre-commit or CI, and it emits JSON and SARIF for GitHub code scanning. It covers five familiar families (injection and XSS patterns in nine languages, leaked secrets and .env mistakes, mobile and container/IaC config, locked dependencies checked against OSV.dev) plus one that most scanners don't yet treat as first-class: the coding agent's own configuration.

The agent-setup rules

The argument is short: the files that decide what an agent may do are code, so check them like code. It reads .mcp.json, Claude Code settings, commands, agents, skills and hooks, CLAUDE.md, Codex's config.toml and AGENTS.md, Cursor and VS Code MCP files and rules, Gemini CLI settings, OpenCode config, and any SKILL.md. It flags:

RuleWhat it catchesWhy it matters
bypass permissionsbypassPermissions, --dangerously-skip-permissions, full-access sandbox modeone injected instruction can do anything
unrestricted shellBash pre-approved wholesaleevery command auto-runs
unpinned MCPnpx -y some-server, unpinned uvx/dockereach start runs whatever was published last
plaintext MCP secrettokens in an MCP server's env blockthe token travels with the repo
insecure MCP URLremote MCP over http://tool calls and results in clear text
remote scriptcurl … | sh in a hook or skillwhoever owns the URL owns the machine
prompt injection"ignore all previous instructions", "do not tell the user"text aimed at turning the agent on its user
sensitive file accessskills reading ~/.ssh or cloud credentialsan agent never needs your keys
hidden Unicodeinvisible tag characters in rules filesinstructions the agent sees and you don't

It also ships as an MCP server and a Claude Code plugin, so the agent can scan before committing, and the README's suggested workflow is to clone someone else's skill or MCP repo into a temp directory and scan it before copying anything into ~/.claude, .cursor or .codex.

Evidence offered

The author hand-read every finding on a small benchmark (offline release build, 2026-11-22): OWASP Juice Shop 67 findings with 2 to 3 false positives; DVWA 63 with about 4; express 0; flask 2 (both benign); modelcontextprotocol/servers 1 (pull_request_target); anthropics/skills 6 (local innerHTML, a deliberate shell=True); vercel-labs/agent-skills 0. Scans of about 1,200 files take tens of milliseconds. These are the author's own numbers and repos, not an independent evaluation, and the agent-setup rules have no comparable measured corpus.

Assessment for a staff engineer

Takeaways

  1. Add agent configuration (.mcp.json, settings, hooks, skills, rules files) to the set of files your CI security gate inspects.

  2. Pin MCP servers to versions or digests; never commit tokens into MCP env blocks.

  3. Scan third-party skills and MCP servers before installing them, the same way you would vet a dependency.

  4. Keep the runtime controls; static config checks shrink the attack surface but don't stop a compromised tool at run time.

Connections

See R236 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.