Security scanner for agent skill files - detects command injection, unsafe file operations, hardcoded secrets, and code injection risks
npm install @jonusnattapong/pinocchio-scan



Pinocchio-Scanner-Skill is a security scanner for AI agent skill files. It performs static analysis across code and documentation to detect command injection, unsafe file access, hardcoded secrets, prompt injection patterns, and risky MCP definitions before they reach production.
---
Community-made skills often run with high privileges (filesystem, shell, network, tokens). pinocchio-scan helps you validate that skills align with your security posture and highlights high-risk behavior early.
- Multi-language scanning for TypeScript/JavaScript, Python, Go, and Rust
- MCP manifest and tool schema risk detection
- LLM-assisted semantic analysis for intent and prompt-injection signals
- Malware and dependency auditing (VirusTotal + NodeSecure + package audit checks)
- Optional AI-powered auto-remediation suggestions
- SARIF export for CI and GitHub Security integration
---
``bash`
npx @jonusnattapong/pinocchio-scan ./path-to-skill
`bash`
npm install -g @jonusnattapong/pinocchio-scan
`bash`
docker build -t pinocchio-scan .
docker run -v $(pwd):/src -e GEMINI_API_KEY="your_key" pinocchio-scan /src --report
---
`bash`
pinocchio-scan
| Flag | Description | Default |
| :--- | :--- | :--- |
| | Path to the directory or file to scan. | (Required) |-h, --help
| | Show help. | |-v, --verbose
| | Verbose output (includes errors from checks). | false |--json
| | Print JSON output to stdout. | false |--report
| | Auto-export a timestamped JSON report to reports/. | false |--sarif
| | Export SARIF to reports/ for GitHub Security. | false |--tui
| | Launch interactive TUI mode for configuring and running scans. | false |--severity
| | Minimum severity (low, medium, high, critical). | low |--checks
| | Comma-separated list of checks to run. | All |--ignore
| | Comma-separated glob patterns to ignore. | node_modules,dist,build,.git,.test.,.spec. |--fix
| | Enable AI auto-remediation suggestions (experimental). | false |--provider
| | AI provider (gemini, opencode, molt, openrouter, openai). | gemini |--model
| | Override the provider model name. | Provider default |--web-search
| | Enable AI web search capability (if supported). | false |
`bash`
pinocchio-scan ./skills
pinocchio-scan ./agent --severity high
pinocchio-scan ./repo --checks command-injection,hardcoded-secret
pinocchio-scan ./repo --json > report.json
pinocchio-scan ./skills --fix --provider openrouter --model "meta-llama/llama-3.1-8b-instruct:free"
pinocchio-scan --tui
---
These checks map to --checks values:
- command-injection - Unsafe shell command executioncode-injection
- - eval, Function, obfuscation, dynamic execution (includes NodeSecure signals)file-system
- - Unsafe file operations and path traversal patternshardcoded-secret
- - API keys, tokens, and secrets in codesemantic-analysis
- - LLM-assisted intent analysis and prompt-injection signalsmalware-scan
- - VirusTotal lookup for suspicious artifactsdependency-audit
- - Dependency risk signals for package.jsoncisco-defense
- - Risky binaries and suspicious skill text in SKILL.mdmcp-definition
- - MCP manifest risks and global permissive flagstool-schema
- - Overly permissive tool schemas in MCP manifestsexcessive-agency
- - Execution-like behavior in MCP definitionspython-security
- , go-security, rust-security - Language-specific heuristics
---
`bash`
pinocchio-scan ./skills --json
`bash`
pinocchio-scan ./skills --report
`bash`
pinocchio-scan ./skills --sarif
---
Semantic analysis and remediation require an AI provider. Configure via environment variables:
| Provider | Required env vars | Default model |
| :--- | :--- | :--- |
| Gemini | GEMINI_API_KEY | gemini-pro |OPENROUTER_API_KEY
| OpenRouter | | meta-llama/llama-3.1-8b-instruct:free |OPENAI_API_KEY
| OpenAI | | gpt-4o-mini |OPENCODE_API_BASE
| Opencode | , optional OPENCODE_API_KEY | opencode-model |MOLT_API_BASE
| Molt | , optional MOLT_API_KEY | molt-model |
Notes:
- --web-search currently augments prompts for providers that support search or grounding.
- If no provider is configured, semantic analysis and auto-remediation are skipped.
---
`bash`
npm install @jonusnattapong/pinocchio-scan
`typescript
import { scanCode } from "@jonusnattapong/pinocchio-scan";
const code = "exec('rm -rf ' + path);";
const findings = await scanCode(code, {
severityThreshold: "high",
});
console.log(findings);
`
---
- 0 - Scan completed with no high or critical findings1
- - High or critical findings detected2
- - Error (invalid path, parsing failure, or runtime error)
---
`yaml`
- name: AI Skill Security Scan
uses: JonusNattapong/Skill-Scanner@main
with:
path: "./skills"
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
severity: "high"
---
Please see CONTRIBUTING.md and CODE_OF_CONDUCT.md. For security issues, follow SECURITY.md` and avoid public disclosure.
---
CC BY-NC-ND 4.0. Developed by JonusNattapong and the Secure AI Community.