@elliotllliu/agentshield 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -107
- package/README.zh-CN.md +95 -32
- package/package.json +42 -3
package/README.md
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
# 🛡️ AgentShield
|
|
2
2
|
|
|
3
|
-
Security scanner for AI agent skills, MCP servers, and plugins
|
|
3
|
+
**Security scanner for AI agent skills, MCP servers, and plugins.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@elliotllliu/agentshield)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
Catch data exfiltration, backdoors, privilege escalation, credential leaks, and supply chain vulnerabilities **before** they reach your AI agents.
|
|
9
|
+
|
|
10
|
+
> **We scanned the top ClawHub skill repos — the average security score was 47/100.** [Read the full report →](docs/clawhub-security-report.md)
|
|
11
|
+
|
|
12
|
+
## Why AgentShield?
|
|
13
|
+
|
|
14
|
+
AI agents install and execute third-party skills, MCP servers, and plugins with minimal security review. A single malicious skill can:
|
|
15
|
+
|
|
16
|
+
- 🔑 **Steal credentials** — SSH keys, AWS secrets, API tokens
|
|
17
|
+
- 📤 **Exfiltrate data** — read sensitive files and send them to external servers
|
|
18
|
+
- 💀 **Open backdoors** — `eval()`, reverse shells, dynamic code execution
|
|
19
|
+
- ⛏️ **Mine crypto** — hijack compute for cryptocurrency mining
|
|
20
|
+
- 🕵️ **Bypass permissions** — claim "read-only" but execute shell commands
|
|
21
|
+
|
|
22
|
+
AgentShield catches these patterns with **16 security rules** in under 50ms.
|
|
6
23
|
|
|
7
24
|
## Quick Start
|
|
8
25
|
|
|
@@ -10,27 +27,55 @@ Catch data exfiltration, backdoors, privilege escalation, and supply chain vulne
|
|
|
10
27
|
npx @elliotllliu/agentshield scan ./my-skill/
|
|
11
28
|
```
|
|
12
29
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
|
20
|
-
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
|
30
|
+
No installation required. Works with Node.js 18+.
|
|
31
|
+
|
|
32
|
+
## What It Detects — 16 Security Rules
|
|
33
|
+
|
|
34
|
+
### 🔴 Critical (auto-fail)
|
|
35
|
+
|
|
36
|
+
| Rule | Detects |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `data-exfil` | Reads sensitive files + sends HTTP requests (exfiltration pattern) |
|
|
39
|
+
| `backdoor` | `eval()`, `new Function()`, `child_process.exec()` with dynamic input |
|
|
40
|
+
| `reverse-shell` | Outbound socket connections piped to `/bin/sh` |
|
|
41
|
+
| `crypto-mining` | Mining pool connections, xmrig, coinhive patterns |
|
|
42
|
+
| `credential-hardcode` | Hardcoded AWS keys (`AKIA...`), GitHub PATs (`ghp_...`), Stripe keys |
|
|
43
|
+
| `env-leak` | `process.env` secrets + outbound HTTP (environment variable theft) |
|
|
44
|
+
| `obfuscation` | `eval(atob(...))`, hex strings, `String.fromCharCode` obfuscation |
|
|
45
|
+
| `typosquatting` | Suspicious npm names: `1odash` → `lodash`, `axois` → `axios` |
|
|
46
|
+
| `hidden-files` | `.env` files with `PASSWORD`, `SECRET`, `API_KEY` committed to repo |
|
|
47
|
+
|
|
48
|
+
### 🟡 Warning (review recommended)
|
|
49
|
+
|
|
50
|
+
| Rule | Detects |
|
|
51
|
+
|------|---------|
|
|
52
|
+
| `network-ssrf` | User-controlled URLs in fetch, AWS metadata endpoint access |
|
|
53
|
+
| `privilege` | SKILL.md permissions vs actual code behavior mismatch |
|
|
54
|
+
| `supply-chain` | Known CVEs in npm dependencies (`npm audit`) |
|
|
55
|
+
| `sensitive-read` | Access to `~/.ssh/id_rsa`, `~/.aws/credentials`, `~/.kube/config` |
|
|
56
|
+
| `excessive-perms` | Too many or dangerous permissions in SKILL.md |
|
|
57
|
+
| `phone-home` | `setInterval` + HTTP requests (beacon/C2 heartbeat pattern) |
|
|
58
|
+
| `mcp-manifest` | MCP server: wildcard perms, undeclared capabilities, suspicious tool descriptions |
|
|
59
|
+
|
|
60
|
+
## Real-World Results
|
|
61
|
+
|
|
62
|
+
We scanned the **top 9 ClawHub skill repositories** (700K+ combined installs):
|
|
63
|
+
|
|
64
|
+
| Repository | Installs | Score | Risk |
|
|
65
|
+
|------------|----------|-------|------|
|
|
66
|
+
| vercel-labs/agent-skills | 157K | 🔴 0/100 | Critical — deploy scripts with `$(curl)` command substitution |
|
|
67
|
+
| obra/superpowers | 94K | 🔴 0/100 | Critical — dynamic code execution in render scripts |
|
|
68
|
+
| coreyhaines31/marketingskills | 42K | 🔴 0/100 | Critical — 122 critical findings (CRM credential patterns) |
|
|
69
|
+
| anthropics/skills | 36K | 🔴 35/100 | Critical — template with exec() |
|
|
70
|
+
| expo/skills | 11K | 🔴 5/100 | Critical — fetch script reads env vars |
|
|
71
|
+
| remotion-dev/skills | 140K | 🟡 80/100 | Moderate — minor warnings |
|
|
72
|
+
| google-labs-code/stitch-skills | 63K | ✅ 100/100 | Clean |
|
|
73
|
+
| supercent-io/skills-template | 106K | ✅ 100/100 | Clean |
|
|
74
|
+
| squirrelscan/skills | 34K | ✅ 100/100 | Clean |
|
|
75
|
+
|
|
76
|
+
**Average score: 47/100** — over half of popular skill repos have critical security findings.
|
|
77
|
+
|
|
78
|
+
[📊 Full security report →](docs/clawhub-security-report.md)
|
|
34
79
|
|
|
35
80
|
## Example Output
|
|
36
81
|
|
|
@@ -39,80 +84,47 @@ npx @elliotllliu/agentshield scan ./my-skill/
|
|
|
39
84
|
📁 Scanned: ./my-skill/ (3 files, 44 lines)
|
|
40
85
|
|
|
41
86
|
🔴 CRITICAL (3)
|
|
42
|
-
├─ index.ts:13 — [data-exfil] Reads sensitive data and sends HTTP request
|
|
87
|
+
├─ index.ts:13 — [data-exfil] Reads sensitive data and sends HTTP request
|
|
43
88
|
├─ index.ts:20 — [backdoor] eval() with dynamic input
|
|
44
|
-
└─
|
|
89
|
+
└─ backdoor.sh:6 — [backdoor] shell eval with variable
|
|
45
90
|
|
|
46
91
|
🟡 WARNING (2)
|
|
47
92
|
├─ index.ts:23 — [privilege] Code uses 'exec' but SKILL.md doesn't declare it
|
|
48
93
|
└─ index.ts:6 — [sensitive-read] Accesses SSH private key
|
|
49
94
|
|
|
50
|
-
🟢 INFO (1)
|
|
51
|
-
└─ SKILL.md — [privilege] Detected capabilities: exec, read, web_fetch
|
|
52
|
-
|
|
53
95
|
✅ Score: 0/100 (Critical Risk)
|
|
96
|
+
⏱ 16ms
|
|
54
97
|
```
|
|
55
98
|
|
|
56
99
|
## Usage
|
|
57
100
|
|
|
58
101
|
```bash
|
|
59
102
|
# Scan a directory
|
|
60
|
-
agentshield scan ./path/to/skill/
|
|
103
|
+
npx @elliotllliu/agentshield scan ./path/to/skill/
|
|
61
104
|
|
|
62
|
-
# JSON output (for CI/CD)
|
|
63
|
-
agentshield scan ./skill/ --json
|
|
105
|
+
# JSON output (for CI/CD pipelines)
|
|
106
|
+
npx @elliotllliu/agentshield scan ./skill/ --json
|
|
64
107
|
|
|
65
|
-
# Fail CI if score
|
|
66
|
-
agentshield scan ./skill/ --fail-under 70
|
|
108
|
+
# Fail CI if score drops below threshold
|
|
109
|
+
npx @elliotllliu/agentshield scan ./skill/ --fail-under 70
|
|
67
110
|
|
|
68
111
|
# Disable specific rules
|
|
69
|
-
agentshield scan ./skill/ --disable supply-chain,phone-home
|
|
112
|
+
npx @elliotllliu/agentshield scan ./skill/ --disable supply-chain,phone-home
|
|
70
113
|
|
|
71
114
|
# Only run specific rules
|
|
72
|
-
agentshield scan ./skill/ --enable backdoor,data-exfil
|
|
73
|
-
|
|
74
|
-
# Shorthand (directory as first arg)
|
|
75
|
-
agentshield ./skill/
|
|
115
|
+
npx @elliotllliu/agentshield scan ./skill/ --enable backdoor,data-exfil
|
|
76
116
|
|
|
77
117
|
# Generate config files
|
|
78
|
-
agentshield init
|
|
118
|
+
npx @elliotllliu/agentshield init
|
|
79
119
|
|
|
80
|
-
# Watch mode
|
|
81
|
-
agentshield watch ./skill/
|
|
120
|
+
# Watch mode — re-scan on file changes
|
|
121
|
+
npx @elliotllliu/agentshield watch ./skill/
|
|
82
122
|
|
|
83
123
|
# Compare two versions
|
|
84
|
-
agentshield compare ./skill-v1/ ./skill-v2/
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Configuration
|
|
88
|
-
|
|
89
|
-
Create `.agentshield.yml` in your project (or run `agentshield init`):
|
|
90
|
-
|
|
91
|
-
```yaml
|
|
92
|
-
rules:
|
|
93
|
-
disable:
|
|
94
|
-
- supply-chain # skip npm audit
|
|
95
|
-
- phone-home # allow periodic HTTP
|
|
96
|
-
|
|
97
|
-
severity:
|
|
98
|
-
sensitive-read: info # downgrade to info
|
|
99
|
-
|
|
100
|
-
failUnder: 70 # CI threshold
|
|
124
|
+
npx @elliotllliu/agentshield compare ./skill-v1/ ./skill-v2/
|
|
101
125
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- "*.test.ts"
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### `.agentshieldignore`
|
|
108
|
-
|
|
109
|
-
Exclude files from scanning (same syntax as `.gitignore`):
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
node_modules/
|
|
113
|
-
dist/
|
|
114
|
-
*.test.ts
|
|
115
|
-
__tests__/
|
|
126
|
+
# Generate a security badge for your README
|
|
127
|
+
npx @elliotllliu/agentshield badge ./skill/
|
|
116
128
|
```
|
|
117
129
|
|
|
118
130
|
## CI Integration
|
|
@@ -141,55 +153,103 @@ jobs:
|
|
|
141
153
|
run: npx -y @elliotllliu/agentshield scan ./skills/ --fail-under 70
|
|
142
154
|
```
|
|
143
155
|
|
|
144
|
-
### Action Inputs
|
|
156
|
+
### Action Inputs & Outputs
|
|
145
157
|
|
|
146
158
|
| Input | Default | Description |
|
|
147
159
|
|-------|---------|-------------|
|
|
148
160
|
| `path` | `.` | Directory to scan |
|
|
149
|
-
| `fail-under` |
|
|
150
|
-
| `format` | `terminal` |
|
|
151
|
-
|
|
152
|
-
### Action Outputs
|
|
161
|
+
| `fail-under` | — | Fail if score < threshold (0-100) |
|
|
162
|
+
| `format` | `terminal` | `terminal` or `json` |
|
|
153
163
|
|
|
154
164
|
| Output | Description |
|
|
155
165
|
|--------|-------------|
|
|
156
166
|
| `score` | Security score (0-100) |
|
|
157
167
|
| `findings` | Number of findings |
|
|
158
168
|
|
|
169
|
+
## Configuration
|
|
170
|
+
|
|
171
|
+
Create `.agentshield.yml` (or run `agentshield init`):
|
|
172
|
+
|
|
173
|
+
```yaml
|
|
174
|
+
rules:
|
|
175
|
+
disable:
|
|
176
|
+
- supply-chain # skip npm audit
|
|
177
|
+
- phone-home # allow periodic HTTP
|
|
178
|
+
|
|
179
|
+
severity:
|
|
180
|
+
sensitive-read: info # downgrade to info
|
|
181
|
+
|
|
182
|
+
failUnder: 70 # CI threshold
|
|
183
|
+
|
|
184
|
+
ignore:
|
|
185
|
+
- "tests/**"
|
|
186
|
+
- "*.test.ts"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `.agentshieldignore`
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
node_modules/
|
|
193
|
+
dist/
|
|
194
|
+
*.test.ts
|
|
195
|
+
__tests__/
|
|
196
|
+
```
|
|
197
|
+
|
|
159
198
|
## Scoring
|
|
160
199
|
|
|
161
|
-
|
|
200
|
+
| Severity | Points Deducted |
|
|
201
|
+
|----------|----------------|
|
|
202
|
+
| 🔴 Critical | -25 |
|
|
203
|
+
| 🟡 Warning | -10 |
|
|
204
|
+
| 🟢 Info | 0 |
|
|
205
|
+
|
|
206
|
+
| Score | Risk Level | Recommendation |
|
|
207
|
+
|-------|------------|----------------|
|
|
208
|
+
| 90-100 | ✅ Low Risk | Safe to install |
|
|
209
|
+
| 70-89 | 🟡 Moderate | Review warnings |
|
|
210
|
+
| 40-69 | 🟠 High Risk | Investigate before using |
|
|
211
|
+
| 0-39 | 🔴 Critical | Do not install |
|
|
212
|
+
|
|
213
|
+
## Supported Platforms
|
|
214
|
+
|
|
215
|
+
- **AI Agent Skills** — OpenClaw, Codex, Claude Code
|
|
216
|
+
- **MCP Servers** — Model Context Protocol tool servers
|
|
217
|
+
- **npm Packages** — any npm package with executable code
|
|
218
|
+
- **General** — any directory with JS/TS/Python/Shell code
|
|
219
|
+
|
|
220
|
+
### Supported File Types
|
|
162
221
|
|
|
163
|
-
|
|
|
222
|
+
| Language | Extensions |
|
|
164
223
|
|----------|-----------|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
##
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
- [
|
|
191
|
-
- [ ]
|
|
192
|
-
- [ ]
|
|
224
|
+
| JavaScript/TypeScript | `.js`, `.ts`, `.mjs`, `.cjs`, `.tsx`, `.jsx` |
|
|
225
|
+
| Python | `.py` |
|
|
226
|
+
| Shell | `.sh`, `.bash`, `.zsh` |
|
|
227
|
+
| Config | `.json`, `.yaml`, `.yml`, `.toml` |
|
|
228
|
+
| Docs | `SKILL.md` (permission analysis) |
|
|
229
|
+
|
|
230
|
+
## Comparison with Other Tools
|
|
231
|
+
|
|
232
|
+
| Feature | AgentShield | npm audit | Snyk | ESLint Security |
|
|
233
|
+
|---------|------------|-----------|------|-----------------|
|
|
234
|
+
| AI skill/MCP specific rules | ✅ | ❌ | ❌ | ❌ |
|
|
235
|
+
| Data exfiltration detection | ✅ | ❌ | ❌ | ❌ |
|
|
236
|
+
| Permission mismatch (SKILL.md) | ✅ | ❌ | ❌ | ❌ |
|
|
237
|
+
| Credential hardcode detection | ✅ | ❌ | ✅ | ✅ |
|
|
238
|
+
| Supply chain CVEs | ✅ | ✅ | ✅ | ❌ |
|
|
239
|
+
| Zero config | ✅ | ✅ | ❌ | ❌ |
|
|
240
|
+
| No API key required | ✅ | ✅ | ❌ | ✅ |
|
|
241
|
+
| < 50ms scan time | ✅ | ❌ | ❌ | ❌ |
|
|
242
|
+
|
|
243
|
+
## Contributing
|
|
244
|
+
|
|
245
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to add new rules.
|
|
246
|
+
|
|
247
|
+
## Links
|
|
248
|
+
|
|
249
|
+
- 📦 [npm](https://www.npmjs.com/package/@elliotllliu/agentshield)
|
|
250
|
+
- 📖 [Rule Documentation](docs/rules.md)
|
|
251
|
+
- 📊 [ClawHub Security Report](docs/clawhub-security-report.md)
|
|
252
|
+
- 🇨🇳 [中文 README](README.zh-CN.md)
|
|
193
253
|
|
|
194
254
|
## License
|
|
195
255
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
# 🛡️ AgentShield
|
|
1
|
+
# 🛡️ AgentShield — AI Agent 安全扫描器
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@elliotllliu/agentshield)
|
|
4
|
+
[](LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
专为 AI Agent 技能、MCP Server、插件设计的安全扫描工具。在安装第三方扩展之前,检测数据窃取、后门、凭证泄露和供应链漏洞。
|
|
7
|
+
|
|
8
|
+
> **我们扫描了 ClawHub 热门 skill 仓库 — 平均安全分仅 47/100。** [查看完整报告 →](docs/clawhub-security-report.md)
|
|
9
|
+
|
|
10
|
+
## 为什么需要 AgentShield?
|
|
11
|
+
|
|
12
|
+
AI Agent 会安装并执行第三方技能和插件,安全审查几乎为零。一个恶意 skill 就能:
|
|
13
|
+
|
|
14
|
+
- 🔑 **偷凭证** — SSH 密钥、AWS Secret、API Token
|
|
15
|
+
- 📤 **外泄数据** — 读取敏感文件发送到外部服务器
|
|
16
|
+
- 💀 **植入后门** — eval()、反弹 Shell、动态代码执行
|
|
17
|
+
- ⛏️ **挖矿** — 利用你的算力挖加密货币
|
|
18
|
+
- 🕵️ **越权** — 声称只读但实际执行 Shell 命令
|
|
19
|
+
|
|
20
|
+
AgentShield 用 **16 条安全规则**在 50ms 内检出这些威胁。
|
|
6
21
|
|
|
7
22
|
## 快速开始
|
|
8
23
|
|
|
@@ -10,37 +25,77 @@ AI Agent 技能/插件安全扫描器
|
|
|
10
25
|
npx @elliotllliu/agentshield scan ./my-skill/
|
|
11
26
|
```
|
|
12
27
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
|
20
|
-
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
无需安装,Node.js 18+ 即可运行。
|
|
29
|
+
|
|
30
|
+
## 16 条安全规则
|
|
31
|
+
|
|
32
|
+
### 🔴 严重(自动判定不安全)
|
|
33
|
+
|
|
34
|
+
| 规则 | 检测内容 |
|
|
35
|
+
|------|----------|
|
|
36
|
+
| `data-exfil` | 读敏感文件 + 发 HTTP 请求(数据外泄模式) |
|
|
37
|
+
| `backdoor` | `eval()`、`exec()`、动态代码执行 |
|
|
38
|
+
| `reverse-shell` | Socket 外连 + Shell 管道 |
|
|
39
|
+
| `crypto-mining` | 矿池连接、xmrig、coinhive |
|
|
40
|
+
| `credential-hardcode` | 硬编码 AWS Key、GitHub PAT、Stripe Key |
|
|
41
|
+
| `env-leak` | 环境变量 + HTTP 外发 |
|
|
42
|
+
| `obfuscation` | base64+eval、十六进制混淆 |
|
|
43
|
+
| `typosquatting` | npm 包名仿冒(`1odash` → `lodash`) |
|
|
44
|
+
| `hidden-files` | `.env` 明文密钥 |
|
|
45
|
+
|
|
46
|
+
### 🟡 警告(建议审查)
|
|
47
|
+
|
|
48
|
+
| 规则 | 检测内容 |
|
|
49
|
+
|------|----------|
|
|
50
|
+
| `network-ssrf` | 用户可控 URL、SSRF |
|
|
51
|
+
| `privilege` | SKILL.md 声明 vs 代码实际行为不匹配 |
|
|
52
|
+
| `supply-chain` | npm 依赖已知 CVE |
|
|
53
|
+
| `sensitive-read` | 读取 SSH 密钥、AWS 凭证 |
|
|
54
|
+
| `excessive-perms` | 权限声明过多 |
|
|
55
|
+
| `phone-home` | 定时器 + HTTP 心跳 |
|
|
56
|
+
| `mcp-manifest` | MCP Server 通配权限、可疑工具描述 |
|
|
57
|
+
|
|
58
|
+
## 真实扫描数据
|
|
59
|
+
|
|
60
|
+
我们扫了 ClawHub **Top 9 热门 skill 仓库**(总安装量 70 万+):
|
|
61
|
+
|
|
62
|
+
| 仓库 | 安装量 | 分数 | 风险 |
|
|
63
|
+
|------|--------|------|------|
|
|
64
|
+
| vercel-labs/agent-skills | 157K | 🔴 0/100 | deploy 脚本有 `$(curl)` 命令替换 |
|
|
65
|
+
| obra/superpowers | 94K | 🔴 0/100 | 渲染脚本有动态代码执行 |
|
|
66
|
+
| coreyhaines31/marketingskills | 42K | 🔴 0/100 | 122 个 critical(CRM 凭证模式) |
|
|
67
|
+
| anthropics/skills | 36K | 🔴 35/100 | 模板有 exec() |
|
|
68
|
+
| google-labs-code/stitch-skills | 63K | ✅ 100/100 | 干净 |
|
|
69
|
+
| supercent-io/skills-template | 106K | ✅ 100/100 | 干净 |
|
|
70
|
+
|
|
71
|
+
**平均分:47/100** — 超半数热门 skill 有严重安全隐患。
|
|
32
72
|
|
|
33
73
|
## 使用方法
|
|
34
74
|
|
|
35
75
|
```bash
|
|
36
76
|
# 扫描目录
|
|
37
|
-
npx @elliotllliu/agentshield scan ./
|
|
77
|
+
npx @elliotllliu/agentshield scan ./skill/
|
|
38
78
|
|
|
39
|
-
# JSON
|
|
79
|
+
# JSON 输出
|
|
40
80
|
npx @elliotllliu/agentshield scan ./skill/ --json
|
|
41
81
|
|
|
42
|
-
# CI
|
|
82
|
+
# CI 门禁
|
|
43
83
|
npx @elliotllliu/agentshield scan ./skill/ --fail-under 70
|
|
84
|
+
|
|
85
|
+
# 禁用特定规则
|
|
86
|
+
npx @elliotllliu/agentshield scan ./skill/ --disable supply-chain
|
|
87
|
+
|
|
88
|
+
# 初始化配置
|
|
89
|
+
npx @elliotllliu/agentshield init
|
|
90
|
+
|
|
91
|
+
# 实时监控
|
|
92
|
+
npx @elliotllliu/agentshield watch ./skill/
|
|
93
|
+
|
|
94
|
+
# 版本对比
|
|
95
|
+
npx @elliotllliu/agentshield compare ./v1/ ./v2/
|
|
96
|
+
|
|
97
|
+
# 生成安全徽章
|
|
98
|
+
npx @elliotllliu/agentshield badge ./skill/
|
|
44
99
|
```
|
|
45
100
|
|
|
46
101
|
## GitHub Actions 集成
|
|
@@ -52,14 +107,22 @@ npx @elliotllliu/agentshield scan ./skill/ --fail-under 70
|
|
|
52
107
|
fail-under: '70'
|
|
53
108
|
```
|
|
54
109
|
|
|
55
|
-
##
|
|
110
|
+
## 与其他工具对比
|
|
56
111
|
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
112
|
+
| 功能 | AgentShield | npm audit | Snyk | ESLint |
|
|
113
|
+
|------|------------|-----------|------|--------|
|
|
114
|
+
| AI Skill/MCP 专用规则 | ✅ | ❌ | ❌ | ❌ |
|
|
115
|
+
| 数据外泄检测 | ✅ | ❌ | ❌ | ❌ |
|
|
116
|
+
| 权限不匹配检测 | ✅ | ❌ | ❌ | ❌ |
|
|
117
|
+
| 零配置 | ✅ | ✅ | ❌ | ❌ |
|
|
118
|
+
| < 50ms 扫描 | ✅ | ❌ | ❌ | ❌ |
|
|
119
|
+
|
|
120
|
+
## 链接
|
|
121
|
+
|
|
122
|
+
- 📦 [npm](https://www.npmjs.com/package/@elliotllliu/agentshield)
|
|
123
|
+
- 📖 [规则文档](docs/rules.md)
|
|
124
|
+
- 📊 [ClawHub 安全报告](docs/clawhub-security-report.md)
|
|
125
|
+
- 🇬🇧 [English README](README.md)
|
|
63
126
|
|
|
64
127
|
## 许可证
|
|
65
128
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliotllliu/agentshield",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Security scanner for AI agent skills, MCP servers, and plugins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,34 @@
|
|
|
12
12
|
"test": "node --import tsx --test tests/**/*.test.ts",
|
|
13
13
|
"prepublishOnly": "npm run build"
|
|
14
14
|
},
|
|
15
|
-
"keywords": [
|
|
15
|
+
"keywords": [
|
|
16
|
+
"security",
|
|
17
|
+
"scanner",
|
|
18
|
+
"ai-agent",
|
|
19
|
+
"skill",
|
|
20
|
+
"mcp",
|
|
21
|
+
"plugin",
|
|
22
|
+
"vulnerability",
|
|
23
|
+
"audit",
|
|
24
|
+
"backdoor",
|
|
25
|
+
"data-exfiltration",
|
|
26
|
+
"credential-leak",
|
|
27
|
+
"static-analysis",
|
|
28
|
+
"codex",
|
|
29
|
+
"claude",
|
|
30
|
+
"openai",
|
|
31
|
+
"github-action",
|
|
32
|
+
"cli",
|
|
33
|
+
"npm",
|
|
34
|
+
"ai-safety",
|
|
35
|
+
"supply-chain",
|
|
36
|
+
"reverse-shell",
|
|
37
|
+
"typosquatting",
|
|
38
|
+
"ssrf",
|
|
39
|
+
"openclaw",
|
|
40
|
+
"clawhub",
|
|
41
|
+
"model-context-protocol"
|
|
42
|
+
],
|
|
16
43
|
"author": "Elliot Liu",
|
|
17
44
|
"license": "MIT",
|
|
18
45
|
"dependencies": {
|
|
@@ -29,5 +56,17 @@
|
|
|
29
56
|
"engines": {
|
|
30
57
|
"node": ">=18"
|
|
31
58
|
},
|
|
32
|
-
"files": [
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"README.md",
|
|
62
|
+
"LICENSE"
|
|
63
|
+
],
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "https://github.com/elliotllliu/agentshield.git"
|
|
67
|
+
},
|
|
68
|
+
"bugs": {
|
|
69
|
+
"url": "https://github.com/elliotllliu/agentshield/issues"
|
|
70
|
+
},
|
|
71
|
+
"homepage": "https://github.com/elliotllliu/agentshield#readme"
|
|
33
72
|
}
|