@yagyeshvyas/vibeguard 1.0.0 → 1.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.
package/README.md CHANGED
@@ -1,871 +1,500 @@
1
- <div align="center">
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" />
5
-
6
- <br/>
7
-
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" />
15
-
16
- <br/>
17
- <br/>
18
-
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" />
30
-
31
- <br/>
32
- <br/>
33
-
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/>
42
-
43
- <!-- Tagline -->
44
- <h3>The Security & Privacy Platform Built for Vibe Coders</h3>
45
-
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>
47
-
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>
58
-
59
- </div>
60
-
61
- ---
62
-
63
- <!-- Install -->
64
- ## 📦 Install
65
-
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
- ```
79
-
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
- ```
86
-
87
- <div align="center">
88
-
89
- ### `vibeguard auto` activates everything in one command
90
-
91
- ```
92
- [VibeGuard] Activating full protection...
93
-
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
99
-
100
- [VibeGuard] Fully active:
101
-
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
106
-
107
- Status: vibeguard auto --status
108
- Stop: vibeguard auto --stop
109
- Override: VG_OVERRIDE=1 <command>
110
- ```
111
-
112
- </div>
113
-
114
- Or individual commands:
115
- ```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
121
- ```
122
-
123
- ### Wire into Claude Code (from GitHub clone)
124
-
125
- ```bash
126
- # In your project directory:
127
- echo '{ "mcpServers": { "vibeguard": { "command": "node", "args": ["/path/to/VibeGuard/bin/cli.js", "mcp"] } } }' > .mcp.json
128
- ```
129
-
130
- Or use the global Claude Code command:
131
- ```bash
132
- claude mcp add vibeguard -- node /path/to/VibeGuard/bin/cli.js mcp
133
- ```
134
-
135
- ### Wire into Cursor / Windsurf / other MCP clients
136
-
137
- Add to your MCP config file:
138
- ```json
139
- {
140
- "mcpServers": {
141
- "vibeguard": {
142
- "command": "node",
143
- "args": ["/path/to/VibeGuard/bin/cli.js", "mcp"]
144
- }
145
- }
146
- }
147
- ```
148
-
149
- ### Wire into Codex CLI
150
-
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
- ```
157
-
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>
190
-
191
- <br/>
192
-
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
198
- ```
199
-
200
- </div>
201
-
202
- ---
203
-
204
- <!-- Table of Contents -->
205
- <div align="center">
206
- <h2>📖 What is VibeGuard?</h2>
207
- </div>
208
-
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.
210
-
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
221
-
222
- ---
223
-
224
- <div align="center">
225
- <h2>🛡️ 13-Layer Defense Architecture</h2>
226
- </div>
227
-
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>
330
-
331
- ---
332
-
333
- <div align="center">
334
- <h2>🔥 What VibeGuard Catches</h2>
335
- </div>
336
-
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>
438
-
439
- ---
440
-
441
- <div align="center">
442
- <h2>⚡ Privacy Commands</h2>
443
- </div>
444
-
445
- ```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
460
- ```
461
-
462
- ### PII Detection & Redaction
463
-
464
- ```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'
470
- ```
471
-
472
- Detected types: email, phone, SSN, credit card (Luhn-validated), AWS keys, JWTs, private keys, IP addresses, IBANs, MAC addresses.
473
-
474
- ---
475
-
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.
481
-
482
- ```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
486
- ```
487
-
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? |
503
-
504
- ---
505
-
506
- <div align="center">
507
- <h2>🔬 AST Taint Analysis & Confidence</h2>
508
- </div>
509
-
510
- VibeGuard uses **scope-aware AST dataflow analysis** (not just regex) to track user input from source to sink:
511
-
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
- ```
517
-
518
- **Confidence levels** on every finding reduce alert fatigue:
519
-
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 |
525
-
526
- ```bash
527
- vibeguard scan --min-confidence medium # hide low-confidence hints
528
- vibeguard scan --show-suppressed # show inline-suppressed findings
529
- ```
530
-
531
- **Inline suppression** with reasons:
532
-
533
- ```js
534
- 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
- ```
538
-
539
- SARIF output maps confidence to `result.properties.confidence` for CI integrations.
540
-
541
- ---
542
-
543
- <div align="center">
544
- <h2>📊 Numbers</h2>
545
- </div>
546
-
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>
576
-
577
- ---
578
-
579
- <div align="center">
580
- <h2>📏 Benchmark (Precision / Recall / F1)</h2>
581
- </div>
582
-
583
- We measure VibeGuard against a curated JS vuln corpus — not a fake rule count.
584
-
585
- <!-- BENCHMARK:START -->
586
- <!-- Auto-generated by `npm run benchmark` — do not edit manually -->
587
-
588
- ## Summary
589
-
590
- | Category | TP | FP | FN | Precision | Recall | F1 |
591
- |----------|----|----|----|-----------|--------|----|
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%** |
598
-
599
- ## Per-Category Details
600
-
601
- ### injection
602
-
603
- | File | Rule ID | Verdict |
604
- |------|---------|---------|
605
- | cmd-concat.js | `taint.command-injection` | TP |
606
- | cmd-concat.js | `ast.command-injection` | TP |
607
- | cmd-concat2.js | `taint.command-injection` | TP |
608
- | cmd-concat2.js | `ast.command-injection` | TP |
609
- | cmd-go.go | `go.command-injection` | TP |
610
- | cmd-py.py | `py.os-system` | TP |
611
- | cmd-py2.py | `py.subprocess-shell-true` | TP |
612
- | 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 |
616
- | 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
- | eval-template.js | `ast.eval-dynamic` | TP |
620
- | eval-template.js | `taint.code-injection` | FP |
621
- | nosql-where.js | `ast.nosql-injection` | TP |
622
- | nosql.js | `ast.nosql-injection` | TP |
623
- | nosql2.js | `ast.nosql-injection` | TP |
624
- | nosql3.js | `ast.nosql-injection` | TP |
625
- | open-redirect.js | `web.open-redirect` | TP |
626
- | open-redirect2.js | `taint.open-redirect` | TP |
627
- | proto-poll.js | `injection.prototype-pollution` | TP |
628
- | proto-poll.js | `ast.mass-assignment` | TP |
629
- | proto-poll2.js | `injection.prototype-pollution` | TP |
630
- | 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
- | ssrf.js | `ast.ssrf` | TP |
658
- | ssrf2.js | `taint.ssrf` | TP |
659
- | cmd-array.js | `taint.command-injection` | FP |
660
- | sql-parameterized.js | `taint.sql-injection` | FP |
661
-
662
- ### secrets
663
-
664
- | File | Rule ID | Verdict |
665
- |------|---------|---------|
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 |
670
- | github-token.js | `secret.github-token` | TP |
671
- | github-token2.js | `secret.github-token` | TP |
672
- | github-token2.js | `secret.high-entropy` | TP |
673
- | gitlab-token.js | `secret.gitlab-token` | TP |
674
- | mailgun-key.js | `secret.mailgun-key` | TP |
675
- | mailgun-key.js | `secret.high-entropy` | TP |
676
- | npm-token.js | `secret.npm-token` | TP |
677
- | npm-token.js | `secret.high-entropy` | TP |
678
- | 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 |
683
-
684
- ### xss
685
-
686
- | File | Rule ID | Verdict |
687
- |------|---------|---------|
688
- | dangerously-html.jsx | `react.dangerous-html` | TP |
689
- | dangerously-html2.jsx | `react.dangerous-html` | TP |
690
- | dangerously-html2.jsx | `ai.llm-output-dom` | TP |
691
- | eval-llm-output.js | `ai.llm-output-dom` | TP |
692
-
693
- ### path-traversal
694
-
695
- | File | Rule ID | Verdict |
696
- |------|---------|---------|
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
- | 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
- | sendfile.js | `taint.path-traversal` | TP |
704
- | unlink-concat.js | `taint.path-traversal` | TP |
705
- | write-concat.js | `taint.path-traversal` | TP |
706
- | allowlist.js | `taint.path-traversal` | FP |
707
-
708
- ### ai-safety
709
-
710
- | File | Rule ID | Verdict |
711
- |------|---------|---------|
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 |
716
- | llm-output-exec.js | `taint.command-injection` | TP |
717
- | llm-output-exec.js | `ast.command-injection` | TP |
718
- | 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 |
721
-
722
- ## Methodology
723
-
724
- - **True Positive (TP)**: Expected rule fires on a vuln file.
725
- - **False Positive (FP)**: Any finding on a clean file, or an unexpected rule on a vuln file.
726
- - **False Negative (FN)**: Expected rule that did not fire on a vuln file.
727
- - **Precision** = TP / (TP + FP)
728
- - **Recall** = TP / (TP + FN)
729
- - **F1** = 2 * (Precision * Recall) / (Precision + Recall)
730
-
731
- Generated: 2026-07-12T03:43:25.339Z
732
-
733
- <!-- BENCHMARK:END -->
734
-
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.**
754
-
755
- ---
756
-
757
- <div align="center">
758
- <h2>⚙️ Presets</h2>
759
- </div>
760
-
761
- ```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)
772
- ```
773
-
774
- ---
775
-
776
- <div align="center">
777
- <h2>🔧 CI/CD</h2>
778
- </div>
779
-
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
- ```
786
-
787
- Templates included for: **GitLab CI**, **Jenkins**, **CircleCI**, **Azure Pipelines**.
788
-
789
- ---
790
-
791
- <div align="center">
792
- <h2>💻 Languages & Frameworks</h2>
793
- </div>
794
-
795
- **Languages (14):** JavaScript, TypeScript, Python, Go, Java, Ruby, PHP, C#, Rust, Kotlin, Swift, Bash, SQL, YAML
796
-
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
798
-
799
- **Compliance:** SOC 2, PCI-DSS, HIPAA, GDPR, ISO 27001, EU AI Act
800
-
801
- ---
802
-
803
- <div align="center">
804
- <h2>🛠️ Development</h2>
805
- </div>
806
-
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
- ```
815
-
816
- ---
817
-
818
- <div align="center">
819
- <h2>📖 Honest Scope</h2>
820
- </div>
821
-
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
827
-
828
- It **raises the floor fast** — catching the holes that AI tools create by default.
829
-
830
- ---
831
-
832
- <div align="center">
833
- <h2>📄 License</h2>
834
-
835
- MIT — Free forever. No ads. No tracking. No data collection.
836
-
837
- </div>
838
-
839
- ---
840
-
841
- <div align="center">
842
-
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" />
845
-
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>
859
-
860
- <br/>
861
- <br/>
862
-
863
- <p><b>⭐ If VibeGuard helped you, star the repo!</b></p>
864
-
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>
866
-
867
- <br/>
868
-
869
- <p><sub>VibeGuard v0.1.0 · MIT License · 693 rules · 75 MCP tools · 13 defense layers · $0 cost · zero telemetry</sub></p>
870
-
1
+ <div align="center">
2
+
3
+ <!-- Animated logo / banner -->
4
+ <img src="website/banner.svg" alt="VibeGuard" width="480" />
5
+
6
+ ### Scan your AI-generated app for leaked keys, open databases, and injection holes in 5 seconds. 100% offline, free forever.
7
+
8
+ <!-- Badges -->
9
+ <p>
10
+ <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>
11
+ <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>
12
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT license" /></a>
13
+ </p>
14
+
15
+ <!-- Demo GIF -->
16
+ <img src="website/demo.gif" alt="VibeGuard scan demo" width="640" />
17
+
18
+ <br/>
19
+ <sub>Captured against a test project with a planted <code>sk_live</code> Stripe key.</sub>
20
+
21
+ ---
22
+
23
+ <!-- Quick install command -->
24
+ <a href="https://www.npmjs.com/package/@yagyeshvyas/vibeguard"><code>npx @yagyeshvyas/vibeguard scan</code></a>
25
+
26
+ [Features](#what-it-catches) &bull; [Quick Start](#quick-start) &bull; [Benchmark](#benchmark) &bull; [Commands](#commands) &bull; [Website](https://vibe-guard-site-ivory.vercel.app/) &bull; [Docs](https://github.com/yagyeshVyas/VibeGuard/wiki)
27
+
28
+ </div>
29
+
30
+ <!-- Anchor target for the badge link -->
31
+ <a id="license"></a>
32
+
33
+ ---
34
+
35
+ ```
36
+ $ npx @yagyeshvyas/vibeguard scan
37
+
38
+ VibeGuard security scan
39
+ ./my-app
40
+
41
+ CRITICAL api/route.ts:3 [secret.openai-key]
42
+ OpenAI API key hardcoded in server code
43
+ fix: Move to environment variable.
44
+
45
+ HIGH db/query.ts:5 [taint.sql-injection]
46
+ User input flows into SQL query via template literal (dataflow-confirmed)
47
+ fix: Use parameterized queries / prepared statements.
48
+
49
+ HIGH app/page.jsx:8 [taint.xss-dom]
50
+ User input from URLSearchParams reaches innerHTML — DOM XSS
51
+ fix: Use textContent instead of innerHTML. Sanitize with DOMPurify if needed.
52
+
53
+ Grade D (12 files) 1 critical 3 high 2 medium 1 low
54
+
55
+ Run vibeguard fix to auto-fix 4 issues
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Quick Start
61
+
62
+ ```bash
63
+ npx @yagyeshvyas/vibeguard scan
64
+ ```
65
+
66
+ Or one-command full protection (daemon + hooks + shell guard):
67
+
68
+ ```bash
69
+ npx @yagyeshvyas/vibeguard auto # full protection on
70
+ npx @yagyeshvyas/vibeguard auto --stop # turn it off
71
+ ```
72
+
73
+ ### Wire into Claude Code
74
+
75
+ ```bash
76
+ claude mcp add vibeguard -- npx @yagyeshvyas/vibeguard mcp
77
+ ```
78
+
79
+ ### Wire into Cursor / Windsurf
80
+
81
+ Add to your MCP config:
82
+ ```json
83
+ { "mcpServers": { "vibeguard": { "command": "npx", "args": ["@yagyeshvyas/vibeguard", "mcp"] } } }
84
+ ```
85
+
86
+ ---
87
+
88
+ ## What It Catches
89
+
90
+ **Leaked Stripe key in client code**
91
+ ```js
92
+ const key = "sk_live_51H8x..."; // anyone with devtools can issue refunds
93
+ ```
94
+ VibeGuard flags 50+ secret types — OpenAI, AWS, GitHub, Stripe, Slack, Firebase — and tells you to move them to `process.env`.
95
+
96
+ **Supabase database open to the world**
97
+ ```sql
98
+ create table posts ( ... ); -- no RLS — anyone can read/write all rows
99
+ ```
100
+ Detects missing RLS, fake RLS policies (`USING (true)`), and service-role keys in client components.
101
+
102
+ **SQL injection via template literal**
103
+ ```js
104
+ db.query(`SELECT * FROM users WHERE id = ${req.body.id}`);
105
+ ```
106
+ AST taint analysis traces `req.body.id` through template literals to `query()` — confirmed dataflow, not a regex guess.
107
+
108
+ **Prompt injection in system prompt**
109
+ ```js
110
+ { role: "system", content: "You are " + req.body.prompt }
111
+ ```
112
+ Catches user input injected into the system role — the root cause of most prompt injection attacks.
113
+
114
+ **`dangerouslySetInnerHTML` with request data**
115
+ ```jsx
116
+ <div dangerouslySetInnerHTML={{__html: req.body.html}} />
117
+ ```
118
+ Flags XSS sinks across React, Vue (`v-html`), Angular (`innerHTML`), and raw `innerHTML` / `outerHTML` / `insertAdjacentHTML`.
119
+
120
+ **AI agent loop without iteration cap**
121
+ ```js
122
+ while (true) { await agent.step(); }
123
+ ```
124
+ Detects uncapped agent loops — infinite API spend, resource exhaustion.
125
+
126
+ **Hardcoded JWT secret**
127
+ ```js
128
+ jwt.sign(payload, "mysecret123"); // token forgery
129
+ ```
130
+ Catches hardcoded session secrets, JWT keys, and credentials in config files, Dockerfiles, and Kubernetes secrets.
131
+
132
+ **Shell command from LLM output**
133
+ ```js
134
+ const completion = await openai.chat.completions.create({...});
135
+ exec(completion.choices[0].message.content); // RCE via prompt injection
136
+ ```
137
+ Only scanner that detects LLM output reaching `exec`, `eval`, SQL queries, and DOM sinks.
138
+
139
+ ---
140
+
141
+ ## `vibeguard auto` — One Command Full Protection
142
+
143
+ ```bash
144
+ vibeguard auto # activates everything
145
+ vibeguard auto --status # see what's active
146
+ vibeguard auto --stop # reverse everything, restore backups
147
+ ```
148
+
149
+ | Layer | What it does |
150
+ |-------|-------------|
151
+ | Daemon | Watches files, auto-scans on every change (300ms debounce) |
152
+ | Pre-commit hook | Blocks git commits on critical findings |
153
+ | Post-edit hook | Auto-scans files after AI agent edits them |
154
+ | Shell guard | Blocks dangerous commands (`rm -rf`, `sudo`, `curl\|sh`) before execution |
155
+
156
+ All state in `.vibeguard/auto.json`. Idempotent — safe to run twice. `--stop` restores everything byte-for-byte.
157
+
158
+ Flags: `--ci` (pipeline mode, exit non-zero on critical), `--fix` (apply safe auto-fixes), `--no-shell`, `--strict`.
159
+
160
+ ---
161
+
162
+ ## Confidence + Inline Suppression
163
+
164
+ Every finding has a confidence level:
165
+
166
+ | Confidence | Meaning |
167
+ |------------|---------|
168
+ | `high` | Dataflow-confirmed — input traced to sink via AST |
169
+ | `medium` | Multi-signal regex with validation logic |
170
+ | `low` | Bare regex match — heuristic hint |
171
+
172
+ ```bash
173
+ vibeguard scan --min-confidence medium # hide low-confidence hints (default)
174
+ vibeguard scan --all # show everything
175
+ ```
176
+
177
+ Suppress inline with a reason:
178
+
179
+ ```js
180
+ const key = "sk_live_..."; // vibeguard-ignore[secret.stripe-live-key]: test fixture
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Coverage & Limits
186
+
187
+ Detection depth is **not uniform across languages** — be honest about what you're getting:
188
+
189
+ | Language | Secrets / patterns | Dataflow taint | Engine |
190
+ |----------|:---:|:---:|--------|
191
+ | JavaScript / TypeScript | ✅ | ✅ interprocedural + cross-file | AST (acorn) |
192
+ | Python | ✅ | ⚠️ heuristic (line-proximity, single-file) | regex |
193
+ | Go | ✅ | ⚠️ targeted rules (e.g. `fmt.Sprintf` SQL) | regex |
194
+ | Java / PHP / Ruby / C# / Rust | ✅ | ❌ pattern-only | regex |
195
+
196
+ **Engine modes.** Full precision needs the optional `acorn` parser. Without it VibeGuard runs `regex-only` and says so loudly on every scan:
197
+
198
+ ```
199
+ ⚠ engine: regex-only — acorn not installed, AST/taint precision disabled.
200
+ ```
201
+
202
+ Install precision: `npm i -D acorn acorn-walk acorn-typescript`.
203
+
204
+ **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:
205
+
206
+ ```
207
+ ⚠ degraded coverage: 2 file(s) not fully analyzed [passes: ast, taint].
208
+ ```
209
+
210
+ Use `vibeguard scan --strict` to make a degraded scan a hard failure (exit 3) in CI.
211
+
212
+ **Fast modes.** `--changed` rescans only files changed since the last scan (SHA-256 cache; ~100×+ 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). `--no-suppress` ignores inline `vibeguard-ignore` comments and the heuristic FP filter for a CI trust gate.
213
+
214
+ **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.
215
+
216
+ ---
217
+
218
+ ## Benchmark
219
+
220
+ Measured against a curated corpus of 121 files (90 vuln + 31 clean). Not a vanity number.
221
+
222
+ <!-- BENCHMARK:START -->
223
+ <!-- Auto-generated by `npm run benchmark` — do not edit manually -->
224
+
225
+ ## Summary
226
+
227
+ | Category | TP | FP | FN | Precision | Recall | F1 |
228
+ |----------|----|----|----|-----------|--------|----|
229
+ | injection | 43 | 5 | 6 | 89.6% | 87.8% | 88.7% |
230
+ | secrets | 19 | 7 | 2 | 73.1% | 90.5% | 80.9% |
231
+ | xss | 16 | 0 | 1 | 100.0% | 94.1% | 97.0% |
232
+ | path-traversal | 9 | 1 | 1 | 90.0% | 90.0% | 90.0% |
233
+ | ai-safety | 8 | 2 | 6 | 80.0% | 57.1% | 66.7% |
234
+ | **OVERALL** | **95** | **15** | **16** | **86.4%** | **85.6%** | **86.0%** |
235
+
236
+ ## Per-Category Details
237
+
238
+ ### injection
239
+
240
+ | File | Rule ID | Verdict |
241
+ |------|---------|---------|
242
+ | sql-concat.js | `code.sql-injection` | TP |
243
+ | sql-concat.js | `taint.sql-injection` | TP |
244
+ | sql-concat2.js | `code.sql-injection` | TP |
245
+ | sql-concat2.js | `taint.sql-injection` | TP |
246
+ | sql-concat3.js | `code.sql-injection` | TP |
247
+ | sql-template.js | `db.sql-template-literal` | TP |
248
+ | sql-template.js | `taint.sql-injection` | FN |
249
+ | sql-template2.js | `db.sql-template-literal` | FN |
250
+ | sql-template2.js | `taint.sql-injection` | TP |
251
+ | sql-template3.js | `db.sql-template-literal` | TP |
252
+ | sql-template3.js | `taint.sql-injection` | FN |
253
+ | sql-raw-rb.js | `code.sql-injection` | TP |
254
+ | sql-raw2.js | `db.sql-template-literal` | TP |
255
+ | sql-knex.js | `code.sql-injection` | TP |
256
+ | sql-knex.js | `mikroorm.identifier-from-request` | FP |
257
+ | sql-sequelize.js | `code.sql-injection` | TP |
258
+ | sql-fstring.py | `py.sql-injection` | TP |
259
+ | sql-fstring2.py | `py.sql-injection` | TP |
260
+ | sql-py-concat.py | `py.sql-injection` | FN |
261
+ | sql-sprintf.go | `go.sql-fmt-sprintf` | TP |
262
+ | sql-sprintf.go | `go.sql-injection` | FP |
263
+ | sql-sprintf2.go | `go.sql-fmt-sprintf` | TP |
264
+ | sql-sprintf2.go | `go.sql-injection` | FP |
265
+ | sql-kotlin.kt | `kotlin.sql-injection` | TP |
266
+ | sql-csharp.cs | `csharp.sql-injection` | TP |
267
+ | cmd-concat.js | `taint.command-injection` | TP |
268
+ | cmd-concat.js | `ast.command-injection` | TP |
269
+ | cmd-template.js | `taint.command-injection` | TP |
270
+ | cmd-template.js | `ast.command-injection` | TP |
271
+ | cmd-concat2.js | `taint.command-injection` | TP |
272
+ | cmd-concat2.js | `ast.command-injection` | TP |
273
+ | cmd-spawn.js | `taint.command-injection` | FN |
274
+ | cmd-py.py | `py.os-system` | TP |
275
+ | cmd-py2.py | `py.subprocess-shell-true` | TP |
276
+ | cmd-py3.py | `py.os-system` | TP |
277
+ | cmd-go.go | `go.command-injection` | TP |
278
+ | eval-input.js | `ast.eval-dynamic` | TP |
279
+ | eval-template.js | `ast.eval-dynamic` | TP |
280
+ | eval-template.js | `taint.code-injection` | FP |
281
+ | eval-new-function.js | `ast.function-constructor` | TP |
282
+ | eval-new-function.js | `ast.mass-assignment` | FP |
283
+ | nosql.js | `ast.nosql-injection` | TP |
284
+ | nosql2.js | `ast.nosql-injection` | TP |
285
+ | nosql3.js | `ast.nosql-injection` | TP |
286
+ | nosql-where.js | `ast.nosql-injection` | TP |
287
+ | proto-poll.js | `injection.prototype-pollution` | TP |
288
+ | proto-poll.js | `ast.mass-assignment` | TP |
289
+ | proto-poll2.js | `injection.prototype-pollution` | TP |
290
+ | proto-poll3.js | `injection.prototype-pollution` | TP |
291
+ | ssrf.js | `ast.ssrf` | TP |
292
+ | ssrf2.js | `ast.ssrf` | FN |
293
+ | ssrf2.js | `taint.ssrf` | TP |
294
+ | open-redirect.js | `web.open-redirect` | TP |
295
+ | open-redirect2.js | `taint.open-redirect` | TP |
296
+
297
+ ### secrets
298
+
299
+ | File | Rule ID | Verdict |
300
+ |------|---------|---------|
301
+ | openai-key.js | `secret.openai-key` | TP |
302
+ | openai-key2.js | `secret.anthropic-key` | TP |
303
+ | github-token.js | `secret.github-token` | TP |
304
+ | github-token2.js | `secret.github-token` | TP |
305
+ | github-token2.js | `secret.high-entropy` | FP |
306
+ | stripe-key.js | `secret.stripe-live-key` | TP |
307
+ | stripe-key.js | `secret.generic-credential` | TP |
308
+ | stripe-key.js | `stripe.key-in-client` | FP |
309
+ | stripe-restricted.js | `secret.stripe-restricted-key` | TP |
310
+ | slack-token.js | `secret.slack-token` | TP |
311
+ | gitlab-token.js | `secret.gitlab-token` | TP |
312
+ | sendgrid-key.js | `secret.sendgrid-key` | TP |
313
+ | npm-token.js | `secret.npm-token` | TP |
314
+ | npm-token.js | `secret.high-entropy` | FP |
315
+ | gcp-key.js | `secret.gcp-api-key` | FN |
316
+ | private-key.js | `secret.private-key` | TP |
317
+ | aws-key.js | `secret.aws-access-key` | TP |
318
+ | mailgun-key.js | `secret.mailgun-key` | TP |
319
+ | mailgun-key.js | `secret.high-entropy` | FP |
320
+ | telegram-token.js | `secret.telegram-bot-token` | FN |
321
+ | resend-key.js | `secret.resend-key` | TP |
322
+ | conn-string.js | `secret.conn-string-password` | TP |
323
+ | conn-string.js | `secret.connection-string` | FP |
324
+ | generic-secret.js | `secret.generic-credential` | TP |
325
+ | docker-build-arg.js | `secret.docker-build-arg` | TP |
326
+ | docker-build-arg.js | `ai.key-in-url` | FP |
327
+ | env-secret.js | `secret.aws-secret-in-env` | TP |
328
+ | env-secret.js | `secret.high-entropy` | FP |
329
+
330
+ ### xss
331
+
332
+ | File | Rule ID | Verdict |
333
+ |------|---------|---------|
334
+ | reflected-xss.js | `xss.reflected-response` | TP |
335
+ | reflected-xss.js | `taint.xss-reflected` | TP |
336
+ | reflected-xss2.js | `xss.reflected-response` | TP |
337
+ | reflected-xss2.js | `taint.xss-reflected` | TP |
338
+ | reflected-xss3.js | `xss.reflected-response` | TP |
339
+ | reflected-xss3.js | `taint.xss-reflected` | TP |
340
+ | reflected-xss4.js | `xss.reflected-response` | TP |
341
+ | reflected-xss4.js | `taint.xss-reflected` | TP |
342
+ | innerhtml.js | `injection.xss-angular-innerHTML` | TP |
343
+ | innerhtml.js | `taint.xss-dom` | TP |
344
+ | innerhtml2.js | `injection.xss-innerhtml-direct` | TP |
345
+ | innerhtml2.js | `taint.xss-dom` | TP |
346
+ | dangerously-html.jsx | `react.dangerous-html` | TP |
347
+ | dangerously-html2.jsx | `react.dangerous-html` | TP |
348
+ | dangerously-html2.jsx | `ai.llm-output-dom` | TP |
349
+ | vue-v-html.js | `injection.xss-vue-v-html` | FN |
350
+ | eval-llm-output.js | `ai.llm-output-dom` | TP |
351
+
352
+ ### path-traversal
353
+
354
+ | File | Rule ID | Verdict |
355
+ |------|---------|---------|
356
+ | read-concat.js | `taint.path-traversal` | TP |
357
+ | sendfile.js | `taint.path-traversal` | TP |
358
+ | read-template.js | `taint.path-traversal` | TP |
359
+ | read-template.js | `ai.tool-broad-file-access` | TP |
360
+ | write-concat.js | `taint.path-traversal` | TP |
361
+ | unlink-concat.js | `taint.path-traversal` | TP |
362
+ | create-read-stream.js | `taint.path-traversal` | TP |
363
+ | append-file.js | `taint.path-traversal` | TP |
364
+ | path-join-template.js | `taint.path-traversal` | FN |
365
+ | path-join-template.js | `upload.filename-path-traversal` | TP |
366
+ | allowlist.js | `taint.path-traversal` | FP |
367
+
368
+ ### ai-safety
369
+
370
+ | File | Rule ID | Verdict |
371
+ |------|---------|---------|
372
+ | user-in-system-prompt.js | `ai.user-input-in-system-prompt` | TP |
373
+ | llm-output-exec.js | `ai.llm-output-exec` | TP |
374
+ | llm-output-exec.js | `taint.command-injection` | TP |
375
+ | llm-output-exec.js | `ai.llm-output-shell` | FP |
376
+ | llm-output-exec.js | `ast.command-injection` | FP |
377
+ | agent-loop-no-cap.js | `ai.agent-loop-no-cap` | TP |
378
+ | model-id-user-input.js | `ai.model-id-injection` | TP |
379
+ | tool-result-injection.js | `ai.tool-result-injection` | FN |
380
+ | agent-memory-poison.js | `ai.memory-poisoning` | FN |
381
+ | tool-poisoning.js | `ai.tool-poisoning` | TP |
382
+ | tool-poisoning.js | `ai.mcp-description-injection-deep` | TP |
383
+ | prompt-extraction.js | `ai.prompt-extraction` | FN |
384
+ | llm-output-dom.js | `ai.llm-output-dom` | TP |
385
+ | agent-deploy.js | `ai.agent-can-deploy` | FN |
386
+ | agent-secrets.js | `ai.agent-can-access-secrets` | FN |
387
+ | model-id-template.js | `ai.model-id-injection` | FN |
388
+
389
+ ## Methodology
390
+
391
+ - **True Positive (TP)**: Expected rule fires on a vuln file.
392
+ - **False Positive (FP)**: Any finding on a clean file, or an unexpected rule on a vuln file.
393
+ - **False Negative (FN)**: Expected rule that did not fire on a vuln file.
394
+ - **Precision** = TP / (TP + FP)
395
+ - **Recall** = TP / (TP + FN)
396
+ - **F1** = 2 * (Precision * Recall) / (Precision + Recall)
397
+
398
+ Generated: 2026-07-12T18:25:03.049Z
399
+
400
+ <!-- BENCHMARK:END -->
401
+
402
+ ---
403
+
404
+ ## Commands
405
+
406
+ ```bash
407
+ vibeguard scan [dir] # scan a project (auto-detects framework)
408
+ vibeguard scan --fix # scan + apply safe auto-fixes
409
+ vibeguard scan --all # show all findings including low-confidence
410
+ vibeguard auto [dir] # full protection (daemon + hooks + shell guard)
411
+ vibeguard auto --stop # turn off, restore backups
412
+ vibeguard fix [dir] # auto-fix 43 rule types
413
+ vibeguard pre-deploy [dir] # 13-gate deployment check
414
+ vibeguard mcp # MCP server (for AI client integration)
415
+ vibeguard guard "command" # check a shell command before running it
416
+ vibeguard install-hook # git pre-commit hook (blocks on critical)
417
+ vibeguard install-hook-post # PostToolUse hook (auto-scan AI edits)
418
+ ```
419
+
420
+ ---
421
+
422
+ ## Privacy
423
+
424
+ VibeGuard runs entirely on your machine. No telemetry, no analytics, no network calls by default.
425
+
426
+ | Command | Network? |
427
+ |---------|---------|
428
+ | `scan`, `fix`, `auto`, `mcp`, `install` | Never |
429
+ | `cve` (package name lookup) | Opt-in, OSV.dev only |
430
+ | `url` (header scan) | Opt-in, URL you provide |
431
+
432
+ 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.
433
+
434
+ ---
435
+
436
+ ## Honest Scope
437
+
438
+ VibeGuard catches the mechanical security holes that AI coding tools leave behind. It does **not**:
439
+
440
+ - Prove your app is safe or leak-proof
441
+ - Track personal data end-to-end through your app
442
+ - Judge business logic flaws
443
+ - Replace a real security review for anything touching money, auth, or personal data
444
+
445
+ 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.
446
+
447
+ ---
448
+
449
+ ## Languages
450
+
451
+ 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.
452
+
453
+ ---
454
+
455
+ ## CI/CD
456
+
457
+ ```bash
458
+ vibeguard auto --ci # non-interactive, exit non-zero on critical
459
+ vibeguard init-ci # generate GitHub Actions workflow
460
+ vibeguard scan --output sarif # SARIF output for GitHub Code Scanning
461
+ ```
462
+
463
+ Templates included for GitLab CI, Jenkins, CircleCI, Azure Pipelines.
464
+
465
+ ---
466
+
467
+ ## Development
468
+
469
+ ```bash
470
+ npm install
471
+ npm test # 342 tests
472
+ npm run benchmark # precision/recall/F1
473
+ npm run counts # verify rule/tool counts match source
474
+ npm run lint # 0 errors
475
+ ```
476
+
477
+ ---
478
+
479
+ ## License
480
+
481
+ MIT. Free forever. No ads. No tracking. No data collection.
482
+
483
+ ---
484
+
485
+ <div align="center">
486
+
487
+ ## Built by Yagyesh Vyas
488
+
489
+ <p>
490
+ <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>
491
+ <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>
492
+ <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>
493
+ <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>
494
+ </p>
495
+
496
+ 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).
497
+
498
+ <sub>&copy; 2026 Yagyesh Vyas. Released under the MIT License.</sub>
499
+
871
500
  </div>