@yagyeshvyas/vibeguard 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +18 -2
  3. package/bin/cli.js +2753 -2753
  4. package/ci/vibeguard.yml +42 -42
  5. package/package.json +1 -1
  6. package/scripts/counts.js +93 -93
  7. package/scripts/postinstall.js +26 -26
  8. package/src/auto.js +427 -427
  9. package/src/daemon.js +343 -343
  10. package/src/dashboard.js +278 -278
  11. package/src/engine.js +297 -297
  12. package/src/hook.js +151 -151
  13. package/src/install.js +298 -298
  14. package/src/integrity.json +1 -1
  15. package/src/plugin.js +182 -182
  16. package/src/privacy-audit.js +272 -272
  17. package/src/repl.js +150 -150
  18. package/src/report.js +331 -331
  19. package/src/rules-pack.js +3068 -3068
  20. package/src/rules.js +1822 -1822
  21. package/src/sbom.js +193 -193
  22. package/src/scanner.js +1032 -1032
  23. package/src/shell-guard.js +302 -302
  24. package/src/slopsquat.js +144 -144
  25. package/src/trace.js +220 -220
  26. package/src/.vibeguard/cache/file-hashes.json +0 -60
  27. package/src/.vibeguard/latest-snapshot.json +0 -36
  28. package/src/.vibeguard/mcp-pins.json +0 -1
  29. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/auto.js +0 -428
  30. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/daemon.js +0 -344
  31. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/dashboard.js +0 -279
  32. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/engine.js +0 -297
  33. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/hook.js +0 -151
  34. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/install.js +0 -299
  35. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/manifest.json +0 -65
  36. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/mcp-server.js +0 -2051
  37. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/plugin.js +0 -168
  38. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/pre-deploy.js +0 -362
  39. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/repl.js +0 -150
  40. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/rules.js +0 -1611
  41. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/sbom.js +0 -164
  42. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/shell-guard.js +0 -292
  43. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/slopsquat.js +0 -144
  44. package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/trace.js +0 -220
  45. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/auto.js +0 -428
  46. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/daemon.js +0 -344
  47. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/engine.js +0 -297
  48. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/install.js +0 -299
  49. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/manifest.json +0 -37
  50. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/mcp-server.js +0 -2055
  51. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/plugin.js +0 -168
  52. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/pre-deploy.js +0 -362
  53. package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/trace.js +0 -220
  54. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/auto.js +0 -428
  55. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/daemon.js +0 -344
  56. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/dashboard.js +0 -279
  57. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/engine.js +0 -297
  58. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/hook.js +0 -151
  59. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/install.js +0 -299
  60. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/manifest.json +0 -65
  61. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/mcp-server.js +0 -2055
  62. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/plugin.js +0 -168
  63. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/pre-deploy.js +0 -362
  64. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/repl.js +0 -150
  65. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/rules.js +0 -1611
  66. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/sbom.js +0 -164
  67. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/shell-guard.js +0 -292
  68. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/slopsquat.js +0 -144
  69. package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/trace.js +0 -220
  70. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/auto.js +0 -428
  71. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/daemon.js +0 -344
  72. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/dashboard.js +0 -279
  73. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/engine.js +0 -297
  74. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/hook.js +0 -151
  75. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/install.js +0 -299
  76. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/manifest.json +0 -65
  77. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/mcp-server.js +0 -2054
  78. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/plugin.js +0 -168
  79. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/pre-deploy.js +0 -362
  80. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/repl.js +0 -150
  81. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/rules.js +0 -1611
  82. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/sbom.js +0 -164
  83. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/shell-guard.js +0 -292
  84. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/slopsquat.js +0 -144
  85. package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/trace.js +0 -220
  86. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/auto.js +0 -428
  87. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/daemon.js +0 -344
  88. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/engine.js +0 -297
  89. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/install.js +0 -299
  90. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/manifest.json +0 -37
  91. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/mcp-server.js +0 -2055
  92. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/plugin.js +0 -168
  93. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/pre-deploy.js +0 -362
  94. package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/trace.js +0 -220
  95. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/auto.js +0 -428
  96. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/daemon.js +0 -344
  97. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/engine.js +0 -297
  98. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/manifest.json +0 -33
  99. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/mcp-server.js +0 -2055
  100. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/rules.js +0 -1611
  101. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/shell-guard.js +0 -292
  102. package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/trace.js +0 -220
  103. package/src/.vibeguard-baseline.json +0 -5226
