# mcp-skill-sec — 8-pattern malicious-skill scanner

> Deterministic pre-install audit of any agent skill/prompt against the 8 malicious-skill supply-chain patterns (R1 injection, R2 exfil, R3 secrets, R4 dangerous commands, R5 obfuscation, R6 untrusted fetch, R7 credential access, R8 privilege escalation). No LLM, no network — PASS/FLAG verdict with line-level evidence per finding.

mcp-skill-sec — 8-pattern malicious-skill scanner is a free AI agent skill on Agensi by Robert Garrison, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Robert Garrison](https://www.agensi.io/creators/sudoshellz)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Uses: 4
- Version: 1.0
- Last updated: 2026-08-28
- Security: scan passed (2026-08-28); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mcp-skill-sec-8-pattern-malicious-skill-scanner
- Tags: ai-agents, security, workflow-automation, python, mcp

## About this skill

### mcp-skill-sec — deterministic skill security audit

Audit any agent skill, system prompt, or downloaded skill collection against the **8 malicious-skill supply-chain patterns** BEFORE you run it.

#### What it does
Scans a skill/prompt for:
- **R1** prompt injection / instruction hijack (`ignore previous instructions`)
- **R2** data exfiltration intent
- **R3** hardcoded secrets / credentials
- **R4** dangerous commands (`rm -rf /`, `curl | sh`)
- **R5** obfuscation / hidden behavior (base64-exec, eval)
- **R6** untrusted external fetches
- **R7** credential access (`~/.ssh`, `.aws/credentials`, `.env`)
- **R8** privilege escalation

Every finding carries a **severity** + **line number** + the matching evidence line. Verdict is **PASS** only when there are no critical/high findings. Reproducible and auditable.

#### Why it's different
- **Deterministic** — same input always yields the same verdict; no ML, no hallucination.
- **No network calls** — your skill content never leaves your machine.
- **Line-level evidence** — not a black-box score; you see exactly what tripped and where.

#### Tools
- `audit_text(text, filename)` — audit a pasted skill / system prompt
- `audit_skill_file(path)` — audit a SKILL.md / AGENTS.md on disk
- `audit_directory(path, pattern)` — scan a whole skills collection
- `rule_list()` — dump the R1–R8 catalog

#### Install
```bash
uv tool install git+https://github.com/sudo-ai-git/mcp-skill-sec
python3 mcp_server.py                    # stdio
python3 mcp_server.py --http --port 8000 # streamable HTTP
```
Full source, tests, and the audit checklist are in the GitHub repo (MIT). This is the tool to run before installing any skill you didn't write.

## Requires

- Python
- Skill Sec MCP

## Known limitations

Static analysis only. Does not sandbox runtime execution or perform dynamic behavioral analysis.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the mcp-skill-sec — 8-pattern malicious-skill scanner skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this deterministic scan differ from using an LLM to check for malicious prompts?

Unlike LLM-based scanners that can hallucinate, this tool uses a deterministic 8-pattern engine that provides 100% reproducible results with line-level evidence for every finding.

### Does my skill content or system prompt get sent to the cloud for analysis?

No, this skill operates entirely offline with no network calls, ensuring your proprietary prompts and sensitive skill code never leave your local environment during the audit.

### What specific types of security threats can mcp-skill-sec detect?

The scanner identifies eight specific risk vectors, including prompt injection (R1), data exfiltration (R2), dangerous shell commands (R4), and unauthorized credential access (R7).

### Is this scanner compatible with all AI agent frameworks and skill formats?

mcp-skill-sec is designed for any platform supporting the Model Context Protocol (MCP) and can audit any skill formatted in text, Markdown, or standard script files.

### Can I use this to scan a large library of downloaded skills all at once?

Yes, the 'audit_directory' tool allows you to perform bulk scans on entire skill collections or repositories, providing a PASS/FLAG verdict for every file in the batch.

### What criteria must a skill meet to receive a 'PASS' verdict?

A 'PASS' verdict is only issued if the tool finds zero critical or high-severity indicators across all eight security patterns, providing a clear 'go/no-go' signal for deployment.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
