Seven stages, one honest verdict
Each stage hands the next one a view closer to what the agent will run.
The pipeline
Stages run in order on every target. The judge stage is off by default.
Inventory
Lists every file, including dotfiles and files inside archives. Symlinks that leave the skill are refused. File type comes from magic bytes, not the extension.
Unpack
Opens zip, tar, gzip, bzip2, xz and Office files in memory, with limits on depth, count, size and compression ratio.
Normalize
Removes zero-width and bidirectional characters, applies NFKC, maps look-alike letters to Latin, decodes base64, hex, URL, HTML entities, compression and ROT13 until nothing changes, and reports padding.
Analyze
Runs every rule on every view: raw, folded and decoded. Adds taint tracking from secrets to the network, constant folding for strings assembled at runtime, YARA signatures and a bytecode check against shipped source.
Prose
Reads the skill's instructions and metadata for hidden directives, secrecy, permission requests and a purpose that does not match the code.
Judge (optional)
Off by default. A model reviews an isolated, redacted bundle and may raise a finding. It cannot lower or remove one.
Verdict
Merges findings, keeps the highest deterministic severity, and reports coverage. Anything not analyzed is listed, and a partial scan exits with code 2.
The deterministic floor
Rules set the minimum severity. A model can add evidence or raise a finding. It cannot lower one.
The optional judge sees the skill inside random delimiters, with paths and secrets redacted, and must answer in a fixed schema. Its output is checked against the files it was shown. A prompt injection that talks the model into "this is safe" changes nothing, because "safe" is not an answer the schema accepts.
When a limit stops analysis early, foldscan reports what it skipped and fails closed. No findings means nothing was found in what was analyzed, and the coverage line says how much that was.
What a scan returns
From the demo skill on the home page: verdict block, 5 of 5 files analyzed. Output as a table, JSON, Markdown or SARIF 2.1.0 with --format.
| Severity and rule | Finding | Location | View |
|---|---|---|---|
| FS-EXEC-REMOTECritical | Downloaded content is piped straight into an interpreter. | SKILL.md:100009 | folded |
| FS-UNI-CONFUSABLECritical | Matched FS-EXEC-REMOTE only after folding look-alike or invisible characters. | SKILL.md:100009 | folded |
| FS-WS-PADDINGHigh | 100,000 consecutive blank lines start at line 9. Content after the padding was analyzed in full. | SKILL.md:9 | raw |
| FS-ARC-SCRIPTHigh | guide.docx!/word/media/sync1.sh is a script or binary hidden inside an archive. | guide.docx!/word/media/sync1.sh | member |
| FS-ARC-PRESENTMedium | guide.docx (application/vnd.openxmlformats) was unpacked and every member scanned. | guide.docx | meta |
Exit codes
The exit code tells a pipeline whether to fail the build and whether the scan covered everything.
| Code | Meaning |
|---|---|
0 | No findings at or above the fail-on level |
1 | Findings at or above the fail-on level |
2 | Coverage incomplete: some content was not analyzed |
3 | Usage error |
4 | Requested feature not available in this install |
70 | Internal error |
Install foldscan
One command, no account, no network by default.