Skip to main content
Glama
AgentShield 2027
by aliuynk
README.md
# AgentShield 2027 — MCP Security Server, Prompt-Injection Scanner & EU AI Act Benchmark

Zero-dependency **Model Context Protocol (MCP)** security server and static scanner for Claude Desktop, Cursor, Windsurf, and VS Code.

- **Live Browser X-Ray Scanner & Benchmark:** https://aliuynk.github.io/mcp-agent-security-scanner/
- **MCP Tool-Poisoning & U+E0000 Defense Guide:** https://aliuynk.github.io/mcp-agent-security-scanner/mcp-tool-poisoning-guide.html
- **Pro Runtime Wire Firewall & 900-Sample Red-Team Kit ($39 Once):** https://tomris.gumroad.com/l/exdye

---

## Install as a Live MCP Server (`npx` — Zero Clone Required)

Add directly to `.cursor/mcp.json` or `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "agentshield-scanner": {
      "command": "npx",
      "args": ["-y", "github:aliuynk/mcp-agent-security-scanner"]
    }
  }
}
```

Exposes 3 local stdio MCP tools (`protocolVersion: "2024-11-05"`):
- `scan_untrusted_text` — Decodes hidden `U+E0001..U+E007F` Unicode tags, zero-width/bidi splits, mixed-script homoglyphs, Base64/Hex/ROT13 payloads, and ChatML escapes.
- `audit_mcp_config` — Audits `tools/list` JSON schemas or local `.cursor/mcp.json` configs for `<IMPORTANT>` tool poisoning, unpinned `npx` packages, and plaintext keys.
- `verify_url_ssrf_safe` — Blocks cloud metadata (`169.254.169.254`), localhost, decimal IP (`2852039166`), and octal (`0251.0376.0251.0376`) SSRF bypasses.

### Run as a GitHub Action in CI

```yaml
- uses: aliuynk/mcp-agent-security-scanner@v1.0.0
  with:
    path: .
```

---

## Measured Empirical Benchmark (900 Samples)

Tested deterministically across **600 adversarial vectors (12 attack families)** + **300 realistic hard-negative benign prompts** (`git` commits, SQL, JWTs, SHA-256 checksums, clean MCP `tools/list` schemas, and native Turkish/Russian/Greek/German messages):

| Metric | Measured Result |
| --- | --- |
| Adversarial Recall (600 vectors) | **100.00% (`600/600`)** |
| Hard-Negative False Positive Rate (300 benign) | **0.00% (`0/300`)** |
| Median Scan Latency (p50) | **0.0094 ms** |
| Tail Scan Latency (p99) | **0.2740 ms** |

### 12 Covered Attack Families (`50` cases each -> `50/50` caught)
1. `unicode_tag_smuggling` — Invisible `U+E0001..U+E007F` ASCII tag payloads (`LLM01:2025` / `Art. 15(5)`)
2. `zero_width_bidi_obfuscation` — `ZWSP` / `ZWNJ` / `RLO` keyword splitting (`LLM01:2025`)
3. `homoglyph_mixed_script` — Latin + Cyrillic/Greek mixed-script spoofing (`LLM01:2025`)
4. `encoded_payload_wrapping` — Base64, Hex, URL-encoded, and ROT13 wrapped overrides (`LLM01:2025`)
5. `mcp_tool_description_poisoning` — `<IMPORTANT>` hidden `~/.ssh`, `.env`, silent redirect prompts (`LLM03/LLM06` / `Art. 15(4)`)
6. `mcp_rugpull_schema_mutation` — Mid-session schema/description fingerprint drift (`LLM03:2025` / `Art. 15(4)`)
7. `markdown_image_exfiltration` — Query-param token exfiltration markdown beacons (`LLM02/LLM05`)
8. `indirect_rag_html_injection` — Hidden comments, `display:none`, `font-size:0` RAG injections (`LLM01:2025`)
9. `delimiter_chatml_escape` — `<|im_start|>system`, `</tool_output>`, `[/INST]` escapes (`LLM01:2025`)
10. `system_prompt_extraction` — Verbatim prompt leakage probes (`LLM07:2025`)
11. `ssrf_and_path_traversal_sink` — Decimal (`2852039166`), octal (`0251.0376.0251.0376`), IPv6 & IMDSv1 bypass (`LLM06:2025`)
12. `agent_doom_loop_trace` — 3x identical loops, `A -> B -> A -> B` ping-pong, and USD budget caps (`LLM10:2025` / `Art. 15(1)`)

---

## Free Open-Source Static Scanner (Included in This Repo)

Scan your `.cursor/mcp.json`, `claude_desktop_config.json`, or repository locally with Node.js `>=20` and zero dependencies:

```bash
git clone https://github.com/aliuynk/mcp-agent-security-scanner.git
node mcp-agent-security-scanner/free-scanner/scan-mcp-configs.mjs ~/.cursor
```

## Pro Engineering Kit ($39 One-Time — Zero Subscriptions)

Upgrade to **[AgentShield 2027 Pro](https://tomris.gumroad.com/l/exdye)** to unlock:
1. **`pro-pack/mcp-guard/mcp-firewall.mjs`** — Drop-in stdio JSON-RPC firewall for any MCP server with schema rug-pull pinning, SSRF blocking, Unicode scrubbing, and doom-loop interruption.
2. **`pro-pack/llm-proxy/circuit-breaker-worker.js`** — Zero-dep Cloudflare Worker proxy enforcing per-session USD caps and loop breaking across OpenAI, Anthropic, Gemini & OpenRouter.
3. **`pro-pack/python-sdk/agentshield.py`** — `@guard_agent_run` decorator, `DoomLoopBreaker`, `is_ssrf_url`, and `scan_untrusted_text` for FastAPI, LangGraph & CrewAI.
4. **`pro-pack/eu-ai-act-auditor/run-redteam-audit.mjs`** + full **900-sample JSONL corpus** generating a print-ready **EU AI Act Article 15 Technical Evidence Dossier**.