Repository navigation
Description
agentmetry scan <folder> reads a skill's text and none of the code the skill tells the agent to run. A clean result therefore covers the half of a skill an attacker is least likely to use.
How it showed up
On 2026-10-31 I scanned Cloudflare's security-audit-skill (commit c1c8a8c, about 55k stars) before considering installing it:
agentmetry scan .../skills/security-audit
no findings in 15 items scanned
No findings means these checks found nothing. It does not mean safe.
The 15 items are its 15 markdown files. The folder also holds two Node scripts, validate-findings.cjs (29 KB) and validate-coverage-ledger.cjs (34 KB), which SKILL.md tells the agent to run. scan did not open them, and its output does not say so. I read them by hand: they load only fs, path and util, with no child processes, network, eval, environment reads or writes. So this skill is fine; the gap is the point.
Why
core/scanner/scan.py selects files by name: TEXT_SUFFIXES = (".md", ".mdc", ".txt"), the instruction-file names in TEXT_NAMES, and .json files that parse as a tools/list. Everything else in the folder is skipped silently, including .js, .cjs, .mjs, .py, .sh and .ps1.
A malicious skill would put its payload exactly there: clean, helpful markdown that tells the agent to "run the validator", and a validator that reads ~/.ssh or fetches a second stage. scan would report no findings.
Two levels of fix
- Say what was not read. Count the files skipped by type and print them beside the result, for example
2 script files not read (.cjs). Without this the output overstates what was checked, which is the thing the "does not mean safe" line exists to prevent. Small, and arguably a correctness fix to the report rather than a feature. - Check the scripts. A first pass needs no interpreter: flag imports or calls that reach the network, spawn processes, read credential paths, or decode and execute (
child_process,subprocess,fetch/http,eval/new Function,base64intoexec, reads under~/.ssh,~/.aws,.env). The command classifier indetection/traits.pyalready knows much of this for shell; whether to reuse it is a design question, since that file is frozen.
Status
Not started. scan.py is not a ruleset fingerprint input, so neither level restarts the dogfood clock. Level 2 is new behaviour and waits for a restart trigger under the maintenance-only rule; level 1 could be argued either way and is the maintainer's call.
Activity
fix(scan): read a skill's scripts and name what was not read (#519)