As AI coding agents become the primary interface for development, the attack surface has shifted from runtime exploits to the configuration files that define agent behavior. Toolfence-scan, a new open-source CLI tool released by StockGorilla, targets this gap by providing static analysis for skills, instructions, and prompts used by Cursor, Claude, and GitHub Copilot. The tool, currently at version 0.1.3, scans for prompt injection, hidden Unicode characters, credential exfiltration risks, and over-broad permissions before these files are trusted by the agent.
Scanning the New Attack Surface
The tool operates as a pre-install security gate, analyzing a wide array of file types that dictate how AI agents behave. It specifically targets SKILL.md files, .cursorrules, AGENTS.md, CLAUDE.md, and various GitHub Copilot instruction files. It also inspects MCP (Model Context Protocol) configuration files, such as .cursor/mcp.json and claude_desktop_config.json, which are critical for enabling external tool use. By running npx toolfence-scan ., developers can identify dangerous patterns before they compromise the development environment.
Rule Packs and Severity Levels
Toolfence-scan employs a structured rule pack system to categorize threats. Critical severity rules detect prompt injection attempts, such as "ignore previous instructions" or jailbreak phrases, as well as hardcoded secrets matching AWS, GitHub, or OpenAI key shapes. High-severity rules catch hidden Unicode characters used for concealment, network exfiltration patterns like Discord webhooks or raw IPs, and remote execution commands like curl | bash. The tool supports suppression comments like # skill-scan-ignore for false positives and integrates with CI pipelines via SARIF output for GitHub CodeQL.
Integration with Toolfence Gate
Beyond simple reporting, the tool bridges into the broader Toolfence ecosystem by generating gate rules. Using the --emit-gate-rules flag, developers can create JSON fragments that define paste.deny_tools or tool_overrides_json policies. This allows teams to move from detection to enforcement, ensuring that risky skills identified during the scan are automatically blocked or restricted in production environments. The monorepo structure also includes fixtures with known-bad skills to validate the scanner's effectiveness during testing.
Key Takeaways
- Toolfence-scan provides static analysis for AI agent configuration files, targeting prompt injection and credential risks.
- It supports major AI coding tools including Cursor, Claude, and GitHub Copilot, scanning skills, rules, and MCP configs.
- The tool integrates with CI/CD pipelines via SARIF output and can generate policy rules for enforcement tools.
- Current version 0.1.3 is available via npx, with a scoped alias
@toolfence/scanplanned for future npm releases.
The Bottom Line
Static analysis for agent configs is a necessary evolution in AI security. Toolfence-scan provides the essential first line of defense, though teams must still validate gate rules manually to avoid breaking legitimate workflows.