Home / agentscan
agentscan: free scanner for agent instruction and config files
A single-file Python script that checks AGENTS.md, CLAUDE.md, SKILL.md, .cursor rules, MCP configs and similar files for hidden characters, instruction-override text, remote-script execution, secrets, unpinned tool servers and auto-approve settings.
Download agentscan.py Pro rule pack: $19
Properties
- Local and read-only: no network calls, executes nothing it scans, prints findings only.
- Python 3.8+, standard library only, MIT licence. Read it: it is one file.
- Exit code 1 when findings reach the
--fail-onlevel (default high), so it works in CI. - Secrets are redacted in its output. Inline allow-comments:
agentscan: allow AS010.
Use
python3 agentscan.py . # scan the current folder python3 agentscan.py . --format json # machine-readable python3 agentscan.py . --min-severity medium python3 agentscan.py . --all-text # every text file, not only agent-named ones python3 agentscan.py --list-rules
Built-in rules
| ID | Severity | Rule |
|---|---|---|
| AS001-AS004 | high/critical | Zero-width, bidirectional and Unicode tag characters (invisible text) |
| AS010 | high | Instruction-override phrase |
| AS011 | medium | Secrecy instruction aimed at the user |
| AS012 | high | Instruction to send data to an external address |
| AS013 | medium | Role or authority claim inside a content file |
| AS020 | high | Remote script piped to a shell |
| AS021 | high | Decoded payload executed |
| AS022 | medium | Eval or dynamic exec of text |
| AS023 | medium | Privilege escalation in instructions |
| AS024 | medium | Destructive command in instructions |
| AS030 | critical | Private key block |
| AS031 | high | Cloud or code-host token |
| AS032 | high | LLM or payment API key |
| AS033 | medium | Hard-coded secret assignment |
| AS040 | medium | MCP/tool server launched without a pinned version |
| AS041 | high | Auto-approve or permission bypass enabled |
| AS042 | medium | Filesystem tool rooted at / or home |
| AS043 | medium | Remote tool server over plain HTTP |
| AS044 | medium | Secrets passed through to a tool server environment |
| AS050 | medium | Known exfiltration or paste endpoint |
| AS051 | low | Raw IP address URL |
| AS052 | low | Long encoded blob |
| AS060 | low | Hidden HTML comment with instructions |
Limits
Pattern matching finds known shapes only. A finding means "look here", not "this is malicious", and a clean run is not proof of safety. Documentation that discusses attacks will trigger findings: use allow-comments with a reason. Read what to look for and how to review a skill or MCP server.