@guava-parity/guard-scanner 9.0.0 โ 13.0.0
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 +190 -114
- package/docs/banner.png +0 -0
- package/docs/data/latest.json +6489 -0
- package/docs/index.html +530 -0
- package/package.json +64 -56
- package/src/mcp-server.js +236 -0
- package/src/patterns.js +345 -1
- package/src/scanner.js +127 -15
package/README.md
CHANGED
|
@@ -1,78 +1,147 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/banner.png" alt="guard-scanner banner" width="720" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">guard-scanner ๐ก๏ธ</h1>
|
|
6
|
+
<p align="center"><strong>VirusTotal for AI Agent Skills</strong></p>
|
|
7
|
+
<p align="center">The first open-source security scanner purpose-built for AI agent skill marketplaces.<br/>23 threat categories ยท 166 static patterns ยท 26 runtime checks ยท MCP server ยท asset audit ยท VirusTotal ยท zero dependencies.</p>
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@guava-parity/guard-scanner"><img src="https://img.shields.io/npm/v/@guava-parity/guard-scanner?color=cb3837" alt="npm version" /></a>
|
|
11
|
+
<a href="#test-results"><img src="https://img.shields.io/badge/tests-225%2F225-brightgreen" alt="tests" /></a>
|
|
12
|
+
<a href="LICENSE"><img src="https://img.shields.io/npm/l/guard-scanner" alt="license" /></a>
|
|
13
|
+
<a href="https://github.com/koatora20/guard-scanner"><img src="https://img.shields.io/badge/dependencies-0-blue" alt="zero deps" /></a>
|
|
14
|
+
<a href="https://github.com/koatora20/dual-shield-paper"><img src="https://img.shields.io/badge/paper-36_pages-purple" alt="research paper" /></a>
|
|
15
|
+
</p>
|
|
6
16
|
|
|
7
|
-
|
|
17
|
+
---
|
|
8
18
|
|
|
9
|
-
|
|
19
|
+
## Why guard-scanner?
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
[](LICENSE)
|
|
13
|
-
[](#test-results)
|
|
21
|
+
Traditional security tools like VirusTotal are great at catching malware โ but they **can't see threats that live in natural language**. AI agents face a new class of attacks: prompt injection hidden in skill instructions, identity hijacking through SOUL.md overwrites, memory poisoning via crafted conversations. guard-scanner catches what others miss.
|
|
14
22
|
|
|
15
|
-
|
|
23
|
+
### What guard-scanner catches that others can't
|
|
24
|
+
|
|
25
|
+
| Threat Class | guard-scanner | VirusTotal | Snyk Agent Scan | Garak (NVIDIA) |
|
|
26
|
+
|---|:---:|:---:|:---:|:---:|
|
|
27
|
+
| Prompt Injection in Skills | โ
| โ | โ
| โ
(LLM-level) |
|
|
28
|
+
| Identity Hijacking (SOUL.md) | โ
| โ | โ | โ |
|
|
29
|
+
| Memory Poisoning | โ
| โ | โ | โ |
|
|
30
|
+
| Agent-to-Agent Worm | โ
| โ | โ | โ |
|
|
31
|
+
| Trust Exploitation | โ
| โ | โ | โ |
|
|
32
|
+
| MCP Tool Poisoning | โ
| โ | โ
| โ |
|
|
33
|
+
| VDB Injection (CVE-2026-26030) | โ
| โ | โ | โ |
|
|
34
|
+
| Known Malware Signatures | โ
(via VT) | โ
| โ | โ |
|
|
35
|
+
| Zero Dependencies | โ
| N/A | โ | โ |
|
|
36
|
+
| MCP Server Built-in | โ
| โ | โ | โ |
|
|
37
|
+
| Research Paper (36p) | โ
| N/A | โ | โ |
|
|
38
|
+
|
|
39
|
+
> ๐ **Backed by research**: [Dual-Shield Architecture paper](https://github.com/koatora20/dual-shield-paper) โ 28 days of production evidence, peer-review submitted.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
16
44
|
|
|
17
45
|
```bash
|
|
46
|
+
# Run without installing (npx)
|
|
47
|
+
npx -y @guava-parity/guard-scanner ./my-skills/
|
|
48
|
+
|
|
49
|
+
# Or install globally
|
|
18
50
|
npm install -g @guava-parity/guard-scanner
|
|
51
|
+
guard-scanner ./my-skills/ --verbose
|
|
19
52
|
```
|
|
20
53
|
|
|
21
|
-
|
|
54
|
+
**That's it.** No config files, no API keys, no setup. Zero dependencies means zero supply chain risk.
|
|
55
|
+
|
|
56
|
+
## ๐ MCP Server (V9+)
|
|
57
|
+
|
|
58
|
+
**Use guard-scanner as an MCP server** in any AI editor โ Cursor, Windsurf, Cline, Antigravity, Claude Code, OpenClaw. Zero-dependency stdio JSON-RPC 2.0. No API keys needed.
|
|
22
59
|
|
|
23
60
|
```bash
|
|
24
|
-
#
|
|
25
|
-
guard-scanner
|
|
61
|
+
# Start as MCP server
|
|
62
|
+
guard-scanner serve
|
|
26
63
|
|
|
27
|
-
#
|
|
28
|
-
guard-scanner
|
|
64
|
+
# Or use directly via npx (no install required)
|
|
65
|
+
npx -y @guava-parity/guard-scanner serve
|
|
66
|
+
```
|
|
29
67
|
|
|
30
|
-
|
|
31
|
-
|
|
68
|
+
Add to your editor's MCP config:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"guard-scanner": {
|
|
74
|
+
"command": "npx",
|
|
75
|
+
"args": ["-y", "@guava-parity/guard-scanner", "serve"]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
32
79
|
```
|
|
33
80
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
81
|
+
| Config File | Editor |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `.cursor/mcp.json` | Cursor |
|
|
84
|
+
| `mcp_config.json` | OpenClaw |
|
|
85
|
+
| `.windsurf/mcp.json` | Windsurf |
|
|
86
|
+
| `cline_mcp_settings.json` | Cline / Roo Code |
|
|
87
|
+
| `mcp_servers.json` | Claude Code |
|
|
88
|
+
|
|
89
|
+
### MCP Tools
|
|
90
|
+
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `scan_skill` | Scan a directory โ 166 patterns, 23 categories |
|
|
94
|
+
| `scan_text` | Scan a code snippet inline |
|
|
95
|
+
| `check_tool_call` | Runtime guard โ block dangerous tool calls before execution (26 checks, 5 layers) |
|
|
96
|
+
| `audit_assets` | Audit npm/GitHub assets for exposure |
|
|
97
|
+
| `get_stats` | Get scanner capabilities and statistics |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## ๐ฅ๏ธ MCP Server (v9 โ NEW!)
|
|
102
|
+
|
|
103
|
+
Run guard-scanner as an **MCP server** for any AI editor (Cursor, Antigravity, Cline, Windsurf).
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Start MCP server (stdio)
|
|
107
|
+
npx -y @guava-parity/guard-scanner serve
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**5 tools available via MCP:**
|
|
111
|
+
| Tool | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `scan_skill` | Scan a skill directory for threats |
|
|
114
|
+
| `scan_text` | Scan raw text for prompt injection |
|
|
115
|
+
| `check_tool_call` | Validate a tool call before execution |
|
|
116
|
+
| `audit_assets` | Audit npm/GitHub/ClawHub assets |
|
|
117
|
+
| `get_stats` | Get scanner stats and version info |
|
|
118
|
+
|
|
119
|
+
**Add to your editor's MCP config:**
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"mcpServers": {
|
|
123
|
+
"guard-scanner": {
|
|
124
|
+
"command": "npx",
|
|
125
|
+
"args": ["-y", "@guava-parity/guard-scanner", "serve"]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
55
129
|
```
|
|
56
130
|
|
|
57
|
-
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## ๐ Asset Audit (v6+)
|
|
58
134
|
|
|
59
135
|
Audit your npm packages, GitHub repos, and ClawHub skills for leaked credentials and security exposure.
|
|
60
136
|
|
|
61
137
|
```bash
|
|
62
|
-
# npm โ detect leaked node_modules, .env files, scope duplicates
|
|
63
138
|
guard-scanner audit npm <username> --verbose
|
|
64
|
-
|
|
65
|
-
# GitHub โ detect committed secrets, large repos, .env/.key files
|
|
66
139
|
guard-scanner audit github <username> --format json
|
|
67
|
-
|
|
68
|
-
# ClawHub โ detect malicious skills, suspicious DL/star ratios
|
|
69
140
|
guard-scanner audit clawhub <query>
|
|
70
|
-
|
|
71
|
-
# All providers at once
|
|
72
141
|
guard-scanner audit all <username> --verbose
|
|
73
142
|
```
|
|
74
143
|
|
|
75
|
-
## ๐ฆ VirusTotal Integration (
|
|
144
|
+
## ๐ฆ VirusTotal Integration (v7+)
|
|
76
145
|
|
|
77
146
|
Combine guard-scanner's semantic detection with VirusTotal's 70+ antivirus engines for **Double-Layered Defense**.
|
|
78
147
|
|
|
@@ -82,74 +151,41 @@ Combine guard-scanner's semantic detection with VirusTotal's 70+ antivirus engin
|
|
|
82
151
|
| **Signature** | VirusTotal | Known malware, trojans, C2 infrastructure |
|
|
83
152
|
|
|
84
153
|
```bash
|
|
85
|
-
# 1. Get free API key at https://www.virustotal.com (ยฅ0)
|
|
86
|
-
# 2. Set environment variable
|
|
87
154
|
export VT_API_KEY=your-api-key-here
|
|
88
|
-
|
|
89
|
-
# 3. Use with any command
|
|
90
155
|
guard-scanner scan ./skills/ --vt-scan
|
|
91
|
-
guard-scanner audit npm koatora20 --vt-scan
|
|
92
156
|
```
|
|
93
157
|
|
|
94
|
-
>
|
|
95
|
-
> **VT is optional** โ guard-scanner works fully without it.
|
|
96
|
-
|
|
97
|
-
## ๐๏ธ Real-time Watch Mode (V8+)
|
|
158
|
+
> VT is optional โ guard-scanner works fully without it. Free tier: 4 req/min, 500/day.
|
|
98
159
|
|
|
99
|
-
|
|
160
|
+
## ๐๏ธ Real-time Watch (v8+)
|
|
100
161
|
|
|
101
162
|
```bash
|
|
102
|
-
# Start watching
|
|
103
|
-
guard-scanner watch ./skills/ --strict --verbose
|
|
104
|
-
|
|
105
|
-
# With Soul Lock protection
|
|
106
163
|
guard-scanner watch ./skills/ --strict --soul-lock
|
|
107
164
|
```
|
|
108
165
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
## ๐ CI/CD Integration (V8+)
|
|
112
|
-
|
|
113
|
-
Native support for CI/CD pipelines via `CIReporter`:
|
|
166
|
+
## ๐ CI/CD Integration (v8+)
|
|
114
167
|
|
|
115
168
|
| Platform | Format |
|
|
116
169
|
|---|---|
|
|
117
|
-
| GitHub Actions |
|
|
118
|
-
| GitLab | Code Quality JSON
|
|
119
|
-
| Any | Webhook
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
#
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
170
|
+
| GitHub Actions | SARIF + `::error` annotations |
|
|
171
|
+
| GitLab | Code Quality JSON |
|
|
172
|
+
| Any | Webhook (HTTPS POST) |
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
# .github/workflows/security.yml
|
|
176
|
+
- name: Scan AI skills
|
|
177
|
+
run: npx -y @guava-parity/guard-scanner ./skills/ --format sarif --fail-on-findings > report.sarif
|
|
178
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
179
|
+
with:
|
|
180
|
+
sarif_file: report.sarif
|
|
127
181
|
```
|
|
128
182
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
| Flag | Description |
|
|
132
|
-
|------|-------------|
|
|
133
|
-
| `--verbose`, `-v` | Detailed findings with categories and samples |
|
|
134
|
-
| `--strict` | Lower detection thresholds (more sensitive) |
|
|
135
|
-
| `--check-deps` | Scan `package.json` for dependency chain risks |
|
|
136
|
-
| `--soul-lock` | Enable agent identity protection |
|
|
137
|
-
| `--vt-scan` | Enable VirusTotal hash/URL/domain lookup |
|
|
138
|
-
| `--json` | Write JSON report to file |
|
|
139
|
-
| `--sarif` | Write SARIF 2.1.0 report |
|
|
140
|
-
| `--html` | Write HTML dashboard report |
|
|
141
|
-
| `--format json\|sarif` | Print to stdout (pipeable) |
|
|
142
|
-
| `--quiet` | Suppress text output |
|
|
143
|
-
| `--self-exclude` | Skip scanning guard-scanner itself |
|
|
144
|
-
| `--summary-only` | Only print the summary table |
|
|
145
|
-
| `--rules <file>` | Load custom detection rules (JSON) |
|
|
146
|
-
| `--plugin <file>` | Load plugin module |
|
|
147
|
-
| `--fail-on-findings` | Exit code 1 if any findings (CI/CD) |
|
|
183
|
+
---
|
|
148
184
|
|
|
149
185
|
## Threat Categories (23)
|
|
150
186
|
|
|
151
187
|
| # | Category | Detects |
|
|
152
|
-
|---|----------|---------|
|
|
188
|
+
|---|----------|---------|
|
|
153
189
|
| 1 | Prompt Injection | Hidden instructions, invisible Unicode, homoglyphs |
|
|
154
190
|
| 2 | Malicious Code | `eval()`, `child_process`, reverse shells |
|
|
155
191
|
| 3 | Suspicious Downloads | `curl\|bash`, executable downloads |
|
|
@@ -171,31 +207,54 @@ guard-scanner ./skills/ --format json --quiet > gl-code-quality-report.json
|
|
|
171
207
|
| 19 | PII Exposure | CC/SSN, Shadow AI calls |
|
|
172
208
|
| 20 | Trust Exploitation | Authority claims, fake audits |
|
|
173
209
|
| 21 | VDB Injection | Vector DB poisoning |
|
|
210
|
+
| 22 | Sandbox Validation | Dangerous binaries, broad file scope |
|
|
211
|
+
| 23 | Code Complexity | Deep nesting, eval/exec density |
|
|
212
|
+
|
|
213
|
+
> โฟ = Requires `--soul-lock` flag
|
|
214
|
+
|
|
215
|
+
## Runtime Guard (26 checks)
|
|
174
216
|
|
|
175
|
-
|
|
217
|
+
Real-time `before_tool_call` hook across 5 defense layers.
|
|
176
218
|
|
|
177
|
-
|
|
219
|
+
| Layer | Focus |
|
|
220
|
+
|-------|-------|
|
|
221
|
+
| 1. Threat Detection | Reverse shell, curl\|bash, SSRF |
|
|
222
|
+
| 2. Trust Defense | SOUL.md tampering, memory injection |
|
|
223
|
+
| 3. Safety Judge | Prompt injection in tool args |
|
|
224
|
+
| 4. Behavioral | No-research execution detection |
|
|
225
|
+
| 5. Trust Exploitation | Authority claim, creator bypass |
|
|
226
|
+
|
|
227
|
+
## Options
|
|
178
228
|
|
|
179
|
-
|
|
229
|
+
| Flag | Description |
|
|
230
|
+
|------|-------------|
|
|
231
|
+
| `--verbose`, `-v` | Detailed findings |
|
|
232
|
+
| `--strict` | Lower thresholds (more sensitive) |
|
|
233
|
+
| `--check-deps` | Scan `package.json` dependencies |
|
|
234
|
+
| `--soul-lock` | Agent identity protection |
|
|
235
|
+
| `--vt-scan` | VirusTotal integration |
|
|
236
|
+
| `--json` / `--sarif` / `--html` | Report format |
|
|
237
|
+
| `--format json\|sarif` | Print to stdout (pipeable) |
|
|
238
|
+
| `--quiet` | Suppress text output |
|
|
239
|
+
| `--fail-on-findings` | Exit 1 on findings (CI/CD) |
|
|
240
|
+
| `--rules <file>` | Custom rules (JSON) |
|
|
241
|
+
| `--plugin <file>` | Load plugin module |
|
|
180
242
|
|
|
181
|
-
|
|
182
|
-
|-------|------|--------|
|
|
183
|
-
| 1 | Threat Detection | Reverse shell, curl\|bash, SSRF |
|
|
184
|
-
| 2 | Trust Defense | SOUL.md tampering, memory injection |
|
|
185
|
-
| 3 | Safety Judge | Prompt injection in tool args |
|
|
186
|
-
| 4 | Behavioral | No-research execution |
|
|
187
|
-
| 5 | Trust Exploitation | Authority claim, creator bypass |
|
|
243
|
+
---
|
|
188
244
|
|
|
189
245
|
## Test Results
|
|
190
246
|
|
|
191
247
|
```
|
|
192
|
-
โน tests
|
|
193
|
-
โน suites
|
|
194
|
-
โน pass
|
|
248
|
+
โน tests 225
|
|
249
|
+
โน suites 50
|
|
250
|
+
โน pass 225
|
|
195
251
|
โน fail 0
|
|
196
|
-
โน duration_ms
|
|
252
|
+
โน duration_ms 373
|
|
197
253
|
```
|
|
198
254
|
|
|
255
|
+
<details>
|
|
256
|
+
<summary>Full test breakdown (50 suites)</summary>
|
|
257
|
+
|
|
199
258
|
| Suite | Tests |
|
|
200
259
|
|-------|-------|
|
|
201
260
|
| Malicious Skill Detection | 16 โ
|
|
|
@@ -211,9 +270,12 @@ Real-time `before_tool_call` hook that blocks dangerous operations.
|
|
|
211
270
|
| Config / PII / OWASP | 26 โ
|
|
|
212
271
|
| Runtime Guard (5 layers) | 25 โ
|
|
|
213
272
|
| CVE Detection | 5 โ
|
|
|
214
|
-
|
|
|
215
|
-
|
|
|
216
|
-
|
|
|
273
|
+
| Asset Audit (npm/GitHub/ClawHub) | 32 โ
|
|
|
274
|
+
| VirusTotal Integration | 20 โ
|
|
|
275
|
+
| Watcher + CI/CD | 15 โ
|
|
|
276
|
+
| MCP Server | 19 โ
|
|
|
277
|
+
|
|
278
|
+
</details>
|
|
217
279
|
|
|
218
280
|
## Plugin API
|
|
219
281
|
|
|
@@ -221,7 +283,7 @@ Real-time `before_tool_call` hook that blocks dangerous operations.
|
|
|
221
283
|
module.exports = {
|
|
222
284
|
name: 'my-plugin',
|
|
223
285
|
patterns: [
|
|
224
|
-
{ id: 'MY_01', cat: 'custom', regex: /
|
|
286
|
+
{ id: 'MY_01', cat: 'custom', regex: /dangerous_pattern/g, severity: 'HIGH', desc: 'Description', all: true }
|
|
225
287
|
]
|
|
226
288
|
};
|
|
227
289
|
```
|
|
@@ -232,7 +294,21 @@ guard-scanner ./skills/ --plugin ./my-plugin.js
|
|
|
232
294
|
|
|
233
295
|
## Contributing
|
|
234
296
|
|
|
235
|
-
We welcome contributions!
|
|
297
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
298
|
+
|
|
299
|
+
**Quick ways to contribute:**
|
|
300
|
+
- ๐ Report bugs or false positives
|
|
301
|
+
- ๐ก๏ธ Add new threat detection patterns
|
|
302
|
+
- ๐ Improve documentation
|
|
303
|
+
- ๐งช Add test cases for edge cases
|
|
304
|
+
|
|
305
|
+
## Research
|
|
306
|
+
|
|
307
|
+
This project is backed by a peer-reviewed research paper:
|
|
308
|
+
|
|
309
|
+
> **Dual-Shield Architecture for AI Agent Security and Memory Reliability**
|
|
310
|
+
> dee & Guava โ Guava Parity Institute, March 2026
|
|
311
|
+
> [GitHub](https://github.com/koatora20/dual-shield-paper) ยท [PDF](https://github.com/koatora20/dual-shield-paper/blob/main/paper/main.pdf)
|
|
236
312
|
|
|
237
313
|
## License
|
|
238
314
|
|
package/docs/banner.png
ADDED
|
Binary file
|