package/ci/vibeguard.yml CHANGED
@@ -1,42 +1,42 @@
1
- name: VibeGuard
2
-
3
- # Runs VibeGuard on every push and pull request. Fails the job when a CRITICAL
4
- # issue is found, and uploads a SARIF report to GitHub code scanning so findings
5
- # show up inline on the PR.
6
- #
7
- # Scope reminder: VibeGuard catches high-frequency, well-defined issues (secrets,
8
- # injection, misconfig). It is not a full security review.
9
-
10
- on:
11
- push:
12
- branches: [main, master]
13
- pull_request:
14
-
15
- permissions:
16
- contents: read
17
- security-events: write # required to upload SARIF
18
-
19
- jobs:
20
- vibeguard:
21
- runs-on: ubuntu-latest
22
- steps:
23
- - uses: actions/checkout@v4
24
-
25
- - uses: actions/setup-node@v4
26
- with:
27
- node-version: 20
28
-
29
- # Produce a SARIF report for GitHub code scanning (does not fail the job).
30
- - name: VibeGuard scan (SARIF)
31
- run: npx -y vibeguard scan . --sarif --no-deps > vibeguard.sarif || true
32
-
33
- - name: Upload SARIF
34
- if: always()
35
- uses: github/codeql-action/upload-sarif@v3
36
- with:
37
- sarif_file: vibeguard.sarif
38
-
39
- # Gate the build: fail on CRITICAL findings, and on a degraded scan
40
- # (--strict) so an incomplete/parse-failed scan can't pass as clean.
41
- - name: VibeGuard gate (block on CRITICAL)
42
- run: npx -y vibeguard scan . --precommit --strict
1
+ name: VibeGuard
2
+
3
+ # Runs VibeGuard on every push and pull request. Fails the job when a CRITICAL
4
+ # issue is found, and uploads a SARIF report to GitHub code scanning so findings
5
+ # show up inline on the PR.
6
+ #
7
+ # Scope reminder: VibeGuard catches high-frequency, well-defined issues (secrets,
8
+ # injection, misconfig). It is not a full security review.
9
+
10
+ on:
11
+ push:
12
+ branches: [main, master]
13
+ pull_request:
14
+
15
+ permissions:
16
+ contents: read
17
+ security-events: write # required to upload SARIF
18
+
19
+ jobs:
20
+ vibeguard:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-node@v4
26
+ with:
27
+ node-version: 20
28
+
29
+ # Produce a SARIF report for GitHub code scanning (does not fail the job).
30
+ - name: VibeGuard scan (SARIF)
31
+ run: npx -y vibeguard scan . --sarif --no-deps > vibeguard.sarif || true
32
+
33
+ - name: Upload SARIF
34
+ if: always()
35
+ uses: github/codeql-action/upload-sarif@v3
36
+ with:
37
+ sarif_file: vibeguard.sarif
38
+
39
+ # Gate the build: fail on CRITICAL findings, and on a degraded scan
40
+ # (--strict) so an incomplete/parse-failed scan can't pass as clean.
41
+ - name: VibeGuard gate (block on CRITICAL)
42
+ run: npx -y vibeguard scan . --precommit --strict
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagyeshvyas/vibeguard",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Offline-by-default security scanner and runtime firewall for AI-coded apps and MCP agents. 861 rules, 93 MCP tools, signed default-deny policy, tool-poisoning/prompt-injection/secret-exfiltration detection, signed audit + external anchor, hosted approvals with signed proofs, HTTP/SSE MCP bridge with OAuth/TLS, Linux bubblewrap isolation, Windows Job containment and macOS sandbox-exec. Zero telemetry.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/scripts/counts.js CHANGED
@@ -1,94 +1,94 @@
1
- 'use strict';
2
-
3
- /*
4
- * scripts/counts.js — generates live counts of rules, MCP tools, and defense
5
- * layers from the source. Used to keep README.md and package.json numbers
6
- * from drifting. Run: `npm run counts`.
7
- *
8
- * Output: JSON to stdout: { rules, mcpTools, layers }
9
- * Also writes a README block between <!-- COUNTS:START --> and <!-- COUNTS:END -->
10
- * markers if --update-readme is passed.
11
- */
12
-
13
- const fs = require('fs');
14
- const path = require('path');
15
-
16
- const ROOT = path.resolve(__dirname, '..');
17
-
18
- // --- Rules ---
19
- function countRules() {
20
- const { allRules } = require(path.join(ROOT, 'src', 'rules'));
21
- return allRules().length;
22
- }
23
-
24
- // --- MCP Tools ---
25
- // Statically count tool registrations in mcp-server.js (can't require it
26
- // directly — it starts an MCP server on load).
27
- function countMcpTools() {
28
- const code = fs.readFileSync(path.join(ROOT, 'src', 'mcp-server.js'), 'utf8');
29
- const matches = [...code.matchAll(/name:\s*['"]([a-z_]+)['"]/g)].map((m) => m[1]);
30
- const tools = matches.filter((n) => n !== 'vibeguard');
31
- const unique = [...new Set(tools)];
32
- return unique.length;
33
- }
34
-
35
- // --- Defense Layers ---
36
- // Counted from the pre-deploy gates in src/pre-deploy.js (the canonical list).
37
- function countLayers() {
38
- // Count from pre-deploy.js GATES array — no git needed.
39
- try {
40
- const src = fs.readFileSync(path.join(ROOT, 'src', 'pre-deploy.js'), 'utf8');
41
- const match = src.match(/const GATES\s*=\s*\[([\s\S]*?)\]/);
42
- if (match) {
43
- const ids = match[1].match(/id:\s*'[^']+'/g);
44
- if (ids) return ids.length;
45
- }
46
- } catch {}
47
- return 13;
48
- }
49
-
50
- function getCounts() {
51
- return {
52
- rules: countRules(),
53
- mcpTools: countMcpTools(),
54
- layers: countLayers(),
55
- };
56
- }
57
-
58
- // --- README update ---
59
- function updateReadme(counts) {
60
- const readmePath = path.join(ROOT, 'README.md');
61
- let content = fs.readFileSync(readmePath, 'utf8');
62
- const startMarker = '<!-- COUNTS:START -->';
63
- const endMarker = '<!-- COUNTS:END -->';
64
-
65
- const block = [
66
- startMarker,
67
- `<!-- Auto-generated by scripts/counts.js — do not edit manually -->`,
68
- `<!-- Rules: ${counts.rules} | MCP Tools: ${counts.mcpTools} | Defense Layers: ${counts.layers} -->`,
69
- endMarker,
70
- ].join('\n');
71
-
72
- const startIdx = content.indexOf(startMarker);
73
- const endIdx = content.indexOf(endMarker);
74
-
75
- if (startIdx !== -1 && endIdx !== -1) {
76
- content = content.slice(0, startIdx) + block + content.slice(endIdx + endMarker.length);
77
- } else {
78
- // No markers yet — append before the closing </div> at the end.
79
- content = content.trimEnd() + '\n\n' + block + '\n';
80
- }
81
-
82
- fs.writeFileSync(readmePath, content);
83
- }
84
-
85
- // --- CLI ---
86
- const args = process.argv.slice(2);
87
- const counts = getCounts();
88
-
89
- if (args.includes('--update-readme')) {
90
- updateReadme(counts);
91
- console.error('Updated README.md with counts block.');
92
- }
93
-
1
+ 'use strict';
2
+
3
+ /*
4
+ * scripts/counts.js — generates live counts of rules, MCP tools, and defense
5
+ * layers from the source. Used to keep README.md and package.json numbers
6
+ * from drifting. Run: `npm run counts`.
7
+ *
8
+ * Output: JSON to stdout: { rules, mcpTools, layers }
9
+ * Also writes a README block between <!-- COUNTS:START --> and <!-- COUNTS:END -->
10
+ * markers if --update-readme is passed.
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+
16
+ const ROOT = path.resolve(__dirname, '..');
17
+
18
+ // --- Rules ---
19
+ function countRules() {
20
+ const { allRules } = require(path.join(ROOT, 'src', 'rules'));
21
+ return allRules().length;
22
+ }
23
+
24
+ // --- MCP Tools ---
25
+ // Statically count tool registrations in mcp-server.js (can't require it
26
+ // directly — it starts an MCP server on load).
27
+ function countMcpTools() {
28
+ const code = fs.readFileSync(path.join(ROOT, 'src', 'mcp-server.js'), 'utf8');
29
+ const matches = [...code.matchAll(/name:\s*['"]([a-z_]+)['"]/g)].map((m) => m[1]);
30
+ const tools = matches.filter((n) => n !== 'vibeguard');
31
+ const unique = [...new Set(tools)];
32
+ return unique.length;
33
+ }
34
+
35
+ // --- Defense Layers ---
36
+ // Counted from the pre-deploy gates in src/pre-deploy.js (the canonical list).
37
+ function countLayers() {
38
+ // Count from pre-deploy.js GATES array — no git needed.
39
+ try {
40
+ const src = fs.readFileSync(path.join(ROOT, 'src', 'pre-deploy.js'), 'utf8');
41
+ const match = src.match(/const GATES\s*=\s*\[([\s\S]*?)\]/);
42
+ if (match) {
43
+ const ids = match[1].match(/id:\s*'[^']+'/g);
44
+ if (ids) return ids.length;
45
+ }
46
+ } catch {}
47
+ return 13;
48
+ }
49
+
50
+ function getCounts() {
51
+ return {
52
+ rules: countRules(),
53
+ mcpTools: countMcpTools(),
54
+ layers: countLayers(),
55
+ };
56
+ }
57
+
58
+ // --- README update ---
59
+ function updateReadme(counts) {
60
+ const readmePath = path.join(ROOT, 'README.md');
61
+ let content = fs.readFileSync(readmePath, 'utf8');
62
+ const startMarker = '<!-- COUNTS:START -->';
63
+ const endMarker = '<!-- COUNTS:END -->';
64
+
65
+ const block = [
66
+ startMarker,
67
+ `<!-- Auto-generated by scripts/counts.js — do not edit manually -->`,
68
+ `<!-- Rules: ${counts.rules} | MCP Tools: ${counts.mcpTools} | Defense Layers: ${counts.layers} -->`,
69
+ endMarker,
70
+ ].join('\n');
71
+
72
+ const startIdx = content.indexOf(startMarker);
73
+ const endIdx = content.indexOf(endMarker);
74
+
75
+ if (startIdx !== -1 && endIdx !== -1) {
76
+ content = content.slice(0, startIdx) + block + content.slice(endIdx + endMarker.length);
77
+ } else {
78
+ // No markers yet — append before the closing </div> at the end.
79
+ content = content.trimEnd() + '\n\n' + block + '\n';
80
+ }
81
+
82
+ fs.writeFileSync(readmePath, content);
83
+ }
84
+
85
+ // --- CLI ---
86
+ const args = process.argv.slice(2);
87
+ const counts = getCounts();
88
+
89
+ if (args.includes('--update-readme')) {
90
+ updateReadme(counts);
91
+ console.error('Updated README.md with counts block.');
92
+ }
93
+
94
94
  console.log(JSON.stringify(counts, null, 2));
@@ -1,27 +1,27 @@
1
- 'use strict';
2
-
3
- // scripts/postinstall.js — runs after npm install.
4
- // Prints a one-line suggestion. NEVER modifies shell profiles or any file
5
- // outside the installed package. A security tool that silently edits user
6
- // files is doing the thing it warns about.
7
-
8
- try {
9
- // Opt-out + CI quiet: a security tool should not add install-time noise or
10
- // surprise. VIBEGUARD_NO_POSTINSTALL=1 silences this entirely.
11
- if (process.env.VIBEGUARD_NO_POSTINSTALL === '1' || process.env.CI) {
12
- process.exit(0);
13
- }
14
-
15
- const path = require('path');
16
- const fs = require('fs');
17
-
18
- const cliPath = path.join(__dirname, '..', 'bin', 'cli.js');
19
- if (!fs.existsSync(cliPath)) {
20
- process.exit(0);
21
- }
22
-
23
- process.stderr.write('\n VibeGuard installed. Run "vibeguard auto" to enable layered protection.\n\n');
24
- process.exit(0);
25
- } catch {
26
- process.exit(0);
1
+ 'use strict';
2
+
3
+ // scripts/postinstall.js — runs after npm install.
4
+ // Prints a one-line suggestion. NEVER modifies shell profiles or any file
5
+ // outside the installed package. A security tool that silently edits user
6
+ // files is doing the thing it warns about.
7
+
8
+ try {
9
+ // Opt-out + CI quiet: a security tool should not add install-time noise or
10
+ // surprise. VIBEGUARD_NO_POSTINSTALL=1 silences this entirely.
11
+ if (process.env.VIBEGUARD_NO_POSTINSTALL === '1' || process.env.CI) {
12
+ process.exit(0);
13
+ }
14
+
15
+ const path = require('path');
16
+ const fs = require('fs');
17
+
18
+ const cliPath = path.join(__dirname, '..', 'bin', 'cli.js');
19
+ if (!fs.existsSync(cliPath)) {
20
+ process.exit(0);
21
+ }
22
+
23
+ process.stderr.write('\n VibeGuard installed. Run "vibeguard auto" to enable layered protection.\n\n');
24
+ process.exit(0);
25
+ } catch {
26
+ process.exit(0);
27
27
  }