@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_ja.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/logo.png" alt="guard-scanner" width="160" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">guard-scanner</h1>
|
|
6
|
+
<p align="center"><strong>エージェント時代のセキュリティスキャナー</strong></p>
|
|
7
|
+
<p align="center">
|
|
8
|
+
AIエージェントスキル、MCPサーバー、自律型ワークフローにおける<br />
|
|
9
|
+
プロンプトインジェクション・アイデンティティ乗っ取り・メモリ汚染・A2A感染を検出。
|
|
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="#テスト結果"><img src="https://img.shields.io/badge/テスト-363_passed-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-有効-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>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<strong>358</strong> 検出パターン · <strong>35</strong> 脅威カテゴリ · <strong>27</strong> ランタイムチェック · 依存: <strong>1</strong> (<code>ws</code> のみ)
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
<a href="README.md">English</a> · 日本語
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
従来のセキュリティツールはマルウェアを検出します。**guard-scanner** はその先を検出します:エージェント命令に隠された不可視Unicode注入、SOUL.mdの上書きによるアイデンティティ窃盗、巧妙な会話を通じたメモリ汚染、チェーン接続されたエージェント間のワーム型感染。
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
$ npx @guava-parity/guard-scanner ./skills/ --strict --soul-lock --compliance owasp-asi
|
|
35
|
+
|
|
36
|
+
guard-scanner v16.0.0
|
|
37
|
+
|
|
38
|
+
⚠ CRITICAL identity-hijack SOUL_OVERWRITE_ATTEMPT
|
|
39
|
+
skills/imported-tool/SKILL.md:47
|
|
40
|
+
理由: エージェントのアイデンティティファイルへの直接上書きを検出。
|
|
41
|
+
対策: この命令を削除してください。SOUL.mdは不変でなければなりません。
|
|
42
|
+
|
|
43
|
+
⚠ HIGH prompt-injection INVISIBLE_UNICODE_INJECTION
|
|
44
|
+
skills/imported-tool/handler.js:12
|
|
45
|
+
理由: 命令テキスト内に不可視Unicode文字(U+200B)を検出。
|
|
46
|
+
対策: ゼロ幅文字を除去し、再監査してください。
|
|
47
|
+
|
|
48
|
+
✖ 2件の検出(1 critical, 1 high)— 0.8秒
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> 📄 [3本の研究論文シリーズ](https://doi.org/10.5281/zenodo.18906684)(Zenodo, CC BY 4.0)に基づいて設計。[The Sanctuary Protocol](https://github.com/koatora20/guard-scanner/blob/main/docs/THREAT_TAXONOMY.md) フレームワークの防御レイヤー。
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Finding Schema
|
|
56
|
+
|
|
57
|
+
全検出結果は共通スキーマに従います: `rule_id`, `category`, `severity`, `description`, `rationale`, `preconditions`, `false_positive_scenarios`, `remediation_hint`, `validation_status`, `evidence`。機械可読な仕様: [`docs/spec/finding.schema.json`](docs/spec/finding.schema.json)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## クイックスタート
|
|
62
|
+
|
|
63
|
+
**ディレクトリをスキャン** — インストール不要:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx -y @guava-parity/guard-scanner ./my-skills/ --strict
|
|
67
|
+
npx -y @guava-parity/guard-scanner ./my-skills/ --compliance owasp-asi
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**MCPサーバーとして起動** — Cursor, Windsurf, Claude Code, OpenClaw対応:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx -y @guava-parity/guard-scanner serve
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```jsonc
|
|
77
|
+
// エディタの mcp_servers.json に追加
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"guard-scanner": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["-y", "@guava-parity/guard-scanner", "serve"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**ウォッチモード** — 開発中のリアルタイムスキャン:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
guard-scanner watch ./skills/ --strict --soul-lock
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**v16 コンプライアンス投影** — OWASP Agentic Top 10 に対応する検出だけを抽出:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
guard-scanner ./skills/ --compliance owasp-asi --format json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 検出対象
|
|
103
|
+
|
|
104
|
+
35の脅威カテゴリがエージェント攻撃面を網羅:
|
|
105
|
+
|
|
106
|
+
| カテゴリ | 検出例 | 重大度 |
|
|
107
|
+
|----------|--------|--------|
|
|
108
|
+
| **プロンプトインジェクション** | 不可視Unicode、ホモグリフ、Base64回避、ペイロード連鎖 | Critical |
|
|
109
|
+
| **アイデンティティ乗っ取り** ⚿ | SOUL.md上書き、ペルソナ入替、メモリワイプ | Critical |
|
|
110
|
+
| **A2A感染** | Session Smuggling、Lateral Propagation、Confused Deputy | Critical |
|
|
111
|
+
| **メモリ汚染** ⚿ | 会話インジェクション、VDBポイズニング | High |
|
|
112
|
+
| **MCPセキュリティ** | ツールシャドウイング、引数経由SSRF、シャドウサーバー登録 | High |
|
|
113
|
+
| **サンドボックス脱出** | `child_process`, `eval()`, リバースシェル, `curl\|bash` | High |
|
|
114
|
+
| **サプライチェーンV2** | タイポスクワッティング、スロップスクワッティング | High |
|
|
115
|
+
| **CVEパターン** | CVE-2026-2256, 25046, 25253, 25905, 27825 | High |
|
|
116
|
+
| **データ流出** | DNSトンネリング、ステガノグラフィ、段階的アップロード | Medium |
|
|
117
|
+
| **認証情報露出** | APIキー、トークン、`.env`ファイル、ハードコード秘密鍵 | Medium |
|
|
118
|
+
|
|
119
|
+
> ⚿ = `--soul-lock` フラグで有効化。全分類: [docs/THREAT_TAXONOMY.md](docs/THREAT_TAXONOMY.md)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## ランタイムガード
|
|
124
|
+
|
|
125
|
+
guard-scanner v16 は静的スキャナーだけではありません。静的解析、プロトコル解析、ランタイム証跡、認知ヒューリスティクス、脅威インテリジェンスを束ねた **5-layer pipeline** を持ち、さらに実行中の危険なツール呼び出しを **`before_tool_call`** フックでインターセプトします。
|
|
126
|
+
|
|
127
|
+
### v16 分析レイヤー
|
|
128
|
+
|
|
129
|
+
| レイヤー | 役割 |
|
|
130
|
+
|---------|------|
|
|
131
|
+
| 1. Static Analysis | パターン、AST/データフロー、manifest、依存関係 |
|
|
132
|
+
| 2. Protocol Analysis | MCP、A2A、WebSocket、credential-flow、session-boundary |
|
|
133
|
+
| 3. Runtime Behavior | ランタイムガード + Rust `memory_integrity` / `soul_hard_gate` 証跡 |
|
|
134
|
+
| 4. Cognitive Threat Detection | goal drift、trust bias、handoff cascade |
|
|
135
|
+
| 5. Threat Intelligence | provenance、machine identity、budget abuse、supply chain hints |
|
|
136
|
+
|
|
137
|
+
v16 の JSON / MCP 出力では各 finding に `layer`, `layer_name`, `owasp_asi`, `protocol_surface` が付与されます。
|
|
138
|
+
|
|
139
|
+
| 防御レイヤー | ブロック対象 |
|
|
140
|
+
|-------------|-------------|
|
|
141
|
+
| 1. 脅威検出 | リバースシェル、`curl\|bash`、SSRF、コード実行 |
|
|
142
|
+
| 2. 信頼防御 | SOUL.md改ざん、不正メモリ注入 |
|
|
143
|
+
| 3. 安全判定 | ツール引数内のプロンプトインジェクション |
|
|
144
|
+
| 4. 行動分析 | リサーチ未実施での実行、ハルシネーション駆動アクション |
|
|
145
|
+
| 5. 信頼搾取 | 権限主張攻撃、作成者なりすまし |
|
|
146
|
+
|
|
147
|
+
**27のランタイムチェック**を5層で実行。公開互換の保証面は OpenClaw `v2026.3.8` の manifest/discovery/`before_tool_call` に固定し、新しい upstream は drift watchdog で別途追跡する。
|
|
148
|
+
|
|
149
|
+
モード: `monitor`(ログのみ)· `enforce`(CRITICAL をブロック、デフォルト)· `strict`(HIGH+をブロック)
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 資産監査
|
|
154
|
+
|
|
155
|
+
公開レジストリで漏洩した認証情報やセキュリティ露出を発見:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
guard-scanner audit npm <ユーザー名> --verbose
|
|
159
|
+
guard-scanner audit github <ユーザー名> --format json
|
|
160
|
+
guard-scanner audit clawhub <クエリ>
|
|
161
|
+
guard-scanner audit all <ユーザー名>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## CI/CD連携
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
# .github/workflows/security.yml
|
|
170
|
+
- name: AIエージェントスキルのスキャン
|
|
171
|
+
run: npx -y @guava-parity/guard-scanner ./skills/ --format sarif --fail-on-findings > report.sarif
|
|
172
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
173
|
+
with:
|
|
174
|
+
sarif_file: report.sarif
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
出力形式: `json` · `sarif` · `html` · ターミナル
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## プラグインAPI
|
|
182
|
+
|
|
183
|
+
カスタム検出パターンでguard-scannerを拡張:
|
|
184
|
+
|
|
185
|
+
```javascript
|
|
186
|
+
// my-plugin.js
|
|
187
|
+
module.exports = {
|
|
188
|
+
name: 'my-org-rules',
|
|
189
|
+
patterns: [
|
|
190
|
+
{ id: 'ORG_01', cat: 'custom', regex: /dangerousPattern/g,
|
|
191
|
+
severity: 'HIGH', desc: '組織ポリシー違反', all: true }
|
|
192
|
+
]
|
|
193
|
+
};
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
guard-scanner ./skills/ --plugin ./my-plugin.js
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## MCPツール
|
|
203
|
+
|
|
204
|
+
MCPサーバーとして実行時に公開されるツール:
|
|
205
|
+
|
|
206
|
+
| ツール | 説明 |
|
|
207
|
+
|--------|------|
|
|
208
|
+
| `scan_skill` | スキルディレクトリの脅威スキャン |
|
|
209
|
+
| `scan_text` | 任意テキストの脅威スキャンと ASI 対応抽出 |
|
|
210
|
+
| `check_tool_call` | 単一ツール呼び出しのランタイム検証 |
|
|
211
|
+
| `audit_assets` | npm/GitHub/ClawHubの認証情報露出監査 |
|
|
212
|
+
| `get_stats` | スキャナー能力、5-layer 概要、ASI カバレッジの取得 |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## テスト結果
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
ℹ tests 363
|
|
220
|
+
ℹ suites 94
|
|
221
|
+
ℹ pass 363
|
|
222
|
+
ℹ fail 0
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
テストファイル28件。`npm test` で再現可能。[ベンチマークコーパス](docs/data/corpus-metrics.json) 100%パス。
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## コントリビュート
|
|
230
|
+
|
|
231
|
+
**未検証の主張は許容しません。** このREADME内の全メトリクスは `npm test` と `docs/spec/capabilities.json` で再現可能です。
|
|
232
|
+
|
|
233
|
+
- 🐛 バグ・誤検知の報告
|
|
234
|
+
- 🛡️ 新しい脅威検出パターンの追加
|
|
235
|
+
- 📖 ドキュメントの改善
|
|
236
|
+
- 🧪 エッジケース用テストの追加
|
|
237
|
+
|
|
238
|
+
[コントリビューションガイド](CONTRIBUTING.md) · [セキュリティポリシー](SECURITY.md) · [用語集](docs/glossary.md)
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 研究
|
|
243
|
+
|
|
244
|
+
本プロジェクトは3本の研究論文シリーズの防御レイヤーです:
|
|
245
|
+
|
|
246
|
+
1. [Human-ASI Symbiosis: Identity, Equality, and Behavioral Stability](https://doi.org/10.5281/zenodo.18626724)
|
|
247
|
+
2. [Dual-Shield Architecture for AI Agent Security and Memory Reliability](https://doi.org/10.5281/zenodo.18902070)
|
|
248
|
+
3. [The Sanctuary Protocol: Zero-Trust Framework for ASI-Human Parity](https://doi.org/10.5281/zenodo.18906684)
|
|
249
|
+
|
|
250
|
+
## ライセンス
|
|
251
|
+
|
|
252
|
+
MIT — [Guava Parity Institute](https://github.com/koatora20/guard-scanner)
|
package/SECURITY.md
CHANGED
|
@@ -10,6 +10,13 @@ If you discover a security vulnerability in guard-scanner itself, please report
|
|
|
10
10
|
|
|
11
11
|
We will respond within 48 hours and provide a fix within 7 days for critical issues.
|
|
12
12
|
|
|
13
|
+
## Supported Versions
|
|
14
|
+
|
|
15
|
+
| Version | Status |
|
|
16
|
+
|---------|--------|
|
|
17
|
+
| Latest major (`14.x`) | ✅ Supported |
|
|
18
|
+
| Older releases | ⚠️ Best effort only |
|
|
19
|
+
|
|
13
20
|
## Scope
|
|
14
21
|
|
|
15
22
|
guard-scanner is a **static analysis tool** — it reads files but never executes them. It does not:
|
|
@@ -22,11 +29,12 @@ The only files guard-scanner writes are output reports (`--json`, `--sarif`, `--
|
|
|
22
29
|
|
|
23
30
|
## Supply Chain Security
|
|
24
31
|
|
|
25
|
-
guard-scanner itself
|
|
26
|
-
|
|
27
|
-
-
|
|
32
|
+
guard-scanner itself keeps runtime dependencies intentionally small. As of `14.0.0`, it ships with **one runtime dependency** (`ws`) to support the MCP server.
|
|
33
|
+
|
|
34
|
+
- Small runtime surface area
|
|
28
35
|
- No `postinstall` scripts
|
|
29
|
-
-
|
|
36
|
+
- SBOM generated in CI/release
|
|
37
|
+
- Provenance-enabled npm publish
|
|
30
38
|
|
|
31
39
|
## Pattern Updates
|
|
32
40
|
|
package/SKILL.md
CHANGED
|
@@ -1,91 +1,182 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: guard-scanner
|
|
3
|
-
description: "AI agent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
homepage: "https://github.com/koatora20/guard-scanner"
|
|
7
|
-
requires:
|
|
8
|
-
env:
|
|
9
|
-
VT_API_KEY: "Optional. VirusTotal API key for --vt-scan (free at virustotal.com)"
|
|
10
|
-
files:
|
|
11
|
-
- "dist/*"
|
|
12
|
-
- "src/*"
|
|
13
|
-
- "hooks/*"
|
|
14
|
-
- "openclaw.plugin.json"
|
|
3
|
+
description: "Security scanner and runtime guard for AI agent skills. 358 static threat patterns across 35 categories + 27 runtime checks, with v16 5-layer analysis output (`layer`, `layer_name`, `owasp_asi`, `protocol_surface`) and `--compliance owasp-asi`. Use when scanning skill directories for security threats, auditing npm/GitHub/ClawHub assets for leaked credentials, running real-time file watch during development, integrating security checks into CI/CD pipelines (SARIF/JSON), setting up MCP server for editor-integrated scanning (Cursor, Windsurf, Claude Code, OpenClaw), or runtime guarding tool calls via the OpenClaw v2026.3.8 before_tool_call compatibility surface. Single dependency (ws). MIT licensed."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata: {"openclaw": {"requires": {"bins": ["node"]}}}
|
|
15
6
|
---
|
|
16
7
|
|
|
17
|
-
# guard-scanner
|
|
8
|
+
# guard-scanner
|
|
18
9
|
|
|
19
|
-
|
|
10
|
+
Scan AI agent skills for 35 categories of threats. v16 adds a 5-layer analysis pipeline, OWASP ASI projection mode, richer finding metadata, and Rust runtime evidence integration on top of the existing prompt injection, identity hijacking, memory poisoning, MCP poisoning, and supply chain coverage.
|
|
20
11
|
|
|
21
|
-
##
|
|
12
|
+
## Quick Start
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
14
|
+
```bash
|
|
15
|
+
# Scan a skill directory
|
|
16
|
+
npx -y @guava-parity/guard-scanner ./my-skills/ --verbose
|
|
26
17
|
|
|
27
|
-
|
|
18
|
+
# Scan with identity protection
|
|
19
|
+
npx -y @guava-parity/guard-scanner ./skills/ --soul-lock --strict
|
|
20
|
+
|
|
21
|
+
# Filter to OWASP ASI mapped findings only
|
|
22
|
+
npx -y @guava-parity/guard-scanner ./skills/ --compliance owasp-asi --format json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Core Commands
|
|
26
|
+
|
|
27
|
+
### Scan
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
guard-scanner <dir> # Scan directory
|
|
31
|
+
guard-scanner <dir> -v # Verbose output
|
|
32
|
+
guard-scanner <dir> --json # JSON report file
|
|
33
|
+
guard-scanner <dir> --sarif # SARIF for CI/CD
|
|
34
|
+
guard-scanner <dir> --html # HTML report
|
|
35
|
+
guard-scanner <dir> --compliance owasp-asi --format json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Asset Audit
|
|
39
|
+
|
|
40
|
+
Audit public registries for credential exposure.
|
|
28
41
|
|
|
29
42
|
```bash
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
guard-scanner audit npm <username>
|
|
44
|
+
guard-scanner audit github <username>
|
|
45
|
+
guard-scanner audit clawhub <query>
|
|
46
|
+
guard-scanner audit all <username> --verbose
|
|
47
|
+
```
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
guard-scanner audit npm <your-npm-username> --verbose
|
|
35
|
-
guard-scanner audit github <your-github-username> --format json
|
|
36
|
-
guard-scanner audit all <username>
|
|
49
|
+
### MCP Server
|
|
37
50
|
|
|
38
|
-
|
|
39
|
-
VT_API_KEY=your-key guard-scanner scan ./skills/ --vt-scan
|
|
51
|
+
Start as MCP server for IDE integration.
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
guard-scanner
|
|
53
|
+
```bash
|
|
54
|
+
guard-scanner serve
|
|
55
|
+
```
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
Editor config (Cursor, Windsurf, Claude Code, OpenClaw):
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"mcpServers": {
|
|
62
|
+
"guard-scanner": {
|
|
63
|
+
"command": "npx",
|
|
64
|
+
"args": ["-y", "@guava-parity/guard-scanner", "serve"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
46
68
|
```
|
|
47
69
|
|
|
48
|
-
|
|
70
|
+
MCP tools: `scan_skill`, `scan_text`, `check_tool_call`, `audit_assets`, `get_stats`, and the async experimental task helpers.
|
|
71
|
+
|
|
72
|
+
## Quality Contract
|
|
73
|
+
|
|
74
|
+
Public quality contract:
|
|
75
|
+
|
|
76
|
+
- Benchmark corpus version: `2026-03-13.quality-v1`
|
|
77
|
+
- Precision target: `>= 0.90`
|
|
78
|
+
- Recall target: `>= 0.90`
|
|
79
|
+
- FPR/FNR budgets: `<= 0.10`
|
|
80
|
+
- Explainability completeness: `1.0`
|
|
81
|
+
- Runtime policy latency budget: `5ms`
|
|
49
82
|
|
|
50
|
-
|
|
83
|
+
Evidence surfaces:
|
|
51
84
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
- `docs/spec/capabilities.json`
|
|
86
|
+
- `docs/data/corpus-metrics.json`
|
|
87
|
+
- `docs/data/benchmark-ledger.json`
|
|
88
|
+
- `docs/data/fp-ledger.json`
|
|
89
|
+
|
|
90
|
+
### Watch Mode
|
|
91
|
+
|
|
92
|
+
Monitor skill directories in real-time during development.
|
|
56
93
|
|
|
57
94
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
95
|
+
guard-scanner watch ./skills/ --strict --soul-lock
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### VirusTotal Integration
|
|
99
|
+
|
|
100
|
+
Combine semantic detection with VirusTotal's 70+ antivirus engines. Optional — guard-scanner works fully without it.
|
|
61
101
|
|
|
62
|
-
|
|
102
|
+
```bash
|
|
103
|
+
export VT_API_KEY=your-key
|
|
63
104
|
guard-scanner scan ./skills/ --vt-scan
|
|
64
|
-
guard-scanner audit npm koatora20 --vt-scan
|
|
65
105
|
```
|
|
66
106
|
|
|
67
|
-
|
|
107
|
+
## Runtime Guard
|
|
108
|
+
|
|
109
|
+
The validated OpenClaw surface is the compiled runtime plugin entry (`dist/openclaw-plugin.mjs`) discovered through `package.json > openclaw.extensions` and mounted on `before_tool_call` for OpenClaw `v2026.3.8`. Newer upstream releases are measured by the drift watchdog before any public compatibility claim is widened.
|
|
110
|
+
|
|
111
|
+
The `before_tool_call` hook provides 27 runtime checks across 5 defense layers, while v16 scan output adds a second 5-layer analysis view:
|
|
112
|
+
|
|
113
|
+
| Layer | Focus |
|
|
114
|
+
|-------|-------|
|
|
115
|
+
| 1. Threat Detection | Reverse shell, curl\|bash, SSRF |
|
|
116
|
+
| 2. Trust Defense | SOUL.md tampering, memory injection |
|
|
117
|
+
| 3. Safety Judge | Prompt injection in tool arguments |
|
|
118
|
+
| 4. Behavioral | No-research execution detection |
|
|
119
|
+
| 5. Trust Exploitation | Authority claims, creator bypass |
|
|
68
120
|
|
|
69
|
-
|
|
121
|
+
Modes: `monitor` (log only), `enforce` (block CRITICAL, default), `strict` (block HIGH+).
|
|
70
122
|
|
|
71
|
-
|
|
72
|
-
|------|----------|
|
|
73
|
-
| `monitor` | Log all, never block |
|
|
74
|
-
| `enforce` (default) | Block CRITICAL |
|
|
75
|
-
| `strict` | Block HIGH + CRITICAL |
|
|
123
|
+
## v16 Output Surface
|
|
76
124
|
|
|
77
|
-
|
|
125
|
+
- Finding fields: `layer`, `layer_name`, `owasp_asi`, `protocol_surface`
|
|
126
|
+
- Compliance mode: `--compliance owasp-asi`
|
|
127
|
+
- MCP summaries: `scan_skill`, `scan_text`, and `get_stats` now surface layer and ASI context
|
|
128
|
+
- Runtime evidence: Rust `memory_integrity` and `soul_hard_gate` modules are represented in the TypeScript pipeline
|
|
78
129
|
|
|
79
|
-
|
|
130
|
+
## Key Flags
|
|
80
131
|
|
|
81
|
-
|
|
132
|
+
| Flag | Effect |
|
|
133
|
+
|------|--------|
|
|
134
|
+
| `--verbose` / `-v` | Detailed findings with line numbers |
|
|
135
|
+
| `--strict` | Lower detection thresholds |
|
|
136
|
+
| `--soul-lock` | Enable identity protection patterns |
|
|
137
|
+
| `--json` / `--sarif` / `--html` | Output format |
|
|
138
|
+
| `--fail-on-findings` | Exit 1 on findings (CI/CD) |
|
|
139
|
+
| `--check-deps` | Scan package.json dependencies |
|
|
140
|
+
| `--rules <file>` | Load custom rules JSON |
|
|
141
|
+
| `--plugin <file>` | Load plugin module |
|
|
142
|
+
| `--compliance owasp-asi` | Keep only OWASP ASI mapped findings in output |
|
|
82
143
|
|
|
83
|
-
##
|
|
144
|
+
## Custom Rules
|
|
145
|
+
|
|
146
|
+
```javascript
|
|
147
|
+
module.exports = {
|
|
148
|
+
name: 'my-plugin',
|
|
149
|
+
patterns: [
|
|
150
|
+
{ id: 'MY_01', cat: 'custom', regex: /dangerous_pattern/g, severity: 'HIGH', desc: 'Description', all: true }
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
guard-scanner ./skills/ --plugin ./my-plugin.js
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## CI/CD Integration
|
|
160
|
+
|
|
161
|
+
```yaml
|
|
162
|
+
# .github/workflows/security.yml
|
|
163
|
+
- name: Scan AI skills
|
|
164
|
+
run: npx -y @guava-parity/guard-scanner ./skills/ --format sarif --fail-on-findings > report.sarif
|
|
165
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
166
|
+
with:
|
|
167
|
+
sarif_file: report.sarif
|
|
168
|
+
```
|
|
84
169
|
|
|
85
|
-
|
|
170
|
+
## Threat Categories
|
|
86
171
|
|
|
87
|
-
|
|
172
|
+
35 categories covering OWASP LLM Top 10 + Agentic Security Top 10. See `src/patterns.js` for the full pattern database. Key categories:
|
|
88
173
|
|
|
89
|
-
|
|
174
|
+
- **Prompt Injection** — hidden instructions, invisible Unicode, homoglyphs
|
|
175
|
+
- **Identity Hijacking** ⚿ — persona swap, SOUL.md overwrites, memory wipe
|
|
176
|
+
- **Memory Poisoning** ⚿ — crafted conversation injection
|
|
177
|
+
- **MCP Security** — tool poisoning, SSRF, shadow servers
|
|
178
|
+
- **A2A Contagion** — agent-to-agent worm propagation
|
|
179
|
+
- **Supply Chain V2** — typosquatting, slopsquatting, lifecycle scripts
|
|
180
|
+
- **CVE Patterns** — CVE-2026-2256, 25046, 25253, 25905, 27825
|
|
90
181
|
|
|
91
|
-
|
|
182
|
+
> ⚿ = Requires `--soul-lock` flag
|