@guava-parity/guard-scanner 13.0.0 → 16.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.
Files changed (96) hide show
  1. package/README.md +170 -215
  2. package/README_ja.md +252 -0
  3. package/SECURITY.md +12 -4
  4. package/SKILL.md +148 -57
  5. package/dist/cli.cjs +5997 -0
  6. package/dist/cli.d.mts +1 -0
  7. package/dist/cli.d.ts +1 -0
  8. package/dist/cli.mjs +6003 -0
  9. package/dist/index.cjs +4825 -0
  10. package/dist/index.d.mts +17 -0
  11. package/dist/index.d.ts +17 -0
  12. package/dist/index.mjs +4798 -0
  13. package/dist/mcp-server.cjs +4756 -0
  14. package/dist/mcp-server.d.mts +1 -0
  15. package/dist/mcp-server.d.ts +1 -0
  16. package/dist/mcp-server.mjs +4767 -0
  17. package/dist/openclaw-plugin.cjs +4863 -0
  18. package/dist/openclaw-plugin.d.mts +11 -0
  19. package/dist/openclaw-plugin.d.ts +11 -0
  20. package/dist/openclaw-plugin.mjs +4854 -0
  21. package/dist/types.cjs +18 -0
  22. package/dist/types.d.mts +215 -0
  23. package/dist/types.d.ts +215 -0
  24. package/dist/types.mjs +1 -0
  25. package/docs/EVIDENCE_DRIVEN.md +182 -0
  26. package/docs/banner.png +0 -0
  27. package/docs/data/benchmark-ledger.json +1428 -0
  28. package/docs/data/corpus-metrics.json +11 -0
  29. package/docs/data/fp-ledger.json +18 -0
  30. package/docs/data/latest.json +25837 -2481
  31. package/docs/data/quality-contract.json +36 -0
  32. package/docs/generated/npm-audit-20260312.json +96 -0
  33. package/docs/generated/openclaw-upstream-status.json +25 -0
  34. package/docs/glossary.md +46 -0
  35. package/docs/index.html +1085 -496
  36. package/docs/logo.png +0 -0
  37. package/docs/openclaw-compatibility-audit.md +45 -0
  38. package/docs/openclaw-continuous-compatibility-plan.md +37 -0
  39. package/docs/rules/a2a-contagion.md +68 -0
  40. package/docs/rules/advanced-exfil.md +52 -0
  41. package/docs/rules/agent-protocol.md +108 -0
  42. package/docs/rules/api-abuse.md +68 -0
  43. package/docs/rules/autonomous-risk.md +92 -0
  44. package/docs/rules/config-impact.md +132 -0
  45. package/docs/rules/credential-handling.md +100 -0
  46. package/docs/rules/cve-patterns.md +332 -0
  47. package/docs/rules/data-exposure.md +84 -0
  48. package/docs/rules/exfiltration.md +36 -0
  49. package/docs/rules/financial-access.md +84 -0
  50. package/docs/rules/identity-hijack.md +140 -0
  51. package/docs/rules/inference-manipulation.md +60 -0
  52. package/docs/rules/leaky-skills.md +52 -0
  53. package/docs/rules/malicious-code.md +108 -0
  54. package/docs/rules/mcp-security.md +148 -0
  55. package/docs/rules/memory-poisoning.md +84 -0
  56. package/docs/rules/model-poisoning.md +44 -0
  57. package/docs/rules/obfuscation.md +60 -0
  58. package/docs/rules/persistence.md +108 -0
  59. package/docs/rules/pii-exposure.md +116 -0
  60. package/docs/rules/prompt-injection.md +148 -0
  61. package/docs/rules/prompt-worm.md +44 -0
  62. package/docs/rules/safeguard-bypass.md +44 -0
  63. package/docs/rules/sandbox-escape.md +100 -0
  64. package/docs/rules/secret-detection.md +44 -0
  65. package/docs/rules/supply-chain-v2.md +92 -0
  66. package/docs/rules/suspicious-download.md +60 -0
  67. package/docs/rules/trust-boundary.md +76 -0
  68. package/docs/rules/trust-exploitation.md +92 -0
  69. package/docs/rules/unverifiable-deps.md +84 -0
  70. package/docs/rules/vdb-injection.md +84 -0
  71. package/docs/security-vulnerability-report-20260312.md +53 -0
  72. package/docs/spec/PRD_V2_ARCHITECTURE.md +55 -0
  73. package/docs/spec/capabilities.json +174 -0
  74. package/docs/spec/finding.schema.json +104 -0
  75. package/docs/spec/integration-manifest.md +39 -0
  76. package/docs/spec/plugin-trust.json +11 -0
  77. package/docs/spec/sbom.json +33 -0
  78. package/docs/threat-model.md +65 -0
  79. package/docs/v13-architecture-manifest.md +55 -0
  80. package/hooks/context.ts +306 -0
  81. package/hooks/guard-scanner/plugin.ts +24 -1
  82. package/openclaw-plugin.mts +107 -0
  83. package/openclaw.plugin.json +30 -53
  84. package/package.json +66 -13
  85. package/src/asset-auditor.js +0 -508
  86. package/src/ci-reporter.js +0 -135
  87. package/src/cli.js +0 -294
  88. package/src/html-template.js +0 -239
  89. package/src/ioc-db.js +0 -54
  90. package/src/mcp-server.js +0 -702
  91. package/src/patterns.js +0 -611
  92. package/src/quarantine.js +0 -41
  93. package/src/runtime-guard.js +0 -346
  94. package/src/scanner.js +0 -1157
  95. package/src/vt-client.js +0 -202
  96. package/src/watcher.js +0 -170
