skillfence
v2.2.0
Published
Context-aware security scanner for AI agent skills, MCP servers, and tool configs. 95+ rules with false-positive reduction. Detects prompt injection, credential leaks, CORS misconfig, SSRF, tool poisoning, and data exfiltration.
Downloads
598
Maintainers
Readme
🛡️ SkillFence
Security scanner for AI agent skills, MCP servers, and tool configs.
Quick Start
npx skillfence scan . # Scan current directory
npx skillfence scan SKILL.md # Scan a file
npx skillfence scan --stdin # Pipe from stdin
npx skillfence rules # List all 76 rulesWhat It Detects
76 detection rules across 12 categories, mapped to OWASP MCP Top 10:
| Category | Rules | Examples | |----------|-------|---------| | 🔴 Remote Code Execution | 5 | curl pipe to shell, eval(), child_process | | 🎯 Prompt Injection | 5 | instruction override, role hijacking, hidden prompts | | 🔑 Credential Exposure | 5 | API keys, .env access, hardcoded secrets | | 💀 Destructive Operations | 4 | rm -rf, filesystem wipe, DROP TABLE | | 📤 Data Exfiltration | 6 | DNS tunneling, base64 encoding, file upload | | ⚡ MCP Attacks | 9 | tool poisoning, sampling abuse, forced execution, CORS | | 🧠 AI Safety | 8 | LangChain exploits, pickle RCE, HuggingFace code exec | | 🔐 Authentication | 3 | disabled auth, weak JWT, TLS bypass | | 📊 PII / Data Leak | 3 | password logging, token exposure, training data PII | | 🚫 DoS / Availability | 3 | infinite loops, rate limit bypass, token exhaustion | | 📦 Supply Chain | 6 | typosquatting, lifecycle scripts, unsafe-perm | | 💰 Crypto / Financial | 4 | wallet theft, transaction signing, token approvals | | 🔒 Privilege Escalation | 1 | sudo usage |
Pre-Commit Hook
Block dangerous code before it's committed:
npx skillfence install-hook # Install git pre-commit hookCommits with CRITICAL findings are blocked. Use git commit --no-verify to bypass.
GitHub Action
- uses: hhhashexe/skillfence@main
with:
path: '.'
fail-on: 'BLOCK'Output Formats
npx skillfence scan . --json # JSON output for CI/CD
npx skillfence scan . --sarif # SARIF for GitHub Security tabExit Codes
| Code | Verdict | Meaning | |------|---------|---------| | 0 | CLEAN | No issues found | | 1 | REVIEW | Low-severity findings | | 2 | WARN | Medium-severity findings | | 3 | BLOCK | Critical issues — must fix |
Install Globally
npm install -g skillfence
skillfence scan /path/to/projectZero Dependencies
SkillFence has zero npm dependencies. Just Node.js 16+.
API
SkillFence also offers a hosted API for CI/CD integration:
curl -X POST https://your-instance/audit \
-H "Content-Type: application/json" \
-d '{"skill_content": "..."}'License
MIT
