AgentShield — Security Scanner for AI Agents
AgentShield — Security Scanner for AI Agents
AgentShield — Security Scanner for AI Agents
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
# AgentShield — Security Scanner for AI Agents
Scan AI agent skills, MCP servers, and plugins for security vulnerabilities before installation.
## When to use
- Before installing a new MCP server or agent skill
- In CI/CD pipelines to gate unsafe code
- When auditing existing agent configurations
- When reviewing Dify plugins (.difypkg archives)
## Quick start
```bash
# Scan a skill or MCP server
npx @elliotllliu/agent-shield scan ./path-to-skill/
# Discover agents installed on your machine
npx @elliotllliu/agent-shield discover
# AI-powered deep analysis
npx @elliotllliu/agent-shield scan ./skill/ --ai --provider openai --model gpt-4o
# Scan Dify plugin archives
npx @elliotllliu/agent-shield scan ./plugin.difypkg
# CI/CD: fail if score too low
npx @elliotllliu/agent-shield scan ./skill/ --fail-under 70
```
## What it detects
### Code Security (14 rules)
- **data-exfil**: Reads sensitive data + sends HTTP requests
- **backdoor**: eval(), exec(), new Function() with dynamic input
- **reverse-shell**: Outbound socket connections piped to shell
- **crypto-mining**: Mining pool connections, xmrig, coinhive
- **credential-hardcode**: Hardcoded AWS keys, GitHub PATs, Stripe tokens
- **obfuscation**: eval(atob(...)), hex chains, String.fromCharCode
### Agent-Specific (7 rules)
- **prompt-injection**: 55+ patterns in 8 languages (中/日/韓/俄/阿/西/法/德)
- **tool-shadowing**: Cross-server tool name conflicts
- **env-leak**: Environment variables + outbound HTTP
- **network-ssrf**: User-controlled URLs, AWS metadata access
- **phone-home**: Periodic timer + HTTP request (C2 pattern)
- **toxic-flow**: Cross-tool data leak and destructive flows
- **skill-risks**: Financial ops, untrusted content
### Advanced Analysis (6 rules — unique to AgentShield)
- **cross-file**: Cross-file data flow tracing via import graph
- **attack-chain**: 5-stage kill chain detection (Recon → Access → Collection → Exfil → Persistence)
- **multilang-injection**: 8-language prompt injection detection
- **python-ast**: AST taint tracking (not regex)
- **description-integrity**: Description vs code mismatch detection
- **mcp-runtime**: MCP runtime configuration analysis
## Scoring
| Score | Risk Level |
|-------|-----------|
| 90-100 | ✅ Low Risk — safe to install |
| 70-89 | 🟡 Moderate — review warnings |
| 40-69 | 🟠 High Risk — investigate |
| 0-39 | 🔴 Critical — do not install |
## Links
- **GitHub**: https://github.com/elliotllliu/agent-shield
- **npm**: https://www.npmjs.com/package/@elliotllliu/agent-shield
- **License**: MIT
文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。