@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 CHANGED
@@ -1,78 +1,147 @@
1
- # guard-scanner ๐Ÿ›ก๏ธ
1
+ <p align="center">
2
+ <img src="docs/banner.png" alt="guard-scanner banner" width="720" />
3
+ </p>
2
4
 
3
- *The Original, Zero-Dependency Shield for the AI Agent Era.*
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
- As autonomous AI agents become more prevalent, the risk of executing untrusted or malicious skills increases. **guard-scanner** is an open-source, zero-dependency security platform designed to protect developers from Prompt Injections, RCEs, Memory Poisoning, and supply chain attacks.
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
- Built by the **[Guava Parity Institute](https://github.com/koatora20)** and the open-source community.
17
+ ---
8
18
 
9
- **166 static patterns + 26 runtime checks + asset audit + VirusTotal integration + real-time watch.**
19
+ ## Why guard-scanner?
10
20
 
11
- [![npm](https://img.shields.io/npm/v/@guava-parity/guard-scanner)](https://www.npmjs.com/package/@guava-parity/guard-scanner)
12
- [![license](https://img.shields.io/npm/l/guard-scanner)](LICENSE)
13
- [![tests](https://img.shields.io/badge/tests-206%2F206-brightgreen)](#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
- ## Install
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
- ## Quick Start
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
- # Scan all skills
25
- guard-scanner ./skills/ --verbose
61
+ # Start as MCP server
62
+ guard-scanner serve
26
63
 
27
- # Strict mode + reports
28
- guard-scanner ./skills/ --strict --json --sarif --fail-on-findings
64
+ # Or use directly via npx (no install required)
65
+ npx -y @guava-parity/guard-scanner serve
66
+ ```
29
67
 
30
- # CI/CD pipeline (stdout)
31
- guard-scanner ./skills/ --format sarif --quiet | upload-sarif
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
- ## ๐Ÿ” Example Scan Output
35
-
36
- ```console
37
- $ guard-scanner ./test/fixtures/malicious-skill/ --verbose
38
-
39
- ๐Ÿ›ก๏ธ guard-scanner v8.0.0
40
- โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
41
- ๐Ÿ“‚ Scanning: ./test/fixtures/malicious-skill/
42
- ๐Ÿ“ฆ Skills found: 1
43
-
44
- ๐Ÿ”ด scripts โ€” MALICIOUS (risk: 100)
45
- ๐Ÿ“ exfiltration
46
- ๐Ÿ”ด [HIGH] Suspicious domain: webhook.site โ€” evil.js
47
- ๐Ÿ“ malicious-code
48
- ๐Ÿ”ด [HIGH] eval() call โ€” evil.js:18
49
- ๐Ÿ’€ [CRITICAL] Shell download/execution โ€” stealer.js:19
50
- ๐Ÿ“ credential-handling
51
- ๐Ÿ”ด [HIGH] Credential file read โ€” evil.js:6
52
- ๐Ÿ’€ [CRITICAL] Agent identity file read โ€” evil.js:7
53
- ๐Ÿ“ memory-poisoning
54
- ๐Ÿ’€ [CRITICAL] Write to agent soul file โ€” evil.js:21
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
- ## ๐Ÿ”Ž Asset Audit (V6+)
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 (V7+)
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
- > **Free tier**: 4 req/min, 500/day, 15,500/month. Personal use only.
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
- Monitor your skills directory for changes and scan automatically.
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
- Press `Ctrl+C` for session stats.
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 | `::error` / `::warning` annotations + Step Summary |
118
- | GitLab | Code Quality JSON report |
119
- | Any | Webhook notification (HTTPS POST) |
120
-
121
- ```bash
122
- # GitHub Actions
123
- guard-scanner ./skills/ --format sarif --quiet > report.sarif
124
-
125
- # GitLab
126
- guard-scanner ./skills/ --format json --quiet > gl-code-quality-report.json
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
- ## Options
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
- > โšฟ = Requires `--soul-lock` flag (opt-in)
217
+ Real-time `before_tool_call` hook across 5 defense layers.
176
218
 
177
- ## Runtime Guard (26 checks, 5 layers)
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
- Real-time `before_tool_call` hook that blocks dangerous operations.
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
- | Layer | Name | Checks |
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 206
193
- โ„น suites 43
194
- โ„น pass 206
248
+ โ„น tests 225
249
+ โ„น suites 50
250
+ โ„น pass 225
195
251
  โ„น fail 0
196
- โ„น duration_ms 376
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
- | **Asset Audit (npm/GitHub/ClawHub)** | **32 โœ…** |
215
- | **VirusTotal Integration** | **20 โœ…** |
216
- | **Watcher + CI/CD** | **15 โœ…** |
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: /pattern/g, severity: 'HIGH', desc: 'Description', all: true }
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! Whether fixing bugs, adding threat patterns, or improving docs.
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
 
Binary file