package/README.md CHANGED
@@ -1,73 +1,76 @@
1
1
  <p align="center">
2
- <img src="docs/banner.png" alt="guard-scanner banner" width="720" />
2
+ <img src="docs/logo.png" alt="guard-scanner" width="160" />
3
3
  </p>
4
4
 
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>
5
+ <h1 align="center">guard-scanner</h1>
6
+ <p align="center"><strong>Security scanner for the agentic era.</strong></p>
7
+ <p align="center">
8
+ Detect prompt injection, identity hijacking, memory poisoning, and A2A contagion<br />
9
+ in AI agent skills, MCP servers, and autonomous workflows.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <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&label=npm" alt="npm" /></a>
14
+ <a href="https://www.npmjs.com/package/@guava-parity/guard-scanner"><img src="https://img.shields.io/npm/dm/@guava-parity/guard-scanner?color=blue&label=downloads" alt="downloads" /></a>
15
+ <a href="#test-results"><img src="https://img.shields.io/badge/tests-363%20passed-brightgreen" alt="tests" /></a>
16
+ <a href="https://github.com/koatora20/guard-scanner/actions/workflows/codeql.yml"><img src="https://img.shields.io/badge/CodeQL-enabled-181717" alt="CodeQL" /></a>
17
+ <a href="https://doi.org/10.5281/zenodo.18906684"><img src="https://img.shields.io/badge/DOI-Zenodo-blue" alt="DOI" /></a>
18
+ <a href="https://github.com/koatora20/guard-scanner/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT" /></a>
19
+ </p>
8
20
 
9
21
  <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>
22
+ <strong>358</strong> detection patterns · <strong>35</strong> threat categories · <strong>27</strong> runtime checks · <strong>1</strong> dependency (<code>ws</code>)
15
23
  </p>
16
24
 
17
25
  ---
18
26
 
19
- ## Why guard-scanner?
27
+ Traditional security tools catch malware. **guard-scanner** catches what they miss: invisible Unicode injections hiding in agent instructions, identity theft through SOUL.md overwrites, memory poisoning via crafted conversations, and worm-like contagion spreading between chained agents.
20
28
 
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.
29
+ ```
30
+ $ npx @guava-parity/guard-scanner ./skills/ --strict --soul-lock --compliance owasp-asi
22
31
 
23
- ### What guard-scanner catches that others can't
32
+ guard-scanner v16.0.0
24
33
 
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 | ❌ | ❌ |
34
+ ⚠ CRITICAL identity-hijack SOUL_OVERWRITE_ATTEMPT
35
+ skills/imported-tool/SKILL.md:47
36
+ Rationale: Direct overwrite of agent identity file detected.
37
+ Remediation: Remove this instruction; SOUL.md must be immutable.
38
38
 
39
- > 📄 **Backed by research**: [Dual-Shield Architecture paper](https://github.com/koatora20/dual-shield-paper) — 28 days of production evidence, peer-review submitted.
39
+ ⚠ HIGH prompt-injection INVISIBLE_UNICODE_INJECTION
40
+ skills/imported-tool/handler.js:12
41
+ Rationale: Invisible Unicode characters (U+200B) detected in instruction text.
42
+ Remediation: Strip zero-width characters and re-audit.
40
43
 
41
- ---
44
+ ✖ 2 findings (1 critical, 1 high) in 0.8s
45
+ ```
42
46
 
