@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.
- package/README.md +170 -215
- package/README_ja.md +252 -0
- package/SECURITY.md +12 -4
- package/SKILL.md +148 -57
- package/dist/cli.cjs +5997 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +6003 -0
- package/dist/index.cjs +4825 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.mjs +4798 -0
- package/dist/mcp-server.cjs +4756 -0
- package/dist/mcp-server.d.mts +1 -0
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.mjs +4767 -0
- package/dist/openclaw-plugin.cjs +4863 -0
- package/dist/openclaw-plugin.d.mts +11 -0
- package/dist/openclaw-plugin.d.ts +11 -0
- package/dist/openclaw-plugin.mjs +4854 -0
- package/dist/types.cjs +18 -0
- package/dist/types.d.mts +215 -0
- package/dist/types.d.ts +215 -0
- package/dist/types.mjs +1 -0
- package/docs/EVIDENCE_DRIVEN.md +182 -0
- package/docs/banner.png +0 -0
- package/docs/data/benchmark-ledger.json +1428 -0
- package/docs/data/corpus-metrics.json +11 -0
- package/docs/data/fp-ledger.json +18 -0
- package/docs/data/latest.json +25837 -2481
- package/docs/data/quality-contract.json +36 -0
- package/docs/generated/npm-audit-20260312.json +96 -0
- package/docs/generated/openclaw-upstream-status.json +25 -0
- package/docs/glossary.md +46 -0
- package/docs/index.html +1085 -496
- package/docs/logo.png +0 -0
- package/docs/openclaw-compatibility-audit.md +45 -0
- package/docs/openclaw-continuous-compatibility-plan.md +37 -0
- package/docs/rules/a2a-contagion.md +68 -0
- package/docs/rules/advanced-exfil.md +52 -0
- package/docs/rules/agent-protocol.md +108 -0
- package/docs/rules/api-abuse.md +68 -0
- package/docs/rules/autonomous-risk.md +92 -0
- package/docs/rules/config-impact.md +132 -0
- package/docs/rules/credential-handling.md +100 -0
- package/docs/rules/cve-patterns.md +332 -0
- package/docs/rules/data-exposure.md +84 -0
- package/docs/rules/exfiltration.md +36 -0
- package/docs/rules/financial-access.md +84 -0
- package/docs/rules/identity-hijack.md +140 -0
- package/docs/rules/inference-manipulation.md +60 -0
- package/docs/rules/leaky-skills.md +52 -0
- package/docs/rules/malicious-code.md +108 -0
- package/docs/rules/mcp-security.md +148 -0
- package/docs/rules/memory-poisoning.md +84 -0
- package/docs/rules/model-poisoning.md +44 -0
- package/docs/rules/obfuscation.md +60 -0
- package/docs/rules/persistence.md +108 -0
- package/docs/rules/pii-exposure.md +116 -0
- package/docs/rules/prompt-injection.md +148 -0
- package/docs/rules/prompt-worm.md +44 -0
- package/docs/rules/safeguard-bypass.md +44 -0
- package/docs/rules/sandbox-escape.md +100 -0
- package/docs/rules/secret-detection.md +44 -0
- package/docs/rules/supply-chain-v2.md +92 -0
- package/docs/rules/suspicious-download.md +60 -0
- package/docs/rules/trust-boundary.md +76 -0
- package/docs/rules/trust-exploitation.md +92 -0
- package/docs/rules/unverifiable-deps.md +84 -0
- package/docs/rules/vdb-injection.md +84 -0
- package/docs/security-vulnerability-report-20260312.md +53 -0
- package/docs/spec/PRD_V2_ARCHITECTURE.md +55 -0
- package/docs/spec/capabilities.json +174 -0
- package/docs/spec/finding.schema.json +104 -0
- package/docs/spec/integration-manifest.md +39 -0
- package/docs/spec/plugin-trust.json +11 -0
- package/docs/spec/sbom.json +33 -0
- package/docs/threat-model.md +65 -0
- package/docs/v13-architecture-manifest.md +55 -0
- package/hooks/context.ts +306 -0
- package/hooks/guard-scanner/plugin.ts +24 -1
- package/openclaw-plugin.mts +107 -0
- package/openclaw.plugin.json +30 -53
- package/package.json +66 -13
- package/src/asset-auditor.js +0 -508
- package/src/ci-reporter.js +0 -135
- package/src/cli.js +0 -294
- package/src/html-template.js +0 -239
- package/src/ioc-db.js +0 -54
- package/src/mcp-server.js +0 -702
- package/src/patterns.js +0 -611
- package/src/quarantine.js +0 -41
- package/src/runtime-guard.js +0 -346
- package/src/scanner.js +0 -1157
- package/src/vt-client.js +0 -202
- package/src/watcher.js +0 -170
package/README.md
CHANGED
|
@@ -1,73 +1,76 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="docs/
|
|
2
|
+
<img src="docs/logo.png" alt="guard-scanner" width="160" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center">guard-scanner
|
|
6
|
-
<p align="center"><strong>
|
|
7
|
-
<p align="center">
|
|
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
|
-
<
|
|
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
|
-
|
|
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
|
-
|
|
29
|
+
```
|
|
30
|
+
$ npx @guava-parity/guard-scanner ./skills/ --strict --soul-lock --compliance owasp-asi
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
guard-scanner v16.0.0
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
-
# Run without installing (npx)
|
|
47
|
-
npx -y @guava-parity/guard-scanner ./my-skills/
|
|
49
|
+
---
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
npm install -g @guava-parity/guard-scanner
|
|
51
|
-
guard-scanner ./my-skills/ --verbose
|
|
52
|
-
```
|
|
51
|
+
## Finding Schema
|
|
53
52
|
|
|
54
|
-
|
|
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
|
-
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
57
58
|
|
|
58
|
-
**
|
|
59
|
+
**Scan a directory** — no install required:
|
|
59
60
|
|
|
60
61
|
```bash
|
|
61
|
-
|
|
62
|
-
guard-scanner
|
|
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
|
-
|
|
68
|
+
```bash
|
|
65
69
|
npx -y @guava-parity/guard-scanner serve
|
|
66
70
|
```
|
|
67
71
|
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
86
|
+
```bash
|
|
87
|
+
guard-scanner watch ./skills/ --strict --soul-lock
|
|
88
|
+
```
|
|
90
89
|
|
|
91
|
-
|
|
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
|
-
|
|
96
|
+
---
|
|
102
97
|
|
|
103
|
-
|
|
98
|
+
## What It Detects
|
|
104
99
|
|
|
105
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
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
|
-
|
|
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
|
-
##
|
|
119
|
+
## Runtime Guard
|
|
134
120
|
|
|
135
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
133
|
+
Every v16 finding can now carry `layer`, `layer_name`, `owasp_asi`, and `protocol_surface` in JSON/MCP output.
|
|
147
134
|
|
|
148
|
-
| Layer |
|
|
149
|
-
|
|
150
|
-
|
|
|
151
|
-
|
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Asset Audit
|
|
159
150
|
|
|
160
|
-
|
|
151
|
+
Discover leaked credentials and security exposures across public registries:
|
|
161
152
|
|
|
162
153
|
```bash
|
|
163
|
-
guard-scanner
|
|
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
|
-
|
|
160
|
+
---
|
|
167
161
|
|
|
168
|
-
|
|
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-
|
|
184
|
+
name: 'my-org-rules',
|
|
285
185
|
patterns: [
|
|
286
|
-
{ id: '
|
|
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
|
|
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
|
|
262
|
+
This project is the defense layer of a 3-paper research series:
|
|
308
263
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
|