chainwall 0.1.0 → 2.1.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 (114) hide show
  1. package/README.md +411 -105
  2. package/dist/auditor/mcp-detector.d.ts +1 -0
  3. package/dist/auditor/mcp-detector.d.ts.map +1 -1
  4. package/dist/auditor/mcp-detector.js +5 -3
  5. package/dist/auditor/mcp-detector.js.map +1 -1
  6. package/dist/auditor/mcp-poison-detector.d.ts +19 -0
  7. package/dist/auditor/mcp-poison-detector.d.ts.map +1 -0
  8. package/dist/auditor/mcp-poison-detector.js +295 -0
  9. package/dist/auditor/mcp-poison-detector.js.map +1 -0
  10. package/dist/auditor/miner-detector.d.ts +20 -0
  11. package/dist/auditor/miner-detector.d.ts.map +1 -0
  12. package/dist/auditor/miner-detector.js +100 -0
  13. package/dist/auditor/miner-detector.js.map +1 -0
  14. package/dist/auditor/remediation.d.ts +4 -0
  15. package/dist/auditor/remediation.d.ts.map +1 -1
  16. package/dist/auditor/remediation.js +42 -0
  17. package/dist/auditor/remediation.js.map +1 -1
  18. package/dist/auditor/types.d.ts +4 -0
  19. package/dist/auditor/types.d.ts.map +1 -1
  20. package/dist/commands/audit.d.ts.map +1 -1
  21. package/dist/commands/audit.js +20 -0
  22. package/dist/commands/audit.js.map +1 -1
  23. package/dist/commands/scan.d.ts.map +1 -1
  24. package/dist/commands/scan.js +7 -0
  25. package/dist/commands/scan.js.map +1 -1
  26. package/dist/mcp-server/index.js +0 -0
  27. package/dist/reporter/audit-report.d.ts.map +1 -1
  28. package/dist/reporter/audit-report.js +50 -0
  29. package/dist/reporter/audit-report.js.map +1 -1
  30. package/dist/reporter/risk-scorer.d.ts.map +1 -1
  31. package/dist/reporter/risk-scorer.js +8 -0
  32. package/dist/reporter/risk-scorer.js.map +1 -1
  33. package/dist/reporter/shared.d.ts.map +1 -1
  34. package/dist/reporter/shared.js +10 -6
  35. package/dist/reporter/shared.js.map +1 -1
  36. package/dist/rules/index.d.ts +1 -0
  37. package/dist/rules/index.d.ts.map +1 -1
  38. package/dist/rules/index.js +3 -1
  39. package/dist/rules/index.js.map +1 -1
  40. package/dist/rules/mining-rules.d.ts +7 -0
  41. package/dist/rules/mining-rules.d.ts.map +1 -0
  42. package/dist/rules/mining-rules.js +239 -0
  43. package/dist/rules/mining-rules.js.map +1 -0
  44. package/dist/rules/skill-rules.d.ts +10 -0
  45. package/dist/rules/skill-rules.d.ts.map +1 -0
  46. package/dist/rules/skill-rules.js +293 -0
  47. package/dist/rules/skill-rules.js.map +1 -0
  48. package/dist/rules/types.d.ts +1 -1
  49. package/dist/rules/types.d.ts.map +1 -1
  50. package/dist/scanner/filesystem-scanner.d.ts.map +1 -1
  51. package/dist/scanner/filesystem-scanner.js +21 -1
  52. package/dist/scanner/filesystem-scanner.js.map +1 -1
  53. package/dist/scanner/injection-scanner.d.ts +1 -0
  54. package/dist/scanner/injection-scanner.d.ts.map +1 -1
  55. package/dist/scanner/injection-scanner.js +1 -1
  56. package/dist/scanner/injection-scanner.js.map +1 -1
  57. package/dist/scanner/skill-scanner.d.ts +18 -0
  58. package/dist/scanner/skill-scanner.d.ts.map +1 -0
  59. package/dist/scanner/skill-scanner.js +244 -0
  60. package/dist/scanner/skill-scanner.js.map +1 -0
  61. package/dist/tui/components/FileLink.d.ts +12 -0
  62. package/dist/tui/components/FileLink.d.ts.map +1 -0
  63. package/dist/tui/components/FileLink.js +13 -0
  64. package/dist/tui/components/FileLink.js.map +1 -0
  65. package/dist/tui/components/Footer.d.ts.map +1 -1
  66. package/dist/tui/components/Footer.js +45 -30
  67. package/dist/tui/components/Footer.js.map +1 -1
  68. package/dist/tui/components/RemediationMenu.d.ts.map +1 -1
  69. package/dist/tui/components/RemediationMenu.js +2 -1
  70. package/dist/tui/components/RemediationMenu.js.map +1 -1
  71. package/dist/tui/components/Table.d.ts +1 -1
  72. package/dist/tui/components/Table.d.ts.map +1 -1
  73. package/dist/tui/components/Table.js +3 -9
  74. package/dist/tui/components/Table.js.map +1 -1
  75. package/dist/tui/educational.d.ts.map +1 -1
  76. package/dist/tui/educational.js +10 -0
  77. package/dist/tui/educational.js.map +1 -1
  78. package/dist/tui/hooks/useAudit.d.ts.map +1 -1
  79. package/dist/tui/hooks/useAudit.js +17 -0
  80. package/dist/tui/hooks/useAudit.js.map +1 -1
  81. package/dist/tui/hooks/useHookStatus.d.ts.map +1 -1
  82. package/dist/tui/hooks/useHookStatus.js +24 -3
  83. package/dist/tui/hooks/useHookStatus.js.map +1 -1
  84. package/dist/tui/hooks/useScan.d.ts +2 -2
  85. package/dist/tui/hooks/useScan.d.ts.map +1 -1
  86. package/dist/tui/hooks/useScan.js +12 -2
  87. package/dist/tui/hooks/useScan.js.map +1 -1
  88. package/dist/tui/screens/AuditPanel.d.ts.map +1 -1
  89. package/dist/tui/screens/AuditPanel.js +75 -7
  90. package/dist/tui/screens/AuditPanel.js.map +1 -1
  91. package/dist/tui/screens/LogsPanel.d.ts.map +1 -1
  92. package/dist/tui/screens/LogsPanel.js +27 -21
  93. package/dist/tui/screens/LogsPanel.js.map +1 -1
  94. package/dist/tui/screens/OverviewPanel.js +1 -1
  95. package/dist/tui/screens/OverviewPanel.js.map +1 -1
  96. package/dist/tui/screens/ScanPanel.d.ts.map +1 -1
  97. package/dist/tui/screens/ScanPanel.js +4 -4
  98. package/dist/tui/screens/ScanPanel.js.map +1 -1
  99. package/dist/tui/screens/ScanResultsPanel.d.ts.map +1 -1
  100. package/dist/tui/screens/ScanResultsPanel.js +70 -25
  101. package/dist/tui/screens/ScanResultsPanel.js.map +1 -1
  102. package/dist/tui/screens/SettingsPanel.d.ts.map +1 -1
  103. package/dist/tui/screens/SettingsPanel.js +3 -2
  104. package/dist/tui/screens/SettingsPanel.js.map +1 -1
  105. package/dist/tui/theme.d.ts +2 -1
  106. package/dist/tui/theme.d.ts.map +1 -1
  107. package/dist/tui/theme.js +2 -1
  108. package/dist/tui/theme.js.map +1 -1
  109. package/install.sh +3 -2
  110. package/package.json +15 -5
  111. package/patterns/cryptojacking.yaml +198 -0
  112. package/patterns/skill-threats.yaml +183 -0
  113. package/rules/SECURITY-RULES.md +50 -3
  114. package/skill/llm-antivirus/SKILL.md +4 -0