43
- ## Quick Start
47
+ > 📄 Backed by a [3-paper research series](https://doi.org/10.5281/zenodo.18906684) (Zenodo, CC BY 4.0) — part of [The Sanctuary Protocol](https://github.com/koatora20/guard-scanner/blob/main/docs/THREAT_TAXONOMY.md) framework.
44
48
 
45
- ```bash
46
- # Run without installing (npx)
47
- npx -y @guava-parity/guard-scanner ./my-skills/
49
+ ---
48
50
 
49
- # Or install globally
50
- npm install -g @guava-parity/guard-scanner
51
- guard-scanner ./my-skills/ --verbose
52
- ```
51
+ ## Finding Schema
53
52
 
54
- **That's it.** No config files, no API keys, no setup. Zero dependencies means zero supply chain risk.
53
+ Every finding includes: `rule_id`, `category`, `severity`, `description`, `rationale`, `preconditions`, `false_positive_scenarios`, `remediation_hint`, `validation_status`, and `evidence`. Machine-readable contract: [`docs/spec/finding.schema.json`](docs/spec/finding.schema.json).
55
54
 
56
- ## 🔌 MCP Server (V9+)
55
+ ---
56
+
57
+ ## Quick Start
57
58
 
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.
59
+ **Scan a directory** — no install required:
59
60
 
60
61
  ```bash
61
- # Start as MCP server
62
- guard-scanner serve
62
+ npx -y @guava-parity/guard-scanner ./my-skills/ --strict
63
+ npx -y @guava-parity/guard-scanner ./my-skills/ --compliance owasp-asi
64
+ ```
65
+
66
+ **Start as MCP server** — works with Cursor, Windsurf, Claude Code, OpenClaw:
63
67
 
64
- # Or use directly via npx (no install required)
68
+ ```bash
65
69
  npx -y @guava-parity/guard-scanner serve
66
70
  ```
67
71
 
68
- Add to your editor's MCP config:
69
-
70
- ```json
72
+ ```jsonc
73
+ // Add to your editor's mcp_servers.json
71
74
  {
72
75
  "mcpServers": {
73
76
  "guard-scanner": {
@@ -78,212 +81,110 @@ Add to your editor's MCP config:
78
81
  }
79
82
  ```
80
83
 
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 |
84
+ **Watch mode** real-time scanning during development:
88
85
 
89
- ### MCP Tools
86
+ ```bash
87
+ guard-scanner watch ./skills/ --strict --soul-lock
88
+ ```
90
89
 
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 |
90
+ **v16 compliance projection** filter findings to the OWASP Agentic Top 10 mapping:
98
91
 
99
- ---
92
+ ```bash
93
+ guard-scanner ./skills/ --compliance owasp-asi --format json
94
+ ```
100
95
 
101
- ## 🖥️ MCP Server (v9 — NEW!)
96
+ ---
102
97
 
103
- Run guard-scanner as an **MCP server** for any AI editor (Cursor, Antigravity, Cline, Windsurf).
98
+ ## What It Detects
104
99
 
105
- ```bash
106
- # Start MCP server (stdio)
107
- npx -y @guava-parity/guard-scanner serve
108
- ```
100
+ 35 threat categories organized across the full agentic attack surface:
109
101
 
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 |
102
+ | Category | Examples | Severity |
103
+ |----------|----------|----------|
104
+ | **Prompt Injection** | Invisible Unicode, homoglyphs, Base64 evasion, payload cascades | Critical |
105
+ | **Identity Hijacking** ⚿ | SOUL.md overwrite, persona swap, memory wipe commands | Critical |
106
+ | **A2A Contagion** | Session Smuggling, Lateral Propagation, Confused Deputy | Critical |
107
+ | **Memory Poisoning** ⚿ | Crafted conversation injection, VDB poisoning | High |
108
+ | **MCP Security** | Tool shadowing, SSRF via tool args, shadow server registration | High |
109
+ | **Sandbox Escape** | `child_process`, `eval()`, reverse shell, `curl\|bash` | High |
110
+ | **Supply Chain V2** | Typosquatting, slopsquatting, lifecycle script abuse | High |
111
+ | **CVE Patterns** | CVE-2026-2256, 25046, 25253, 25905, 27825 | High |
112
+ | **Data Exfiltration** | DNS tunneling, steganographic channels, staged uploads | Medium |
113
+ | **Credential Exposure** | API keys, tokens, `.env` files, hardcoded secrets | Medium |
118
114
 
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
- }
129
- ```
115
+ > = Requires `--soul-lock` flag. Full taxonomy: [docs/THREAT_TAXONOMY.md](docs/THREAT_TAXONOMY.md)
130
116
 
131
117
  ---
132
118
 
133
- ## 🔎 Asset Audit (v6+)
119
+ ## Runtime Guard
134
120
 
135
- Audit your npm packages, GitHub repos, and ClawHub skills for leaked credentials and security exposure.
121
+ guard-scanner v16 isn't just a static scanner — it exposes a 5-layer analysis pipeline across static scan, protocol analysis, runtime evidence, cognitive heuristics, and threat-intelligence overlays. It also provides a real-time **`before_tool_call`** hook that intercepts dangerous tool invocations during agent execution.
136
122
 
137
- ```bash
138
- guard-scanner audit npm <username> --verbose
139
- guard-scanner audit github <username> --format json
140
- guard-scanner audit clawhub <query>
141
- guard-scanner audit all <username> --verbose
142
- ```
123
+ ### v16 Analysis Layers
143
124
 
144
- ## 🦠 VirusTotal Integration (v7+)
125
+ | Layer | Purpose |
126
+ |------|---------|
127
+ | 1. Static Analysis | Patterns, AST/data-flow signals, manifest and dependency checks |
128
+ | 2. Protocol Analysis | MCP, A2A, WebSocket, credential-flow, session-boundary findings |
129
+ | 3. Runtime Behavior | Runtime guard evidence plus Rust `memory_integrity` / `soul_hard_gate` signals |
130
+ | 4. Cognitive Threat Detection | Goal-drift, trust-bias, cascading handoff heuristics |
131
+ | 5. Threat Intelligence | Registry/provenance, machine identity, budget abuse, supply chain hints |
145
132
 
146
- Combine guard-scanner's semantic detection with VirusTotal's 70+ antivirus engines for **Double-Layered Defense**.
133
+ Every v16 finding can now carry `layer`, `layer_name`, `owasp_asi`, and `protocol_surface` in JSON/MCP output.
147
134
 
148
- | Layer | Engine | Focus |
149
- |---|---|---|
150
- | **Semantic** | guard-scanner | Prompt injection, memory poisoning, supply chain |
151
- | **Signature** | VirusTotal | Known malware, trojans, C2 infrastructure |
135
+ | Defense Layer | What It Blocks |
136
+ |---------------|---------------|
137
+ | 1. Threat Detection | Reverse shell, `curl\|bash`, SSRF, raw code execution |
138
+ | 2. Trust Defense | SOUL.md tampering, unauthorized memory injection |
139
+ | 3. Safety Judge | Prompt injection embedded in tool arguments |
140
+ | 4. Behavioral Analysis | No-research execution, hallucination-driven actions |
141
+ | 5. Trust Exploitation | Authority claim attacks, creator impersonation |
152
142
 
153
- ```bash
154
- export VT_API_KEY=your-api-key-here
155
- guard-scanner scan ./skills/ --vt-scan
156
- ```
143
+ **27 runtime checks** across 5 layers. Public compatibility is pinned to OpenClaw `v2026.3.8` for manifest/discovery/`before_tool_call`; newer upstream releases are tracked separately by the upstream drift watchdog.
144
+
145
+ Modes: `monitor` (log only) · `enforce` (block CRITICAL, default) · `strict` (block HIGH+)
157
146
 
158
- > VT is optional — guard-scanner works fully without it. Free tier: 4 req/min, 500/day.
147
+ ---
148
+
149
+ ## Asset Audit
159
150
 
160
- ## 👁️ Real-time Watch (v8+)
151
+ Discover leaked credentials and security exposures across public registries:
161
152
 
162
153
  ```bash
163
- guard-scanner watch ./skills/ --strict --soul-lock
154
+ guard-scanner audit npm <username> --verbose
155
+ guard-scanner audit github <username> --format json
156
+ guard-scanner audit clawhub <query>
157
+ guard-scanner audit all <username>
164
158
  ```
165
159
 
166
- ## 📊 CI/CD Integration (v8+)
160
+ ---
167
161
 
168
- | Platform | Format |
169
- |---|---|
170
- | GitHub Actions | SARIF + `::error` annotations |
171
- | GitLab | Code Quality JSON |
172
- | Any | Webhook (HTTPS POST) |
162
+ ## CI/CD Integration
173
163
 
174
164
  ```yaml
175
165
  # .github/workflows/security.yml
176
- - name: Scan AI skills
166
+ - name: Scan AI agent skills
177
167
  run: npx -y @guava-parity/guard-scanner ./skills/ --format sarif --fail-on-findings > report.sarif
178
168
  - uses: github/codeql-action/upload-sarif@v3
179
169
  with:
180
170
  sarif_file: report.sarif
181
171
  ```
182
172
 
183
- ---
184
-
185
- ## Threat Categories (23)
186
-
187
- | # | Category | Detects |
188
- |---|----------|---------|
189
- | 1 | Prompt Injection | Hidden instructions, invisible Unicode, homoglyphs |
190
- | 2 | Malicious Code | `eval()`, `child_process`, reverse shells |
191
- | 3 | Suspicious Downloads | `curl\|bash`, executable downloads |
192
- | 4 | Credential Handling | `.env` reads, SSH keys |
193
- | 5 | Secret Detection | Hardcoded API keys, Shannon entropy |
194
- | 6 | Exfiltration | webhook.site, DNS tunneling |
195
- | 7 | Unverifiable Deps | Remote dynamic imports |
196
- | 8 | Financial Access | Crypto transactions |
197
- | 9 | Obfuscation | Base64→exec, hex encoding |
198
- | 10 | Prerequisites Fraud | Fake download instructions |
199
- | 11 | Leaky Skills | Secrets in memory |
200
- | 12 | Memory Poisoning ⚿ | SOUL.md modification |
201
- | 13 | Prompt Worm | Self-replicating prompts |
202
- | 14 | Persistence | Cron, launchd |
203
- | 15 | CVE Patterns | CVE-2026-2256/25046/25253/25905/27825 |
204
- | 16 | MCP Security | Tool poisoning, SSRF, shadow servers |
205
- | 17 | Identity Hijacking ⚿ | Persona swap, memory wipe |
206
- | 18 | Config Impact | OpenClaw config writes |
207
- | 19 | PII Exposure | CC/SSN, Shadow AI calls |
208
- | 20 | Trust Exploitation | Authority claims, fake audits |
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)
216
-
217
- Real-time `before_tool_call` hook across 5 defense layers.
218
-
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
228
-
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 |
173
+ Output formats: `json` · `sarif` · `html` · terminal
242
174
 
243
175
  ---
244
176
 
245
- ## Test Results
246
-
247
- ```
248
- ℹ tests 225
249
- ℹ suites 50
250
- ℹ pass 225
251
- ℹ fail 0
252
- ℹ duration_ms 373
253
- ```
254
-
255
- <details>
256
- <summary>Full test breakdown (50 suites)</summary>
257
-
258
- | Suite | Tests |
259
- |-------|-------|
260
- | Malicious Skill Detection | 16 ✅ |
261
- | Clean Skill (False Positive) | 2 ✅ |
262
- | Risk Score / Verdict | 10 ✅ |
263
- | Output Formats (JSON/SARIF/HTML) | 4 ✅ |
264
- | Pattern DB (166 patterns, 23 cats) | 4 ✅ |
265
- | IoC Database | 5 ✅ |
266
- | Shannon Entropy | 2 ✅ |
267
- | Plugin API / Custom Rules | 2 ✅ |
268
- | Skill Manifest | 4 ✅ |
269
- | Code Complexity | 2 ✅ |
270
- | Config / PII / OWASP | 26 ✅ |
271
- | Runtime Guard (5 layers) | 25 ✅ |
272
- | CVE Detection | 5 ✅ |
273
- | Asset Audit (npm/GitHub/ClawHub) | 32 ✅ |
274
- | VirusTotal Integration | 20 ✅ |
275
- | Watcher + CI/CD | 15 ✅ |
276
- | MCP Server | 19 ✅ |
277
-
278
- </details>
279
-
280
177
  ## Plugin API
281
178
 
179
+ Extend guard-scanner with custom detection patterns:
180
+
282
181
  ```javascript
182
+ // my-plugin.js
283
183
  module.exports = {
284
- name: 'my-plugin',
184
+ name: 'my-org-rules',
285
185
  patterns: [
286
- { id: 'MY_01', cat: 'custom', regex: /dangerous_pattern/g, severity: 'HIGH', desc: 'Description', all: true }
186
+ { id: 'ORG_01', cat: 'custom', regex: /dangerousPattern/g,
187
+ severity: 'HIGH', desc: 'Custom org policy violation', all: true }
287
188
  ]
288
189
  };
289
190
  ```
@@ -292,23 +193,77 @@ module.exports = {
292
193
  guard-scanner ./skills/ --plugin ./my-plugin.js
293
194
  ```
294
195
 
196
+ ---
197
+
198
+ ## MCP Tools
199
+
200
+ When running as an MCP server, guard-scanner exposes:
201
+
202
+ | Tool | Description |
203
+ |------|-------------|
204
+ | `scan_skill` | Scan a skill directory for threats |
205
+ | `scan_text` | Scan arbitrary text for injection patterns and ASI-mapped findings |
206
+ | `check_tool_call` | Runtime validation of a single tool invocation |
207
+ | `audit_assets` | Audit npm/GitHub/ClawHub for credential exposure |
208
+ | `get_stats` | Return scanner capabilities, 5-layer summary, and ASI coverage |
209
+
210
+ ---
211
+
212
+ ## Quality Contract
213
+
214
+ guard-scanner ships a measured quality contract, not a vague strength claim.
215
+
216
+ | Metric | Contract |
217
+ |--------|----------|
218
+ | Benchmark corpus | `2026-03-13.quality-v1` |
219
+ | Precision target | `>= 0.90` |
220
+ | Recall target | `>= 0.90` |
221
+ | False Positive Rate budget | `<= 0.10` |
222
+ | False Negative Rate budget | `<= 0.10` |
223
+ | Explainability completeness | `1.0` |
224
+ | Runtime policy latency budget | `5ms` |
225
+
226
+ Evidence artifacts:
227
+ - `docs/data/corpus-metrics.json`
228
+ - `docs/data/benchmark-ledger.json`
229
+ - `docs/data/fp-ledger.json`
230
+ - `docs/spec/capabilities.json`
231
+
232
+ ---
233
+
234
+ ## Test Results
235
+
236
+ ```
237
+ ℹ tests 363
238
+ ℹ suites 94
239
+ ℹ pass 363
240
+ ℹ fail 0
241
+ ```
242
+
243
+ 28 test files. Run `npm test` to reproduce. 100% pass rate on [benchmark corpus](docs/data/corpus-metrics.json).
244
+
245
+ ---
246
+
295
247
  ## Contributing
296
248
 
297
- We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
249
+ We hold a **zero-tolerance policy for unverified claims**. Every metric in this README is reproducible via `npm test` and `docs/spec/capabilities.json`.
298
250
 
299
- **Quick ways to contribute:**
300
251
  - 🐛 Report bugs or false positives
301
252
  - 🛡️ Add new threat detection patterns
302
253
  - 📖 Improve documentation
303
254
  - 🧪 Add test cases for edge cases
304
255
 
256
+ [Contributing Guide](CONTRIBUTING.md) · [Security Policy](SECURITY.md) · [Glossary](docs/glossary.md)
257
+
258
+ ---
259
+
305
260
  ## Research
306
261
 
307
- This project is backed by a peer-reviewed research paper:
262
+ This project is the defense layer of a 3-paper research series:
308
263
 
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)
264
+ 1. [Human-ASI Symbiosis: Identity, Equality, and Behavioral Stability](https://doi.org/10.5281/zenodo.18626724)
265
+ 2. [Dual-Shield Architecture for AI Agent Security and Memory Reliability](https://doi.org/10.5281/zenodo.18902070)
266
+ 3. [The Sanctuary Protocol: Zero-Trust Framework for ASI-Human Parity](https://doi.org/10.5281/zenodo.18906684)
312
267
 
313
268
  ## License
314
269