guardvibe 1.5.0 → 1.6.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.
- package/README.md +4 -4
- package/build/cli.d.ts +0 -1
- package/build/cli.js +0 -1
- package/build/data/compliance-metadata.d.ts +0 -1
- package/build/data/compliance-metadata.js +0 -1
- package/build/data/framework-guides.d.ts +0 -1
- package/build/data/framework-guides.js +0 -1
- package/build/data/rules/ai-security.d.ts +0 -1
- package/build/data/rules/ai-security.js +0 -1
- package/build/data/rules/api-security.d.ts +0 -1
- package/build/data/rules/api-security.js +0 -1
- package/build/data/rules/auth.d.ts +0 -1
- package/build/data/rules/auth.js +1 -1
- package/build/data/rules/cicd.d.ts +0 -1
- package/build/data/rules/cicd.js +0 -1
- package/build/data/rules/core.d.ts +0 -1
- package/build/data/rules/core.js +0 -1
- package/build/data/rules/cve-versions.d.ts +0 -1
- package/build/data/rules/cve-versions.js +0 -1
- package/build/data/rules/database.d.ts +0 -1
- package/build/data/rules/database.js +0 -1
- package/build/data/rules/deployment.d.ts +0 -1
- package/build/data/rules/deployment.js +0 -1
- package/build/data/rules/dockerfile.d.ts +0 -1
- package/build/data/rules/dockerfile.js +0 -1
- package/build/data/rules/firebase.d.ts +0 -1
- package/build/data/rules/firebase.js +1 -1
- package/build/data/rules/go.d.ts +0 -1
- package/build/data/rules/go.js +0 -1
- package/build/data/rules/index.d.ts +0 -1
- package/build/data/rules/index.js +0 -1
- package/build/data/rules/modern-stack.d.ts +0 -1
- package/build/data/rules/modern-stack.js +0 -1
- package/build/data/rules/nextjs.d.ts +0 -1
- package/build/data/rules/nextjs.js +0 -1
- package/build/data/rules/other-services.d.ts +0 -1
- package/build/data/rules/other-services.js +0 -1
- package/build/data/rules/payments.d.ts +0 -1
- package/build/data/rules/payments.js +0 -1
- package/build/data/rules/react-native.d.ts +0 -1
- package/build/data/rules/react-native.js +0 -1
- package/build/data/rules/services.d.ts +0 -1
- package/build/data/rules/services.js +0 -1
- package/build/data/rules/shell.d.ts +0 -1
- package/build/data/rules/shell.js +0 -1
- package/build/data/rules/sql.d.ts +0 -1
- package/build/data/rules/sql.js +0 -1
- package/build/data/rules/supply-chain.d.ts +0 -1
- package/build/data/rules/supply-chain.js +48 -1
- package/build/data/rules/terraform.d.ts +0 -1
- package/build/data/rules/terraform.js +0 -1
- package/build/data/rules/types.d.ts +0 -1
- package/build/data/rules/types.js +0 -1
- package/build/data/rules/web-security.d.ts +0 -1
- package/build/data/rules/web-security.js +0 -1
- package/build/data/secret-patterns.d.ts +0 -1
- package/build/data/secret-patterns.js +0 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +43 -2
- package/build/plugins/loader.d.ts +0 -1
- package/build/plugins/loader.js +0 -1
- package/build/plugins/types.d.ts +0 -1
- package/build/plugins/types.js +0 -1
- package/build/tools/audit-config.d.ts +0 -1
- package/build/tools/audit-config.js +0 -1
- package/build/tools/check-code.d.ts +0 -1
- package/build/tools/check-code.js +0 -1
- package/build/tools/check-command.d.ts +12 -0
- package/build/tools/check-command.js +226 -0
- package/build/tools/check-deps.d.ts +0 -1
- package/build/tools/check-deps.js +0 -1
- package/build/tools/check-package-health.d.ts +0 -1
- package/build/tools/check-package-health.js +0 -1
- package/build/tools/check-project.d.ts +0 -1
- package/build/tools/check-project.js +0 -1
- package/build/tools/compliance-report.d.ts +0 -1
- package/build/tools/compliance-report.js +0 -1
- package/build/tools/explain-remediation.d.ts +14 -0
- package/build/tools/explain-remediation.js +102 -0
- package/build/tools/export-sarif.d.ts +0 -1
- package/build/tools/export-sarif.js +0 -1
- package/build/tools/fix-code.d.ts +0 -1
- package/build/tools/fix-code.js +143 -52
- package/build/tools/generate-policy.d.ts +0 -1
- package/build/tools/generate-policy.js +0 -1
- package/build/tools/get-security-docs.d.ts +0 -1
- package/build/tools/get-security-docs.js +0 -1
- package/build/tools/policy-check.d.ts +0 -1
- package/build/tools/policy-check.js +0 -1
- package/build/tools/repo-posture.d.ts +1 -0
- package/build/tools/repo-posture.js +177 -0
- package/build/tools/review-pr.d.ts +0 -1
- package/build/tools/review-pr.js +50 -2
- package/build/tools/scan-config-change.d.ts +11 -0
- package/build/tools/scan-config-change.js +87 -0
- package/build/tools/scan-dependencies.d.ts +0 -1
- package/build/tools/scan-dependencies.js +0 -1
- package/build/tools/scan-directory.d.ts +0 -1
- package/build/tools/scan-directory.js +0 -1
- package/build/tools/scan-secrets-history.d.ts +0 -1
- package/build/tools/scan-secrets-history.js +0 -1
- package/build/tools/scan-secrets.d.ts +0 -1
- package/build/tools/scan-secrets.js +0 -1
- package/build/tools/scan-staged.d.ts +0 -1
- package/build/tools/scan-staged.js +0 -1
- package/build/tools/taint-analysis.d.ts +0 -1
- package/build/tools/taint-analysis.js +0 -1
- package/build/utils/config.d.ts +0 -1
- package/build/utils/config.js +0 -1
- package/build/utils/manifest-parser.d.ts +0 -1
- package/build/utils/manifest-parser.js +0 -1
- package/build/utils/osv-client.d.ts +0 -1
- package/build/utils/osv-client.js +0 -1
- package/build/utils/typosquat.d.ts +0 -1
- package/build/utils/typosquat.js +0 -1
- package/package.json +2 -2
- package/build/cli.d.ts.map +0 -1
- package/build/cli.js.map +0 -1
- package/build/data/compliance-metadata.d.ts.map +0 -1
- package/build/data/compliance-metadata.js.map +0 -1
- package/build/data/framework-guides.d.ts.map +0 -1
- package/build/data/framework-guides.js.map +0 -1
- package/build/data/rules/ai-security.d.ts.map +0 -1
- package/build/data/rules/ai-security.js.map +0 -1
- package/build/data/rules/api-security.d.ts.map +0 -1
- package/build/data/rules/api-security.js.map +0 -1
- package/build/data/rules/auth.d.ts.map +0 -1
- package/build/data/rules/auth.js.map +0 -1
- package/build/data/rules/cicd.d.ts.map +0 -1
- package/build/data/rules/cicd.js.map +0 -1
- package/build/data/rules/core.d.ts.map +0 -1
- package/build/data/rules/core.js.map +0 -1
- package/build/data/rules/cve-versions.d.ts.map +0 -1
- package/build/data/rules/cve-versions.js.map +0 -1
- package/build/data/rules/database.d.ts.map +0 -1
- package/build/data/rules/database.js.map +0 -1
- package/build/data/rules/deployment.d.ts.map +0 -1
- package/build/data/rules/deployment.js.map +0 -1
- package/build/data/rules/dockerfile.d.ts.map +0 -1
- package/build/data/rules/dockerfile.js.map +0 -1
- package/build/data/rules/firebase.d.ts.map +0 -1
- package/build/data/rules/firebase.js.map +0 -1
- package/build/data/rules/go.d.ts.map +0 -1
- package/build/data/rules/go.js.map +0 -1
- package/build/data/rules/index.d.ts.map +0 -1
- package/build/data/rules/index.js.map +0 -1
- package/build/data/rules/modern-stack.d.ts.map +0 -1
- package/build/data/rules/modern-stack.js.map +0 -1
- package/build/data/rules/nextjs.d.ts.map +0 -1
- package/build/data/rules/nextjs.js.map +0 -1
- package/build/data/rules/other-services.d.ts.map +0 -1
- package/build/data/rules/other-services.js.map +0 -1
- package/build/data/rules/payments.d.ts.map +0 -1
- package/build/data/rules/payments.js.map +0 -1
- package/build/data/rules/react-native.d.ts.map +0 -1
- package/build/data/rules/react-native.js.map +0 -1
- package/build/data/rules/services.d.ts.map +0 -1
- package/build/data/rules/services.js.map +0 -1
- package/build/data/rules/shell.d.ts.map +0 -1
- package/build/data/rules/shell.js.map +0 -1
- package/build/data/rules/sql.d.ts.map +0 -1
- package/build/data/rules/sql.js.map +0 -1
- package/build/data/rules/supply-chain.d.ts.map +0 -1
- package/build/data/rules/supply-chain.js.map +0 -1
- package/build/data/rules/terraform.d.ts.map +0 -1
- package/build/data/rules/terraform.js.map +0 -1
- package/build/data/rules/types.d.ts.map +0 -1
- package/build/data/rules/types.js.map +0 -1
- package/build/data/rules/web-security.d.ts.map +0 -1
- package/build/data/rules/web-security.js.map +0 -1
- package/build/data/secret-patterns.d.ts.map +0 -1
- package/build/data/secret-patterns.js.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/build/plugins/loader.d.ts.map +0 -1
- package/build/plugins/loader.js.map +0 -1
- package/build/plugins/types.d.ts.map +0 -1
- package/build/plugins/types.js.map +0 -1
- package/build/tools/audit-config.d.ts.map +0 -1
- package/build/tools/audit-config.js.map +0 -1
- package/build/tools/check-code.d.ts.map +0 -1
- package/build/tools/check-code.js.map +0 -1
- package/build/tools/check-deps.d.ts.map +0 -1
- package/build/tools/check-deps.js.map +0 -1
- package/build/tools/check-package-health.d.ts.map +0 -1
- package/build/tools/check-package-health.js.map +0 -1
- package/build/tools/check-project.d.ts.map +0 -1
- package/build/tools/check-project.js.map +0 -1
- package/build/tools/compliance-report.d.ts.map +0 -1
- package/build/tools/compliance-report.js.map +0 -1
- package/build/tools/export-sarif.d.ts.map +0 -1
- package/build/tools/export-sarif.js.map +0 -1
- package/build/tools/fix-code.d.ts.map +0 -1
- package/build/tools/fix-code.js.map +0 -1
- package/build/tools/generate-policy.d.ts.map +0 -1
- package/build/tools/generate-policy.js.map +0 -1
- package/build/tools/get-security-docs.d.ts.map +0 -1
- package/build/tools/get-security-docs.js.map +0 -1
- package/build/tools/policy-check.d.ts.map +0 -1
- package/build/tools/policy-check.js.map +0 -1
- package/build/tools/review-pr.d.ts.map +0 -1
- package/build/tools/review-pr.js.map +0 -1
- package/build/tools/scan-dependencies.d.ts.map +0 -1
- package/build/tools/scan-dependencies.js.map +0 -1
- package/build/tools/scan-directory.d.ts.map +0 -1
- package/build/tools/scan-directory.js.map +0 -1
- package/build/tools/scan-secrets-history.d.ts.map +0 -1
- package/build/tools/scan-secrets-history.js.map +0 -1
- package/build/tools/scan-secrets.d.ts.map +0 -1
- package/build/tools/scan-secrets.js.map +0 -1
- package/build/tools/scan-staged.d.ts.map +0 -1
- package/build/tools/scan-staged.js.map +0 -1
- package/build/tools/taint-analysis.d.ts.map +0 -1
- package/build/tools/taint-analysis.js.map +0 -1
- package/build/utils/config.d.ts.map +0 -1
- package/build/utils/config.js.map +0 -1
- package/build/utils/manifest-parser.d.ts.map +0 -1
- package/build/utils/manifest-parser.js.map +0 -1
- package/build/utils/osv-client.d.ts.map +0 -1
- package/build/utils/osv-client.js.map +0 -1
- package/build/utils/typosquat.d.ts.map +0 -1
- package/build/utils/typosquat.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GuardVibe
|
|
2
2
|
|
|
3
|
-
**The security MCP built for vibe coding.**
|
|
3
|
+
**The security MCP built for vibe coding.** 243 security rules covering the entire AI-generated code journey — from first line to production deployment.
|
|
4
4
|
|
|
5
5
|
Works with **Claude Code, Cursor, Gemini CLI, Codex, Windsurf**, and any MCP-compatible coding agent.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ Works with **Claude Code, Cursor, Gemini CLI, Codex, Windsurf**, and any MCP-com
|
|
|
8
8
|
|
|
9
9
|
Most security tools are built for enterprise security teams. GuardVibe is built for **you** — the developer using AI to build and ship web apps fast.
|
|
10
10
|
|
|
11
|
-
- **
|
|
11
|
+
- **243 security rules** purpose-built for the stacks AI agents generate
|
|
12
12
|
- **Zero setup friction** — `npx guardvibe` and you're scanning
|
|
13
13
|
- **No account required** — runs 100% locally, no API keys, no cloud
|
|
14
14
|
- **Understands your stack** — not generic SAST, but rules that know Next.js, Supabase, Stripe, Clerk, and the tools you actually use
|
|
@@ -34,7 +34,7 @@ GuardVibe is purpose-built for the AI coding workflow. Traditional tools are exc
|
|
|
34
34
|
| CVE version detection | 21 packages | Extensive | Extensive |
|
|
35
35
|
| Compliance mapping (SOC2, PCI-DSS, HIPAA) | Built-in | Paid tier | None |
|
|
36
36
|
| SARIF CI/CD export | Yes | Yes | Limited |
|
|
37
|
-
| Rule count |
|
|
37
|
+
| Rule count | 243 (focused) | 5000+ (broad) | N/A |
|
|
38
38
|
|
|
39
39
|
**When to use GuardVibe:** You're building with AI agents and want security scanning integrated into your coding workflow — no dashboard, no account, no CI setup.
|
|
40
40
|
|
|
@@ -146,7 +146,7 @@ Malicious postinstall scripts, unpinned GitHub Actions, typosquat detection
|
|
|
146
146
|
|
|
147
147
|
All scanning tools support `format: "json"` for machine-readable output.
|
|
148
148
|
|
|
149
|
-
## Security Rules (
|
|
149
|
+
## Security Rules (243 rules across 23 modules)
|
|
150
150
|
|
|
151
151
|
| Category | Rules | Coverage |
|
|
152
152
|
|----------|-------|----------|
|
package/build/cli.d.ts
CHANGED
package/build/cli.js
CHANGED
package/build/data/rules/auth.js
CHANGED
|
@@ -170,6 +170,7 @@ export const authRules = [
|
|
|
170
170
|
pattern: /(?:signInWithPassword|signUp)[\s\S]{0,200}?(?:searchParams|query|req\.query|params)[\s\S]{0,100}?password/gi,
|
|
171
171
|
languages: ["javascript", "typescript"],
|
|
172
172
|
fix: "Always send passwords via POST request body, never in URL parameters.",
|
|
173
|
+
fixCode: '// Send password in request body, not URL:\nconst { data } = await supabase.auth.signInWithPassword({\n email,\n password, // from form body, not URL params\n});',
|
|
173
174
|
compliance: ["SOC2:CC6.1", "PCI-DSS:Req8"],
|
|
174
175
|
},
|
|
175
176
|
{
|
|
@@ -197,4 +198,3 @@ export const authRules = [
|
|
|
197
198
|
compliance: ["SOC2:CC6.6"],
|
|
198
199
|
},
|
|
199
200
|
];
|
|
200
|
-
//# sourceMappingURL=auth.js.map
|
package/build/data/rules/cicd.js
CHANGED
package/build/data/rules/core.js
CHANGED
|
@@ -68,6 +68,7 @@ export const firebaseRules = [
|
|
|
68
68
|
pattern: /NEXT_PUBLIC_\w*(?:FIREBASE_SERVICE_ACCOUNT|FIREBASE_ADMIN|FIREBASE_PRIVATE|FIREBASE_SECRET)\w*\s*=/gi,
|
|
69
69
|
languages: ["javascript", "typescript", "shell"],
|
|
70
70
|
fix: "Remove NEXT_PUBLIC_ prefix from Firebase admin/service account credentials. These must be server-side only.",
|
|
71
|
+
fixCode: "# .env.local — WRONG\n# NEXT_PUBLIC_FIREBASE_SERVICE_ACCOUNT=...\n\n# CORRECT — server-side only\nFIREBASE_SERVICE_ACCOUNT=...\n# Use in API routes: admin.initializeApp({ credential: cert(JSON.parse(process.env.FIREBASE_SERVICE_ACCOUNT!)) })",
|
|
71
72
|
compliance: ["SOC2:CC6.1"],
|
|
72
73
|
},
|
|
73
74
|
{
|
|
@@ -83,4 +84,3 @@ export const firebaseRules = [
|
|
|
83
84
|
compliance: ["SOC2:CC6.1"],
|
|
84
85
|
},
|
|
85
86
|
];
|
|
86
|
-
//# sourceMappingURL=firebase.js.map
|
package/build/data/rules/go.d.ts
CHANGED
package/build/data/rules/go.js
CHANGED
package/build/data/rules/sql.js
CHANGED
|
@@ -24,5 +24,52 @@ export const supplyChainRules = [
|
|
|
24
24
|
fixCode: "- uses: actions/checkout@v4\n with:\n persist-credentials: false",
|
|
25
25
|
compliance: ["SOC2:CC6.1"],
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
id: "VG862",
|
|
29
|
+
name: "Source Map Publish Risk",
|
|
30
|
+
severity: "critical",
|
|
31
|
+
owasp: "A05:2021 Security Misconfiguration",
|
|
32
|
+
description: 'Source map files (.map) expose original source code when published to npm. Anthropic\'s Claude Code source leak (March 2026) was caused by this exact misconfiguration. If tsconfig enables sourceMap and the package lacks .npmignore exclusions, your entire codebase ships to the registry.',
|
|
33
|
+
pattern: /"sourceMap"\s*:\s*true/g,
|
|
34
|
+
languages: ["json"],
|
|
35
|
+
fix: 'Set "sourceMap": false in tsconfig.json for production builds, or add *.map to .npmignore to prevent source maps from being published.',
|
|
36
|
+
fixCode: '// tsconfig.json — disable source maps for published packages\n{\n "compilerOptions": {\n "sourceMap": false,\n "declarationMap": false\n }\n}\n\n// Or add to .npmignore:\n// *.map',
|
|
37
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req6.5.10"],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "VG863",
|
|
41
|
+
name: 'package.json Missing "files" Field',
|
|
42
|
+
severity: "high",
|
|
43
|
+
owasp: "A05:2021 Security Misconfiguration",
|
|
44
|
+
description: 'A publishable npm package without a "files" field in package.json publishes the entire project directory — including src/, .env, test fixtures, and internal configs. Always use "files" to whitelist only build output.',
|
|
45
|
+
pattern: /"version"\s*:\s*"[^"]*"(?![\s\S]*"files"\s*:)(?![\s\S]*"private"\s*:\s*true)/g,
|
|
46
|
+
languages: ["json"],
|
|
47
|
+
fix: 'Add a "files" field to package.json listing only the directories and files needed by consumers (e.g., dist/, build/).',
|
|
48
|
+
fixCode: '// package.json — whitelist published files\n{\n "name": "my-package",\n "version": "1.0.0",\n "files": [\n "dist",\n "build",\n "README.md"\n ]\n}',
|
|
49
|
+
compliance: ["SOC2:CC6.1"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "VG864",
|
|
53
|
+
name: '"files" Field Includes Source Code',
|
|
54
|
+
severity: "high",
|
|
55
|
+
owasp: "A05:2021 Security Misconfiguration",
|
|
56
|
+
description: 'The "files" field in package.json includes source directories ("src", ".", or "**"). This publishes raw source code to npm, defeating the purpose of the whitelist. Only compiled output should be listed.',
|
|
57
|
+
pattern: /"files"\s*:\s*\[[^\]]*(?:"src"|"\.\/?"|"\*\*")[^\]]*\]/g,
|
|
58
|
+
languages: ["json"],
|
|
59
|
+
fix: 'Remove "src", ".", and "**" from the "files" array. Only include compiled output directories like "dist" or "build".',
|
|
60
|
+
fixCode: '// BAD — leaks source code\n// "files": ["src", "dist"]\n\n// GOOD — only build output\n{\n "files": [\n "dist",\n "build"\n ]\n}',
|
|
61
|
+
compliance: ["SOC2:CC6.1", "PCI-DSS:Req6.5.10"],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "VG865",
|
|
65
|
+
name: ".npmignore Missing Sensitive File Patterns",
|
|
66
|
+
severity: "medium",
|
|
67
|
+
owasp: "A05:2021 Security Misconfiguration",
|
|
68
|
+
description: ".npmignore exists but does not exclude common sensitive files (*.map, .env, src/). Without these exclusions, source maps, environment secrets, and raw source code can leak into the published package.",
|
|
69
|
+
pattern: /^(?![\s\S]*\*\.map)(?![\s\S]*\.env)(?![\s\S]*src\/).+/gm,
|
|
70
|
+
languages: ["shell"],
|
|
71
|
+
fix: "Add *.map, .env*, src/, and tests/ to .npmignore to prevent accidental publish of sensitive files.",
|
|
72
|
+
fixCode: "# .npmignore — exclude sensitive files from npm publish\n*.map\n.env\n.env.*\nsrc/\ntests/\n__tests__/\n*.test.*\n*.spec.*\ntsconfig*.json\n.github/",
|
|
73
|
+
compliance: ["SOC2:CC6.1"],
|
|
74
|
+
},
|
|
27
75
|
];
|
|
28
|
-
//# sourceMappingURL=supply-chain.js.map
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -20,12 +20,16 @@ import { reviewPr } from "./tools/review-pr.js";
|
|
|
20
20
|
import { scanSecretsHistory } from "./tools/scan-secrets-history.js";
|
|
21
21
|
import { policyCheck } from "./tools/policy-check.js";
|
|
22
22
|
import { analyzeTaint, formatTaintFindings } from "./tools/taint-analysis.js";
|
|
23
|
+
import { checkCommand } from "./tools/check-command.js";
|
|
24
|
+
import { scanConfigChange } from "./tools/scan-config-change.js";
|
|
25
|
+
import { repoSecurityPosture } from "./tools/repo-posture.js";
|
|
26
|
+
import { explainRemediation } from "./tools/explain-remediation.js";
|
|
23
27
|
import { discoverPlugins } from "./plugins/loader.js";
|
|
24
28
|
import { builtinRules } from "./data/rules/index.js";
|
|
25
29
|
import { loadConfig } from "./utils/config.js";
|
|
26
30
|
const server = new McpServer({
|
|
27
31
|
name: "guardvibe",
|
|
28
|
-
version: "1.
|
|
32
|
+
version: "1.6.0",
|
|
29
33
|
});
|
|
30
34
|
// Tool 1: Analyze code for security vulnerabilities
|
|
31
35
|
server.tool("check_code", "Analyze code for security vulnerabilities (OWASP Top 10, XSS, SQL injection, insecure patterns). Use this when reviewing or writing code to catch security issues early.", {
|
|
@@ -242,6 +246,44 @@ server.tool("analyze_dataflow", "Track user input (request body, URL params, for
|
|
|
242
246
|
const results = formatTaintFindings(findings, format);
|
|
243
247
|
return { content: [{ type: "text", text: results }] };
|
|
244
248
|
});
|
|
249
|
+
// Tool 19: Shell Command Risk Analyzer
|
|
250
|
+
server.tool("check_command", "Analyze a shell command for security risks before execution. Returns allow/ask/deny verdict with blast radius, safer alternatives, and context-aware risk assessment. Detects: destructive ops, git history rewrites, secret exposure, data exfiltration, deploy triggers, privilege escalation, database drops.", {
|
|
251
|
+
command: z.string().describe("Shell command to analyze"),
|
|
252
|
+
cwd: z.string().default(".").describe("Current working directory"),
|
|
253
|
+
branch: z.string().optional().describe("Current git branch (for branch-specific risk)"),
|
|
254
|
+
format: z.enum(["markdown", "json"]).default("json").describe("Output format"),
|
|
255
|
+
}, async ({ command, cwd, branch, format }) => {
|
|
256
|
+
const results = checkCommand(command, cwd, branch, format);
|
|
257
|
+
return { content: [{ type: "text", text: results }] };
|
|
258
|
+
});
|
|
259
|
+
// Tool 20: Config Change Security Analyzer
|
|
260
|
+
server.tool("scan_config_change", "Compare before/after versions of a config file to detect security downgrades: CORS relaxation, CSP weakening, HSTS removal, debug mode, cookie flag changes, TLS disabling, new hardcoded secrets, removed security headers.", {
|
|
261
|
+
before: z.string().describe("Previous config file content"),
|
|
262
|
+
after: z.string().describe("New config file content"),
|
|
263
|
+
file_path: z.string().default("config").describe("Config file path for context"),
|
|
264
|
+
format: z.enum(["markdown", "json"]).default("json").describe("Output format"),
|
|
265
|
+
}, async ({ before, after, file_path, format }) => {
|
|
266
|
+
const results = scanConfigChange(before, after, file_path, format);
|
|
267
|
+
return { content: [{ type: "text", text: results }] };
|
|
268
|
+
});
|
|
269
|
+
// Tool 21: Repository Security Posture
|
|
270
|
+
server.tool("repo_security_posture", "Analyze a repository's overall security posture. Maps sensitive areas (auth, payments, PII, admin, API, infrastructure), identifies high-risk workflows, recommends guard mode, and lists priority fixes.", {
|
|
271
|
+
path: z.string().describe("Repository root path"),
|
|
272
|
+
format: z.enum(["markdown", "json"]).default("markdown").describe("Output format"),
|
|
273
|
+
}, async ({ path, format }) => {
|
|
274
|
+
const results = repoSecurityPosture(path, format);
|
|
275
|
+
return { content: [{ type: "text", text: results }] };
|
|
276
|
+
});
|
|
277
|
+
// Tool 22: Explain Remediation
|
|
278
|
+
server.tool("explain_remediation", "Deep explanation of a security finding: why it's risky, real-world impact, exploit scenario, minimum fix, secure alternative, breaking risk assessment, and test strategy. Helps agents apply fixes correctly.", {
|
|
279
|
+
rule_id: z.string().describe("GuardVibe rule ID (e.g. VG001, VG402)"),
|
|
280
|
+
code: z.string().optional().describe("Affected code snippet for context"),
|
|
281
|
+
format: z.enum(["markdown", "json"]).default("markdown").describe("Output format"),
|
|
282
|
+
}, async ({ rule_id, code, format }) => {
|
|
283
|
+
const rules = globalThis.__guardvibe_rules;
|
|
284
|
+
const results = explainRemediation(rule_id, code, format, rules);
|
|
285
|
+
return { content: [{ type: "text", text: results }] };
|
|
286
|
+
});
|
|
245
287
|
async function main() {
|
|
246
288
|
// Load plugins
|
|
247
289
|
const config = loadConfig(process.cwd());
|
|
@@ -271,4 +313,3 @@ main().catch((error) => {
|
|
|
271
313
|
console.error("Fatal error:", error);
|
|
272
314
|
process.exit(1);
|
|
273
315
|
});
|
|
274
|
-
//# sourceMappingURL=index.js.map
|
package/build/plugins/loader.js
CHANGED
package/build/plugins/types.d.ts
CHANGED
package/build/plugins/types.js
CHANGED
|
@@ -7,4 +7,3 @@ export interface Finding {
|
|
|
7
7
|
export declare function analyzeCode(code: string, language: string, framework?: string, filePath?: string, configDir?: string, rules?: SecurityRule[]): Finding[];
|
|
8
8
|
export declare function formatFindingsJson(findings: Finding[], extra?: Record<string, unknown>): string;
|
|
9
9
|
export declare function checkCode(code: string, language: string, framework?: string, filePath?: string, configDir?: string, format?: "markdown" | "json", rules?: SecurityRule[]): string;
|
|
10
|
-
//# sourceMappingURL=check-code.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CommandVerdict {
|
|
2
|
+
verdict: "allow" | "ask" | "deny";
|
|
3
|
+
risk: "critical" | "high" | "medium" | "low" | "none";
|
|
4
|
+
confidence: number;
|
|
5
|
+
category: string;
|
|
6
|
+
reason: string;
|
|
7
|
+
blastRadius: string;
|
|
8
|
+
saferAlternative?: string;
|
|
9
|
+
confirmationText?: string;
|
|
10
|
+
details: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function checkCommand(command: string, cwd?: string, branch?: string, format?: "markdown" | "json"): string;
|