Skip to main content

Scan agent skill files for security vulnerabilities. 22 rules across prompt injection, capability escalation, data exfiltration, encoded payloads, and composition risks.

Project description

agent-skill-scanner

Scan agent skill files for security vulnerabilities. 22 detection rules across prompt injection, capability escalation, data exfiltration, encoded payloads, and composition risks.

Built for OpenClaw and MCP skill files. Generic SAST tools (semgrep, CodeQL) produce zero detections on these formats because they lack rules for markdown-embedded code and YAML skill definitions. This scanner fills that gap.

Install

pip install agent-skill-scanner

Usage

Scan a directory of skill files:

agent-skill-scan scan --path ./skills/

Example output:

Skill                                    Findings Severity
--------------------------------------------------------------
anti-injection-skill                            9 CRITICAL
askhuman                                        3 CRITICAL
azure-devops                                    1 HIGH
curl-http                                       3 CRITICAL
deploy-agent                                    0 CLEAN
--------------------------------------------------------------
TOTAL                                          16

Scanned 5 skills, 16 findings.

Findings by category:
  prompt_injection: 6
  capability_escalation: 5
  data_exfiltration: 3
  encoded_payload: 2

Options

agent-skill-scan scan --path ./skills/ --output json    # JSON output for CI
agent-skill-scan scan --path ./skills/ --quiet          # Exit code only (0=clean, 1=findings)
agent-skill-scan scan --path ./skills/ --min-severity HIGH  # Filter by severity
agent-skill-scan scan --path ./skill.md                 # Scan a single file

Exit codes

Code Meaning
0 No HIGH or CRITICAL findings
1 HIGH or CRITICAL findings detected

What it detects

22 rules across 5 categories:

Category Rules Examples
Prompt injection 5 System prompt override, role hijacking, instruction injection
Capability escalation 5 Privilege escalation commands, shell spawning, persistence mechanisms
Data exfiltration 4 Credential access, environment variable reads, outbound data transfer
Encoded payloads 4 Base64 encoded commands, hex payloads, obfuscated strings
Composition risks 4 Unrestricted tool chaining, cross-skill data flow, trust boundary violations

How it works

The scanner parses agent skill files (SKILL.md, MCP tool definitions, YAML configs with name:/description: frontmatter) and runs pattern-based detection against code blocks, full text, and structured fields. Rules are defined in YAML and can be extended.

Research

This scanner was built from findings in the agent-skill-scanner research project. The core finding: generic SAST tools produce zero detections on agent skill files (McNemar chi2=9.09, p=0.003). The gap is structural — no existing rules target markdown/YAML skill formats.

Limitations

  • Pattern-based detection only — no semantic analysis or LLM-powered reasoning
  • Designed for OpenClaw SKILL.md and MCP tool definitions — may miss formats from other agent frameworks
  • Rules cover known attack patterns from published research, not zero-days
  • False positives possible on skills that legitimately use system commands

License

MIT — Rex Coleman, 2026

More research at rexcoleman.dev.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_skill_scanner-0.1.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_skill_scanner-0.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file agent_skill_scanner-0.1.0.tar.gz.

File metadata

  • Download URL: agent_skill_scanner-0.1.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for agent_skill_scanner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0158b9fe79393840dd90459df80a114c9d259368ebfbfde5b2af2bafec83012b
MD5 e251e56554af21278ec037949ec4cace
BLAKE2b-256 1f9da0d81c5796eb8bfcb157601734fe244b74b4a350e7bd99d372aef15999e8

See more details on using hashes here.

File details

Details for the file agent_skill_scanner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_skill_scanner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb8edcbf153849510dd4fdf2733934cd91a369171c0034fbdcec9412985c312b
MD5 ff0bd67ff6f0adc60e0b5d501d555842
BLAKE2b-256 50c09c65f9d0ab66c1b67530e8b88c53eed676814ebfbf8cfc3807c99c7d7c0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page