/nio-scan — scan code for execution risks.
Point it at a file, directory, or third-party skill. Applies 15 static rules + a base64 decode pass across every supported file type and rolls findings up to one risk level.
Invoke: /nio-scan <path> (Claude Code) · $nio-scan or natural language (Codex) · or via the umbrella /nio scan <path> on any platform (incl. OpenClaw / Hermes). See Focused skills.
scan <path>
Scan a directory or a single file for execution risks. Applies 15 static rules + base64 decode pass across all supported file types.
Example
/nio scan ./src
/nio scan ~/third-party-skill
/nio scan package.json
What gets scanned
All of: .js .ts .jsx .tsx .mjs .cjs .py .json .yaml .yml .toml .sol .sh .bash .md
Skipped: node_modules/, dist/, build/, .git/, coverage/, __pycache__/, .venv/, venv/, and *.min.js, *.min.css, package-lock.json, yarn.lock, pnpm-lock.yaml.
Markdown handling
For .md files, only fenced code blocks are scanned (reduces false positives in prose). Base64-encoded payloads are decoded and re-scanned in every file type.
Detection rules
| # | Rule | Severity | Description |
|---|---|---|---|
| 1 | SHELL_EXEC | HIGH | Command execution capabilities |
| 2 | AUTO_UPDATE | CRIT | Download-and-execute / auto-update |
| 3 | REMOTE_LOADER | CRIT | Dynamic code loading from remote |
| 4 | READ_ENV_SECRETS | MED | Environment variable access |
| 5 | READ_SSH_KEYS | CRIT | SSH key file access |
| 6 | READ_KEYCHAIN | CRIT | System keychain / browser profile |
| 7 | PRIVATE_KEY_PATTERN | CRIT | Hardcoded private keys |
| 8 | OBFUSCATION | HIGH | Code obfuscation techniques |
| 9 | PROMPT_INJECTION | CRIT | Prompt injection attempts |
| 10 | NET_EXFIL_UNRESTRICTED | HIGH | Unrestricted POST / upload |
| 11 | WEBHOOK_EXFIL | CRIT | Webhook exfiltration domains |
| 12 | TROJAN_DISTRIBUTION | CRIT | Trojanized binary download + execute (.md) |
| 13 | SUSPICIOUS_PASTE_URL | HIGH | Paste-site URLs (pastebin, glot.io) |
| 14 | SUSPICIOUS_IP | MED | Hardcoded public IPv4 addresses |
| 15 | SOCIAL_ENGINEERING | MED | Pressure language + exec instructions (.md) |
The overall risk level rolls up to the highest severity in any finding: any CRITICAL → CRITICAL, else any HIGH → HIGH, else any MEDIUM → MEDIUM, else LOW.
Output
## Nio Execution Risk Scan Report
**Target**: <scanned path>
**Risk Level**: CRITICAL | HIGH | MEDIUM | LOW
**Files Scanned**: <count>
**Total Findings**: <count>
### Findings
| # | Risk Tag | Severity | File:Line | Evidence |
|---|----------|----------|-----------|----------|
| 1 | SHELL_EXEC | high | path/file.ts:42 | `child_process.exec(...)` |
### Summary
<Human-readable summary of key risks and recommendations>
Customize or extend rules with guard.file_scan_rules.<module> in config — see Config reference.