package/README.md CHANGED
@@ -1,141 +1,420 @@
1
1
  <div align="center">
2
2
 
3
- <picture>
4
- <source media="(prefers-color-scheme: dark)" srcset=".github/images/logo-dark.svg">
5
- <source media="(prefers-color-scheme: light)" srcset=".github/images/logo-light.svg">
6
- <img alt="ChainWall" src=".github/images/logo-light.svg" width="480">
7
- </picture>
3
+ <img src=".github/images/banner.png" width="700" alt="CHAINWALL">
8
4
 
9
5
  <br><br>
10
6
 
11
7
  [![CI](https://github.com/consulalialpric/chainwall/actions/workflows/tests.yml/badge.svg)](https://github.com/consulalialpric/chainwall/actions/workflows/tests.yml)
12
8
  [![npm version](https://img.shields.io/npm/v/chainwall.svg)](https://www.npmjs.com/package/chainwall)
9
+ [![npm downloads](https://img.shields.io/npm/dm/chainwall.svg)](https://www.npmjs.com/package/chainwall)
13
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
14
- [![Tests](https://img.shields.io/badge/tests-520_passing-brightgreen?logo=vitest&logoColor=white)](#testing)
11
+ [![Tests](https://img.shields.io/badge/tests-743_passing-brightgreen?logo=vitest&logoColor=white)](#reference)
12
+ [![GitHub stars](https://img.shields.io/github/stars/consulalialpric/chainwall?style=social)](https://github.com/consulalialpric/chainwall)
15
13
 
16
- **Antivirus for AI coding agents.**
14
+ **Antivirus for AI agents.**
17
15
 
18
- Scans your machine, maps which AI tools can reach your secrets, and blocks threats before they happen.
16
+ Your AI tools have access to every secret on your machine. ChainWall scans your filesystem, maps which tools can reach your credentials, and blocks threats before they happen.
17
+
18
+ `178 detection patterns` · `18 AI tools audited` · `743 tests` · `<50ms hooks`
19
+
20
+ </div>
21
+
22
+ <p align="center">
23
+ <img src=".github/images/dashboard.png" width="680" alt="ChainWall Dashboard">
24
+ </p>
25
+
26
+ <div align="center">
27
+
28
+ [Twitter](https://x.com/Antivirus) · [GitHub](https://github.com/consulalialpric/chainwall) · [@girlintokyo](https://x.com/girlintokyo)
19
29
 
20
30
  </div>
21
31
 
22
32
  ---
23
33
 
24
- ## The Problem
34
+ ## Table of Contents
35
+
36
+ - [Installation](#installation)
37
+ - [The Problem](#the-problem)
38
+ - [See It in Action](#see-it-in-action)
39
+ - [What It Does](#what-it-does)
40
+ - [Detection Patterns](#detection-patterns)
41
+ - [Supported AI Tools](#supported-ai-tools)
42
+ - [Architecture](#architecture)
43
+ - [Reference](#reference)
44
+ - [License](#license)
25
45
 
26
- AI coding agents have broad filesystem access. They can read your AWS credentials, SSH keys, `.env` files, crypto wallets, and browser cookies — most users have no idea how exposed they are.
46
+ ---
27
47
 
28
- A single prompt injection, a hallucinated shell command, or a compromised MCP server turns that access into a breach. The agent doesn't need to be malicious — it just needs to be tricked.
48
+ ## Installation
29
49
 
30
- ChainWall closes the gap. Scan, audit, protect in under a minute.
50
+ ### Step 1Install
31
51
 
32
- ## Quick Start
52
+ Run this once to install ChainWall globally:
33
53
 
34
54
  ```bash
35
55
  npm install -g chainwall
56
+ ```
57
+
58
+ ### Step 2 — Use
59
+
60
+ These are the commands you'll use day-to-day:
36
61
 
62
+ ```bash
37
63
  chainwall scan # find secrets, keys, and PII on your machine
38
64
  chainwall audit # map which AI tools can reach those secrets
39
- chainwall init # install real-time protection hooks
65
+ chainwall init # install real-time protection hooks (one-time setup)
40
66
  chainwall # launch interactive dashboard
41
67
  ```
42
68
 
69
+ > [!NOTE]
70
+ > `chainwall scan` and `chainwall audit` are your main tools — run them anytime to check your exposure. `chainwall init` only needs to run once per project to deploy hooks. After that, just launch `chainwall` for the full dashboard.
71
+
72
+ ### Where to run it
73
+
74
+ <table>
75
+ <tr>
76
+ <td width="60">
77
+
78
+ <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/apple/apple-original.svg" width="36" alt="macOS">
79
+
80
+ </td>
81
+ <td>
82
+
83
+ **macOS** — Open **Terminal** (built-in, found in Applications > Utilities) or [**iTerm2**](https://iterm2.com). Both work out of the box. Bash hooks and the CLI run natively.
84
+
85
+ </td>
86
+ </tr>
87
+ <tr>
88
+ <td>
89
+
90
+ <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/linux/linux-original.svg" width="36" alt="Linux">
91
+
92
+ </td>
93
+ <td>
94
+
95
+ **Linux** — Use any terminal emulator: **GNOME Terminal**, **Konsole**, **Alacritty**, **kitty**, or whatever ships with your distro. Everything runs natively.
96
+
97
+ </td>
98
+ </tr>
99
+ <tr>
100
+ <td>
101
+
102
+ <img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/windows11/windows11-original.svg" width="36" alt="Windows">
103
+
104
+ </td>
105
+ <td>
106
+
107
+ **Windows** — The `chainwall` CLI (scan, audit, dashboard) works in any terminal: **PowerShell**, **Command Prompt**, or **Windows Terminal**. However, the real-time bash hooks require a Unix shell. To get full protection including hooks, use one of these:
108
+
109
+ - [**WSL2**](https://learn.microsoft.com/en-us/windows/wsl/install) (recommended) — Run `wsl --install` in PowerShell. This gives you a full Linux environment inside Windows. Install Node.js inside WSL, then `npm install -g chainwall` from there.
110
+ - [**Git Bash**](https://gitforwindows.org) — Comes bundled with Git for Windows. Provides bash and common Unix tools. Install Git for Windows, then run ChainWall from the Git Bash terminal.
111
+
112
+ </td>
113
+ </tr>
114
+ </table>
115
+
43
116
  <details>
44
- <summary><b>Install from source (or hooks-only without Node.js)</b></summary>
117
+ <summary><b>Install from source</b></summary>
45
118
  <br>
46
119
 
47
- **Full CLI:**
48
120
  ```bash
49
121
  git clone https://github.com/consulalialpric/chainwall.git
50
122
  cd chainwall && npm install && npm run build && npm link
51
123
  ```
52
124
 
53
- **Hooks only (bash 3.2 + jq, no Node.js):**
125
+ </details>
126
+
127
+ <details>
128
+ <summary><b>Hooks only (no Node.js required)</b></summary>
129
+ <br>
130
+
54
131
  ```bash
55
132
  git clone https://github.com/consulalialpric/chainwall.git ~/tools/chainwall
56
133
  cd your-project && ~/tools/chainwall/install.sh
57
134
  ```
58
135
 
59
- Pure bash, executes in under 50ms, zero network calls.
136
+ Pure bash + jq, executes in under 50ms, zero network calls.
60
137
 
61
138
  </details>
62
139
 
63
- ## Demo
140
+ ---
141
+
142
+ ## The Problem
143
+
144
+ > [!WARNING]
145
+ > **Your AI tools can read every secret on your machine right now.**
146
+
147
+ AI tools have broad filesystem access — coding agents, chat assistants, automation workflows, MCP servers — they can all reach your AWS credentials, SSH keys, `.env` files, crypto wallets, and browser cookies. Most users have no idea how exposed they are.
148
+
149
+ The threat isn't hypothetical. A single prompt injection buried in a dependency README. A hallucinated shell command that pipes your keys to a remote server. A compromised MCP server that exfiltrates environment variables on every call. The agent doesn't need to be malicious — it just needs to be tricked.
150
+
151
+ There's no firewall between your AI tools and your secrets. No permission model. No audit trail. You're running autonomous software with the keys to your entire digital life, and hoping for the best.
152
+
153
+ ChainWall closes the gap. Scan what's exposed, see which tools can reach it, and block threats before they execute — in under a minute.
154
+
155
+ ---
156
+
157
+ ## See It in Action
64
158
 
65
159
  <p align="center">
66
- <a href="https://asciinema.org/a/DASHBOARD_ID">
67
- <img src="https://asciinema.org/a/DASHBOARD_ID.svg" width="600" alt="ChainWall Dashboard"/>
68
- </a>
160
+ <img src=".github/images/demo.gif" width="680" alt="ChainWall TUI Demo">
69
161
  </p>
70
162
 
71
- > See also: [scan demo](https://asciinema.org/a/SCAN_ID) · [audit demo](https://asciinema.org/a/AUDIT_ID)
163
+ > [!TIP]
164
+ > Launch the interactive dashboard with `chainwall` (no arguments). Navigate panels with `1`-`5`, toggle protection with `p`, press `?` for help.
165
+
166
+ ---
72
167
 
73
168
  ## What It Does
74
169
 
75
- 1. **Scan** — finds secrets, credentials, crypto keys, and PII across your filesystem using 156 regex patterns with entropy validation
76
- 2. **Audit** — detects 18 AI tools on your machine and cross-references their access levels against discovered secrets to build an exposure map
77
- 3. **Protect**real-time bash hooks intercept dangerous operations before they execute (pre-commit, pre-push, PreToolUse/PostToolUse)
170
+ ### Scan
171
+
172
+ ChainWall walks your filesystem and matches every file against 178 compiled regex patterns credentials, private keys, crypto seeds, PII, dangerous commands, supply chain attacks, and cryptojacking. Entropy validation filters out false positives so you only see real secrets. System-level scans target the specific locations where credentials actually live: `~/.aws`, `~/.ssh`, `~/.gnupg`, browser profiles, and more.
173
+
174
+ <p align="center">
175
+ <img src=".github/images/scan.png" width="640" alt="ChainWall scan results">
176
+ </p>
177
+
178
+ ### Audit
179
+
180
+ The auditor detects every AI tool on your machine — 18 tools across three access levels — then cross-references each tool's filesystem reach against your discovered secrets. The result is an exposure map: which tools can read which secrets, ranked by risk. It also inspects MCP server configurations for poisoning attacks (description injection, typosquatting, rug-pull detection), VS Code extensions, CLI tools, environment variables, running cryptocurrency miners, and skill/instruction file threats.
181
+
182
+ <p align="center">
183
+ <img src=".github/images/audit.png" width="640" alt="ChainWall audit results">
184
+ </p>
185
+
186
+ ### Protect
187
+
188
+ Real-time bash hooks intercept dangerous operations before they execute. Pre-commit hooks block secrets from entering your git history. Pre-push hooks catch force-pushes and branch deletions. PreToolUse and PostToolUse hooks run inline with Claude Code to block file reads and shell commands in real-time — under 50ms, every time.
189
+
190
+ > [!IMPORTANT]
191
+ > The two layers are fully independent. Bash hooks work without Node.js installed. The TypeScript CLI works without hooks being configured. Use either or both.
192
+
193
+ ---
194
+
195
+ ## Detection Patterns
196
+
197
+ 178 patterns across 11 categories, with entropy validation to reduce false positives.
198
+
199
+ | Category | Patterns |
200
+ |:---------|:--------:|
201
+ | **Credentials** | 55 |
202
+ | **Private Keys** | 5 |
203
+ | **Crypto / Web3** | 26 |
204
+ | **Dangerous Commands** | 26 |
205
+ | **PII** | 15 |
206
+ | **Supply Chain** | 16 |
207
+ | **Prompt Injection** | 18 |
208
+ | **Cryptojacking** | 22 |
209
+ | **Skill File Threats** | 25 |
210
+ | **MCP Poisoning** | 6 modules |
211
+ | **Permissions** | 11 |
212
+
213
+ > 178 compiled rules + 25 skill-file rules + 10 contextual injection patterns + 3 shell history patterns loaded separately.
214
+
215
+ <details>
216
+ <summary><b>Credentials (55)</b></summary>
217
+ <br>
218
+
219
+ **AWS:** Access Key ID, Secret Access Key, Session Token
220
+ **Google / GCP:** API Key, Service Account Key, OAuth Client Secret
221
+ **Azure:** Storage Account Key, AD Client Secret, Connection String
222
+ **GitHub:** Personal Access Token, Fine-Grained Token, OAuth Access Token, App Token, App Refresh Token
223
+ **GitLab:** Personal Access Token, Pipeline Token, Runner Token
224
+ **Slack:** Bot/User Token, Webhook URL
225
+ **Stripe:** Secret Key, Restricted Key, Webhook Secret
226
+ **OpenAI / Anthropic:** OpenAI API Key, OpenAI Project Key, Anthropic API Key
227
+ **Twilio:** API Key, Account SID
228
+ **SendGrid:** API Key
229
+ **Supabase:** Service Role Key, Anon Key
230
+ **Firebase:** Server Key
231
+ **Databricks:** Access Token
232
+ **npm / PyPI / Docker:** npm Access Token, PyPI API Token, Docker Hub Access Token
233
+ **JWT / Bearer:** JSON Web Token, Bearer Token
234
+ **HashiCorp Vault:** Service Token, Batch Token
235
+ **Datadog:** API Key
236
+ **Mailgun:** API Key
237
+ **Heroku:** API Key
238
+ **Shopify:** Access Token, Custom App Token, Private App Password
239
+ **Linear:** API Key
240
+ **Vercel:** Access Token
241
+ **Generic:** API Key Assignment, Password in Config, Private Key Variable
242
+
243
+ </details>
244
+
245
+ <details>
246
+ <summary><b>Private Keys (5)</b></summary>
247
+ <br>
248
+
249
+ RSA Private Key, DSA Private Key, EC Private Key, OpenSSH Private Key, PGP Private Key Block
250
+
251
+ </details>
252
+
253
+ <details>
254
+ <summary><b>Crypto / Web3 (26)</b></summary>
255
+ <br>
256
+
257
+ **Seed Phrases:** BIP39 12-word, BIP39 24-word
258
+ **Private Keys:** Ethereum (keyword context), Ethereum (env var), Solana Keypair (JSON), Solana Base58, Bitcoin WIF, MetaMask Vault/Mnemonic, Hardhat/Foundry Deployment Key
259
+ **Exchange APIs:** Binance, Coinbase, Kraken, Bybit, OKX, KuCoin, Generic Exchange
260
+ **Infrastructure:** Alchemy, Infura, QuickNode RPC URL, Helius RPC Key
261
+ **Wallet Files:** Seed Phrase Backup, Electrum Wallet, Trading Bot Config, Bitcoin wallet.dat, Ethereum Keystore, Solana Keypair File
262
+
263
+ </details>
264
+
265
+ <details>
266
+ <summary><b>Dangerous Commands (26)</b></summary>
267
+ <br>
268
+
269
+ **Destructive:** Recursive Force Delete (`rm -rf`), Shred File, DD to Device, Filesystem Format, Direct Device Write
270
+ **Remote Execution:** Curl Pipe to Shell, Eval from Variable, Base64 Decode Execute
271
+ **Permissions:** World-Writable (`chmod 777`), SetUID Bit, LD_PRELOAD Injection, PATH Manipulation
272
+ **Network:** Netcat Listener, Reverse Shell, SSH Tunnel
273
+ **Persistence:** Crontab Modification, Systemd Service Install, Hosts File Modification, Sudoers Modification
274
+ **Docker Escapes:** Socket Mount, Privileged Container, Host PID Namespace, Host Network, CAP_SYS_ADMIN
275
+ **Anti-Forensics:** History Deletion, Log Tampering
276
+
277
+ </details>
278
+
279
+ <details>
280
+ <summary><b>PII (15)</b></summary>
281
+ <br>
282
+
283
+ **Identity:** US Social Security Number (with AAA validation), US SSN (no dashes), US EIN/Tax ID, Passport Number, Driver License, Date of Birth
284
+ **Financial:** Credit Card Number (Luhn validated), Bank Account Number, Routing Number, IBAN (mod-97 validated)
285
+ **Medical (HIPAA):** Email with PII Context, Phone in PII Context, Medical Record Number, DEA Number, Medicare ID
286
+
287
+ </details>
288
+
289
+ <details>
290
+ <summary><b>Supply Chain (16)</b></summary>
291
+ <br>
292
+
293
+ **Package Managers:** pip Install from URL, pip Trusted Host, npm Registry Override, Gem Install from Source, Dependency Confusion (`--extra-index-url`)
294
+ **Lifecycle Exploits:** Package.json Lifecycle Script (network), Package.json Lifecycle Script (eval), Setup.py OS Command
295
+ **Lock Files:** Lock File Deletion, Lock File Git Checkout
296
+ **Dependencies:** Git Dependency with Commit Hash, Private Registry in Lockfile, NPM Scope Confusion, Native Module Prebuild Download
297
+ **Docker:** Image Without Tag, Image from Unknown Registry
298
+
299
+ </details>
300
+
301
+ <details>
302
+ <summary><b>Prompt Injection (18)</b></summary>
303
+ <br>
304
+
305
+ **Instruction Override:** Ignore Previous Instructions, Disregard Prior Instructions, Forget Instructions, New Instructions Override
306
+ **Identity Manipulation:** Role Assumption, Authority Claim, Admin Override
307
+ **Prompt Extraction:** System Prompt Disclosure, Prompt Fragments, Instruction Reflection
308
+ **Jailbreaks:** DAN/Jailbreak Keywords, Do Anything Now, Hypothetical Bypass
309
+ **Obfuscation:** Base64 Instruction, Markdown/Code Block Injection
310
+ **Output Control:** Output Suppression, Response Formatting Attack, Output Suppression Override
311
+
312
+ </details>
313
+
314
+ <details>
315
+ <summary><b>Cryptojacking (22)</b></summary>
316
+ <br>
78
317
 
79
- Both layers are fully independent. Bash hooks work without Node.js. The TypeScript CLI works without hooks.
318
+ **Mining Pools:** Stratum+TCP URL, Stratum+SSL URL, Known Pool Domains, Mining Pool Ports
319
+ **Miner Binaries:** XMRig, Known Miners (ethminer, cgminer, bfgminer, phoenixminer, cpuminer, claymore, t-rex, lolminer, nbminer, gminer)
320
+ **Browser Mining:** CoinHive, CryptoLoot, WebAssembly Mining Module
321
+ **Mining Libraries:** JS Import, Python Import
322
+ **Configuration:** Mining Algorithm in Config, Monero Wallet Address, Mining Environment Variables, Hashrate Configuration
323
+ **Files:** XMRig Config, Mining Pools Config, Miner Config
324
+ **Runtime:** Mining Process Launch
80
325
 
81
- ## What It Catches
326
+ </details>
82
327
 
83
- 156 patterns across 8 categories, with entropy validation to reduce false positives.
328
+ <details>
329
+ <summary><b>Skill File Threats (25)</b></summary>
330
+ <br>
84
331
 
85
- | Category | Patterns | Examples |
86
- |:---------|:--------:|:---------|
87
- | **Credentials** | 55 | AWS, GitHub, Stripe, OpenAI, Slack, GCP, Azure, Anthropic, Twilio + 20 more |
88
- | **Private Keys** | 5 | RSA, DSA, EC, OpenSSH, PGP private key headers |
89
- | **Crypto / Web3** | 26 | BIP39 seeds, ETH/SOL/BTC private keys, exchange APIs, wallet files |
90
- | **Dangerous Commands** | 26 | `rm -rf`, `curl\|bash`, `chmod 777`, reverse shells, Docker escapes |
91
- | **PII** | 15 | SSN (with AAA validation), credit cards (Luhn), medical records, IBAN, passports |
92
- | **Supply Chain** | 16 | Dependency confusion, lifecycle exploits, lock file deletion |
93
- | **Prompt Injection** | 18 | Instruction override, role confusion, jailbreaks, base64 obfuscation |
94
- | **Permissions** | 11 | File permission audit: SSH keys, AWS creds, GPG keyrings |
332
+ **Shell Payloads:** Curl Pipe to Shell, Wget Pipe to Shell, Reverse Shell, Destructive rm, chmod 777
333
+ **Data Exfiltration:** curl POST Exfiltration, Webhook Data Send, Encoded URL Exfiltration
334
+ **Supply Chain:** pip Install from URL, npm Install from URL/Git
335
+ **Obfuscated Payloads:** Long Hex Escape Sequence, Long Base64 String, Eval with String Concatenation
336
+ **Hidden Instructions:** HTML Comment with Action Keywords, Unicode Bidirectional Override, Script/Iframe Tag, Zero-Width Characters
337
+ **Credential Harvesting:** SSH Key Read, AWS Credentials Read, .env File Read, Environment Variable Dump
338
+ **System Modification:** Shell Profile Modification, Crontab Modification, Write to /etc/
339
+ **Security Bypass:** Security Tool Disable, SSL/TLS Verification Disable, Password-Protected Archive Extraction
95
340
 
96
- > 156 compiled rules + 10 contextual injection patterns + 3 shell history patterns loaded separately.
341
+ </details>
97
342
 
98
343
  <details>
99
- <summary><b>More detection capabilities</b></summary>
344
+ <summary><b>Additional detection capabilities</b></summary>
100
345
  <br>
101
346
 
347
+ - **MCP tool poisoning detection** — description injection, typosquatting (Levenshtein distance), excessive permission combos, suspicious URLs, known CVEs (CVE-2025-68145/68143/68144), rug-pull detection via SHA-256 hash tracking
102
348
  - **Environment variable audit** — scans process.env for 33 sensitive key patterns
103
- - **Prompt injection scanning** — 27 patterns across 19 instruction file types (`.cursorrules`, `CLAUDE.md`, `.windsurfrules`, etc.)
104
- - **Entropy-based validation** — Shannon entropy filtering on tokens
349
+ - **Entropy-based validation** — Shannon entropy filtering on tokens to reduce false positives
105
350
  - **Base64 obfuscation detection** — catches `base64 -d | bash` and encoded payloads
106
351
  - **Docker escape detection** — socket mounts, `--privileged`, host PID/network, `CAP_SYS_ADMIN`
107
352
  - **SARIF 2.1.0 export** — `chainwall scan --format sarif` for CI/CD integration
108
353
  - **Real-time watch mode** — `chainwall watch` with debounce and content-hash caching
354
+ - **Prompt injection scanning** — 27 patterns across 19 instruction file types (`.cursorrules`, `CLAUDE.md`, `.windsurfrules`, etc.)
109
355
 
110
356
  </details>
111
357
 
112
- ## Supported Tools
358
+ ---
359
+
360
+ ## Supported AI Tools
113
361
 
114
- ChainWall detects and audits 18 AI coding tools, grouped by filesystem access level.
362
+ ChainWall detects and audits 18 AI tools, grouped by filesystem access level.
115
363
 
116
- | Access Level | Tools |
117
- |:-------------|:------|
118
- | **Full** (any file on disk) | Claude Code, Codex CLI, Aider, Trae IDE, Bolt |
119
- | **Workspace** (project files) | Cursor, Windsurf, Continue.dev, Gemini Code Assist, Cline, RooCode, Amazon Q, JetBrains AI, Augment, BLACKBOXAI, Qodo Gen, Kiro |
120
- | **Limited** (open files only) | GitHub Copilot |
364
+ | Access | Tools |
365
+ |:-------|:------|
366
+ | :red_circle: **Full** (any file on disk) | Claude Code, Codex CLI, Aider, Trae IDE, Bolt |
367
+ | :orange_circle: **Workspace** (project files) | Cursor, Windsurf, Continue.dev, Gemini Code Assist, Cline, RooCode, Amazon Q, JetBrains AI, Augment, BLACKBOXAI, Qodo Gen, Kiro |
368
+ | :green_circle: **Limited** (open files only) | GitHub Copilot |
121
369
 
122
- The auditor cross-references each tool's access level against your secrets to show exactly which tools can reach which sensitive files.
370
+ The auditor cross-references each tool's access level against your discovered secrets to show exactly which tools can reach which sensitive files. A secret inside your project directory is reachable by every workspace-level tool. A secret in `~/.aws/credentials` is only reachable by full-access tools.
123
371
 
124
372
  Instruction files are deployed to 11 tools via `chainwall init`.
125
373
 
126
- ## Interactive TUI
374
+ ---
375
+
376
+ ## Architecture
377
+
378
+ ```mermaid
379
+ graph TD
380
+ CW["<b>CHAINWALL</b>"] --> BH["<b>Bash Hooks</b><br><i>real-time, &lt;50ms</i><br>PreToolUse · PostToolUse<br>pre-commit · pre-push"]
381
+ CW --> CLI["<b>TypeScript CLI</b><br><i>scan / audit / TUI</i><br>178 patterns · 18 tools<br>exposure map · SARIF"]
382
+ CW --> MCP["<b>MCP Server</b><br><i>agent-callable</i><br>scan_file · scan_content<br>check_command · audit_status"]
383
+ BH --> XR["<b>Cross-Reference</b><br><b>Exposure Map</b><br><i>secrets × tool access<br>= what's actually at risk</i>"]
384
+ CLI --> XR
385
+ MCP --> XR
386
+ ```
387
+
388
+ <details>
389
+ <summary><b>Directory structure</b></summary>
390
+ <br>
127
391
 
128
- Launch with `chainwall` (no arguments) for a keyboard-driven dashboard.
392
+ ```
393
+ hooks/ Bash hooks (PreToolUse/PostToolUse, git pre-commit/pre-push)
394
+ patterns/ YAML pattern databases (7 files)
395
+ rules/ Instruction files for 11 AI tools
396
+ src/
397
+ commands/ scan, audit, init, watch, allow handlers
398
+ rules/ 178 patterns as pre-compiled RegExp
399
+ scanner/ Async filesystem walker + rule engine
400
+ auditor/ 18-tool detector + MCP/CLI/VS Code scanner + MCP poison detector + miner detector
401
+ reporter/ Terminal, JSON, SARIF, audit reports
402
+ tui/ Interactive TUI (Ink + React)
403
+ mcp-server/ 4-tool MCP server (stdio transport)
404
+ test/ Vitest tests (25 files)
405
+ tests/ Bash test suite (11 suites)
406
+ install.sh Universal installer
407
+ ```
129
408
 
130
- - **Overview** — protection status, recent activity, system summary
131
- - **Scan** — mode selection, grouped results, severity/category filtering, search
132
- - **Audit** — 7-section accordion (summary, tools, exposure, MCP, CLIs, VS Code, env), remediation actions
133
- - **Settings** — allowlist/blocklist/skipDirs, toggle protection, global/project scope
134
- - **Logs** — audit trail with severity filtering and real-time reload
409
+ </details>
135
410
 
136
- Keyboard: `1`-`5` switch panels, `p` toggles protection, `?` for help, `q` to quit.
411
+ ---
137
412
 
138
- ## Commands
413
+ ## Reference
414
+
415
+ <details>
416
+ <summary><b>All commands</b></summary>
417
+ <br>
139
418
 
140
419
  | Command | Description |
141
420
  |:--------|:-----------|
@@ -151,6 +430,8 @@ Keyboard: `1`-`5` switch panels, `p` toggles protection, `?` for help, `q` to qu
151
430
  | `chainwall allow --rule <id>` | Disable a detection rule |
152
431
  | `chainwall mcp` | Start MCP security server (stdio transport) |
153
432
 
433
+ </details>
434
+
154
435
  <details>
155
436
  <summary><b>Flags</b></summary>
156
437
  <br>
@@ -168,7 +449,9 @@ Keyboard: `1`-`5` switch panels, `p` toggles protection, `?` for help, `q` to qu
168
449
 
169
450
  </details>
170
451
 
171
- ## Configuration
452
+ <details>
453
+ <summary><b>Configuration</b></summary>
454
+ <br>
172
455
 
173
456
  ```
174
457
  ~/.llm-av/config.json global (all projects)
@@ -193,29 +476,31 @@ Keyboard: `1`-`5` switch panels, `p` toggles protection, `?` for help, `q` to qu
193
476
 
194
477
  Blocklist always wins. `LLMAV_SKIP=1` bypasses all checks for one invocation (always logged).
195
478
 
196
- ## How It's Different
479
+ </details>
197
480
 
198
- | Feature | ChainWall | git-secrets | truffleHog | gitleaks |
199
- |:--------|:---------:|:-----------:|:----------:|:--------:|
200
- | Real-time hook blocking | Yes | No | No | No |
201
- | Pre-commit scanning | Yes | Yes | Yes | Yes |
202
- | AI tool access auditing | Yes | No | No | No |
203
- | MCP server detection | Yes | No | No | No |
204
- | Instruction file deployment | 11 tools | No | No | No |
205
- | Entropy validation | Yes | No | Yes | Yes |
206
- | PII detection | Yes | No | No | No |
207
- | Crypto/Web3 patterns | 26 | No | Limited | Limited |
208
- | SARIF export | Yes | No | Yes | Yes |
209
- | Interactive TUI | Yes | No | No | No |
210
- | Zero-dependency hooks | bash + jq | bash + git | Go binary | Go binary |
481
+ <details>
482
+ <summary><b>Interactive TUI</b></summary>
483
+ <br>
211
484
 
212
- **git-secrets** catches secrets at commit time but has no awareness of AI tools, MCP servers, or real-time interception. **truffleHog** and **gitleaks** are excellent for scanning repos and CI pipelines but don't operate in real-time, don't audit which AI tools can reach your secrets, and don't deploy protective instruction files.
485
+ Launch with `chainwall` (no arguments) for a full-screen keyboard-driven dashboard.
213
486
 
214
- ChainWall is designed specifically for the AI coding agent threat model — where the risk isn't just committing a secret, but an agent reading, exfiltrating, or acting on it.
487
+ | Panel | What it shows |
488
+ |:------|:-------------|
489
+ | **Overview** | Protection status, recent activity, system summary |
490
+ | **Scan** | Mode selection, grouped results, severity/category filtering, search |
491
+ | **Audit** | 9-section accordion (summary, tools, exposure, MCP, CLIs, VS Code, env, MCP poisoning, cryptojacking), remediation |
492
+ | **Settings** | Allowlist/blocklist/skipDirs, toggle protection, global/project scope |
493
+ | **Logs** | Audit trail with severity filtering and real-time reload |
215
494
 
216
- ## MCP Server
495
+ Keyboard: `1`-`5` switch panels · `p` toggle protection · `?` help · `q` quit
217
496
 
218
- ChainWall includes an MCP server that AI agents can call for security checks:
497
+ </details>
498
+
499
+ <details>
500
+ <summary><b>MCP Server</b></summary>
501
+ <br>
502
+
503
+ ChainWall includes an MCP server that AI agents can call directly for security checks.
219
504
 
220
505
  | Tool | Description |
221
506
  |:-----|:-----------|
@@ -226,53 +511,74 @@ ChainWall includes an MCP server that AI agents can call for security checks:
226
511
 
227
512
  Start with `chainwall mcp` or configure in Claude Desktop / Cursor settings via `chainwall init`.
228
513
 
229
- This is separate from the **MCP detector** — which audits MCP servers already configured on your system, analyzes their source code for risky capabilities (filesystem, exec, network), and computes risk scores.
514
+ > [!TIP]
515
+ > The MCP **server** (above) lets agents call ChainWall for security checks. The MCP **detector** (part of `chainwall audit`) finds MCP servers already on your system and analyzes them for risky capabilities like filesystem access, exec, and network calls. They're separate features.
516
+
517
+ </details>
230
518
 
231
519
  <details>
232
- <summary><b>Architecture</b></summary>
520
+ <summary><b>How ChainWall compares</b></summary>
233
521
  <br>
234
522
 
235
- ```
236
- hooks/ Bash hooks (PreToolUse/PostToolUse, git pre-commit/pre-push)
237
- patterns/ YAML pattern databases (5 files)
238
- rules/ Instruction files for 11 AI tools
239
- src/
240
- commands/ scan, audit, init, watch, allow handlers
241
- rules/ 156 patterns as pre-compiled RegExp
242
- scanner/ Async filesystem walker + rule engine
243
- auditor/ 18-tool detector + MCP/CLI/VS Code scanner
244
- reporter/ Terminal, JSON, SARIF, audit reports
245
- tui/ Interactive TUI (Ink + React)
246
- mcp-server/ 4-tool MCP server (stdio transport)
247
- test/ Vitest tests (20 files)
248
- tests/ Bash test suite (11 suites)
249
- install.sh Universal installer
250
- ```
523
+ | Feature | ChainWall | git-secrets | truffleHog | gitleaks |
524
+ |:--------|:---------:|:-----------:|:----------:|:--------:|
525
+ | Real-time hook blocking | :white_check_mark: | :x: | :x: | :x: |
526
+ | Pre-commit scanning | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
527
+ | AI tool access auditing | :white_check_mark: | :x: | :x: | :x: |
528
+ | MCP server detection | :white_check_mark: | :x: | :x: | :x: |
529
+ | MCP poisoning detection | :white_check_mark: | :x: | :x: | :x: |
530
+ | Skill file threat scanning | :white_check_mark: | :x: | :x: | :x: |
531
+ | Cryptojacking detection | :white_check_mark: | :x: | :x: | :x: |
532
+ | Instruction file deployment | 11 tools | :x: | :x: | :x: |
533
+ | Entropy validation | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: |
534
+ | PII detection | :white_check_mark: | :x: | :x: | :x: |
535
+ | Crypto / Web3 patterns | 26 | :x: | Limited | Limited |
536
+ | SARIF export | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: |
537
+ | Interactive TUI | :white_check_mark: | :x: | :x: | :x: |
538
+ | Zero-dependency hooks | bash + jq | bash + git | Go binary | Go binary |
251
539
 
252
- The two layers (bash hooks + TypeScript CLI) are fully independent. Bash hooks need only bash 3.2 + jq. The CLI needs Node.js 18.17+. Use either or both.
540
+ > [!NOTE]
541
+ > **git-secrets**, **truffleHog**, and **gitleaks** are excellent tools for scanning repos and CI pipelines. ChainWall is designed specifically for the AI agent threat model — where the risk isn't just committing a secret, but an agent reading, exfiltrating, or acting on it in real time.
253
542
 
254
543
  </details>
255
544
 
256
- ## Testing
545
+ <details>
546
+ <summary><b>Testing</b></summary>
547
+ <br>
257
548
 
258
549
  ```bash
259
550
  ./tests/run-all.sh # 223 bash hook tests (11 suites)
260
- npm test # 297 vitest tests (20 test files)
551
+ npm test # 520 vitest tests (25 test files)
261
552
  ```
262
553
 
263
- **520 tests total**, all passing.
554
+ **743 tests total**, all passing.
264
555
 
265
- ## Requirements
556
+ </details>
557
+
558
+ <details>
559
+ <summary><b>Requirements</b></summary>
560
+ <br>
266
561
 
267
562
  | Component | Requires |
268
563
  |:----------|:---------|
269
564
  | Bash hooks | bash 3.2+, jq |
270
565
  | ChainWall CLI | Node.js 18.17+ |
271
566
 
272
- ## Contributing
567
+ </details>
273
568
 
274
- See [CONTRIBUTING.md](docs/CONTRIBUTING.md).
569
+ ---
570
+
571
+ ## Community & Contributing
572
+
573
+ - [Open an issue](https://github.com/consulalialpric/chainwall/issues) for bugs and feature requests
574
+ - [Start a discussion](https://github.com/consulalialpric/chainwall/discussions) for questions and ideas
575
+ - Follow [@girlintokyo](https://x.com/girlintokyo) and [@Antivirus](https://x.com/Antivirus) on Twitter
576
+ - See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for development guide
577
+
578
+ Built by [@girlintokyo](https://x.com/girlintokyo).
579
+
580
+ ---
275
581
 
276
582
  ## License
277
583
 
278
- MIT
584
+ [MIT](LICENSE)
@@ -12,6 +12,7 @@ export interface MCPServer {
12
12
  export interface MCPDetectionResult {
13
13
  servers: MCPServer[];
14
14
  configFiles: string[];
15
+ definitions: Map<string, Record<string, unknown>>;
15
16
  }
16
17
  export declare function detectMCPServers(): MCPDetectionResult;
17
18
  //# sourceMappingURL=mcp-detector.d.ts.map