by avivgerz-hue
92-rule static security scanner (SAST), secret detector, Supabase RLS auditor & SKILL.md prompt-injection guard for AI-generated Next.js/TypeScript apps. CLI & MCP server.
# Add to your Claude Code skills
git clone https://github.com/avivgerz-hue/vibe-shieldGuides for using mcp servers skills like vibe-shield.
See how vibe-shield compares with popular alternatives.
vibe-shield is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by avivgerz-hue. 92-rule static security scanner (SAST), secret detector, Supabase RLS auditor & SKILL.md prompt-injection guard for AI-generated Next.js/TypeScript apps. CLI & MCP server. It has 56 GitHub stars.
vibe-shield's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/avivgerz-hue/vibe-shield" and add it to your Claude Code skills directory (see the Installation section above). vibe-shield ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
vibe-shield is primarily written in TypeScript. It is open-source under avivgerz-hue on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh vibe-shield against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Work only within the authorized project. Static findings are evidence for review, not proof of exploitability or a guarantee of safety. Do not transmit source code or secrets. Ask before changing production services, rotating credentials, or making destructive changes.
Map entrypoints and trust boundaries: API methods, authentication and authorization, middleware matchers, database tables and policies, storage, LLM inputs and tools, webhooks, and agent/MCP configuration. Check deployment configuration and exclusions. Identify what the scanner cannot see.
npx -y @vibefoundry/vibe-shield scan . --format json
npx -y @vibefoundry/vibe-shield audit-skills . --format json
Inspect findings, inventory, ignored paths, and the files scanned. The explicit . includes test and documentation files: review fixtures as examples rather than blindly changing them. Use explain <RULE_ID> to investigate a rule. These commands run locally; first-time installation with npx requires registry access.
Trace untrusted input through authentication, ownership checks and tenant boundaries to database, filesystem, network, HTML, and LLM sinks. Inspect IDOR, business-logic bypasses, webhook signature verification and asynchronous jobs. Check cross-file guards and deployed database policies; absence of a static finding is not evidence of protection.
Adapt the table, owner column, and policy names to your schema. First inspect all existing policies: permissive policies are OR-combined, so one leftover USING (true) can still expose rows. Replace or drop each broad policy in a reviewed migration; the example only drops the named policy. Enable RLS, use a non-null user_id referencing auth.users(id), grant only needed table privileges to authenticated, and test allowed and denied access for two users. Owners, service roles and BYPASSRLS can bypass RLS: do not use those credentials in client-facing code.
-- Example: public.documents has id and NOT NULL user_id (uuid).
BEGIN;
ALTER TABLE public.documents ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS "allow all" ON public.documents;
CREATE POLICY "documents_select_own" ON public.documents
FOR SELECT TO authenticated USING (auth.uid() = user_id);
CREATE POLICY "documents_insert_own" ON public.documents
FOR INSERT TO authenticated WITH CHECK (auth.uid() = user_id);
CREATE POLICY "documents_update_own" ON public.documents
FOR UPDATE TO authenticated
USING (auth.uid() = user_id) WITH CHECK (auth.uid() = user_id);
CREATE POLICY "documents_delete_own" ON public.documents
FOR DELETE TO authenticated USING (auth.uid() = user_id);
COMMIT;
This example assumes your @/lib/supabase/server helper creates a request-scoped Supabase server client using the caller's cookies, not a service-role client. Install Zod and adapt the table and schema. Never accept userId or ownership from await req.json(): derive it from verified getUser(), then bind it to the database write. Use appropriate CSRF/origin protection for cookie-authenticated mutations.
// app/api/documents/route.ts
import { z } from 'zod';
import { createClient } from '@/lib/supabase/server';
const Input = z.object({ id: z.string().uuid(), title: z.string().trim().min(1).max(200) }).strict();
export async function PATCH(req: Request): Promise<Response> {
const supabase = await createClient();
const { data: { user }, error: authError } = await supabase.auth.getUser();
if (authError || !user) return new Response('Unauthorized', { status: 401 });
const userId = user.id;
const body = Input.safeParse(await req.json().catch(() => null));
if (!body.success) return new Response('Invalid request', { status: 400 });
const documentId = body.data.id;
const { data, error } = await supabase.from('documents')
.update({ title: body.data.title })
.eq('id', documentId).eq('user_id', userId)
.select('id').maybeSingle();
if (error) return new Response('Update failed', { status: 500 });
if (!data) return new Response('Not found', { status: 404 });
return Response.json({ id: data.id });
}
VSB-AI-001 is the existing command injection rule; rate limiting is VSB-AI-014. The example below shares one verified-user limit between /api/chat and /api/completion, rejects oversized bodies while reading, limits output tokens and times out the provider call. Install openai, @upstash/redis, @upstash/ratelimit, and zod; configure Redis and provider credentials as server-only environment variables, plus your request-scoped Supabase helper. The Redis limiter must be shared across instances and fail closed. Tune limits to the application, and separately enforce atomic per-user spending/token quotas, provider budget alerts, and an input-token/context limit using the model's tokenizer. Character and output caps alone are not a complete spend limit.
// lib/guarded-ai.ts — reused by both routes
import 'server-only';
import OpenAI from 'openai';
import { Redis } from '@upstash/redis';
import { Ratelimit } from '@upstash/ratelimit';
import { z } from 'zod';
import { createClient } from '@/lib/supabase/server';
const limiter = new Ratelimit({ redis: Redis.fromEnv(), limiter: Ratelimit.slidingWindow(10, '1 m') });
const openai = new OpenAI();
const Input = z.object({ prompt: z.string().trim().min(1).max(4000) }).strict();
async function readBody(req: Request): Promise<unknown> {
if (!req.body) throw new Error('Missing body');
const reader = req.body.getReader();
const chunks: Uint8Array[] = [];
let size = 0;
try {
for (;;) {
const { done, value } = await reader.read();
if (done) break;
size += value.byteLength;
if (size > 8192) { await reader.cancel(); throw new Error('Body too large'); }
chunks.push(value);
}
} finally { reader.releaseLock(); }
const bytes = new Uint8Array(size);
let offset = 0;
for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.length; }
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));
}
export async function POST(req: Request): Promise<Response> {
const supabase = await createClient();
const { data: { user }, error } = await supabase.auth.getUser();
if (error || !user) return new Response('Unauthorized', { status: 401 });
try {
const { success } = await limiter.limit(`ai:${user.id}`);
if (!success) return new Response('Rate limit exceeded', { status: 429 });
} catch { return new Response('Rate limiter unavailable', { status: 503 }); }
let raw: unknown;
try { raw = await readBody(req); } catch { return new Response('Invalid body', { status: 400 }); }
const parsed = Input.safeParse(raw);
if (!parsed.success) return new Response('Invalid request', { status: 400 });
try {
const result = await openai.chat.completions.create({
model: 'gpt-4o-mini',
messages: [{ role: 'user', content: parsed.data.prompt }],
max_completion_tokens: 512,
}, { signal: AbortSignal.timeout(30_000) });
return Response.json({ text: result.choices[0]?.message.content ?? '' });
} catch { return new Response('AI provider unavailable', { status: 502 }); }
}
// app/api/chat/route.ts and app/api/completion/route.ts
export { POST } from '@/lib/guarded-ai';
Run project tests and both audits again. Aim for 100/100 Grade A+ with no high or critical findings, but report any unresolved finding, exclusion, false positive, or verification limitation honestly rather than claiming success. Never equate a clean score with a complete security assessment.
npx -y @vibefoundry/vibe-shield scan --fail-on high
npx -y @vibefoundry/vibe-shield audit-skills --fail-on high
Produce a Markdown or HTML report with scope, inventory, risks prioritized by severity, evidence, actions, test results and remaining uncertainty. Illustrative code examples are not project-specific patches; review and adapt them. Obtain human approval before deployment or provider-side action.
npx -y @vibefoundry/vibe-shield scan --report SECURITY-REPORT.md --patch-prompt PATCH-PROMPT.md
npx -y @vibefoundry/vibe-shield audit-skills --report AGENT-REPORT.html
📊 2026 Empirical Security Benchmark: We audited 160 published AI, MCP & Agent Skill packages (7,062 files) with vibe-shield — uncovering 597 security findings (167 Critical, 82 High) across CWE-798, CWE-89, CWE-639, and SKILL.md surfaces. Read the full benchmark & dataset →
The security gate for AI-written code. Find exposed secrets, unguarded routes and missing RLS before you ship.
⭐ If this tool helps your AI coding workflow, please give this repository a Star! It helps more developers discover the project.
npx -y @vibefoundry/vibe-shield@latest scan .
Illustrative two-file scan; fixes are applied manually. Results vary by project. A clean score is not a security guarantee.
npx -y unslop-mcp@latest initnpx -y @vibefoundry/vibe-shield@latest scan .npx -y ghost-qa@latest test http://localhost:3000vibe-shield is a static security scanner plus an Agent Skill that helps Claude Code, Codex, Cursor and Windsurf audit before they say “done”.
The v2 catalogue covers client exposure; auth and route protection; database/RLS; AI and web sinks; infrastructure; dependency hygiene; secrets and cryptography; and agent/MCP integrity. The new hardening checks include production source maps, insecure JWT settings, explicit and omitted cookie flags, locally absent security headers, container users, lifecycle scripts, lockfiles and weak cryptography. Run rules for the complete catalogue.
The scanner produces a heuristic attack-surface inventory of route methods, observed guard signals, SQL tables and RLS signals, AI entrypoints, and MCP/agent files. Header checks cover recognized server configuration files; cookie checks cover common literal setter options. Both are advisory: external middleware, deployment settings and dynamic options require review. Signals do not prove guards or policies work, and code outside the scanned scope is not assessed. Run audit-skills separately for agent-integrity checks.
Generate an executive report or agent remediation prompt explicitly:
npx -y @vibefoundry/vibe-shield scan --report SECURITY-REPORT.md --patch-prompt PATCH-PROMPT.md
npx -y @vibefoundry/vibe-shield scan --format html --out security-report.html
npx -y @vibefoundry/vibe-shield audit-skills --report agent-report.html
Reports include severity, CWE, locations, snippets, OWASP 2025 web mappings for every rule and contextual LLM mappings when applicable, and illustrative remediation. Examples are not automatic project-specific patches; validate them against the application. The scanner itself is offline and read-only by default; --cache, --out, --report, --patch-prompt and init explicitly write files. Installing with npx can require network access. An A+ score applies only to the rules and files examined and is not a security certification.
The npm
2.0.0artifact predates the universal--agentsinitializer. Use npm2.1.0or later (once published), or the GitHubv2ref. To exercise this checkout locally, runnpm ci && npm run build, thennode dist/bin/vibe-shield.jswith the same arguments.
This is the shape of code an agent writes when you ask for "a delete endpoint":
// app/api/users/route.ts
export async function DELETE(req: Request) {
const { id, userId } = await req.json();
await db.query(`DELETE FROM users WHERE id = ${id} AND owner = ${userId}`);
return new Response('ok');
}
It works. It also has three critical vulnerabilities — no authentication, SQL injection, and an IDOR that lets the caller choose whose data they delete. Nothing in a normal review loop catches all three, and the agent reported the task as complete.
npx -y @vibefoundry/vibe-shield scan catches all three in 17 milliseconds:
🛡️ vibe-shield · security scan (illustrative output for current source)
target /home/you/app
💀 GRADE F — 0/100 · 3 critical
CRITICAL 3 ███
Findings
app/api/users/route.ts
CRITICAL 2:1 VSB-AUTH-001 Next.js App Router mutation handler has no authentication check
export async function DELETE(req: Request) {
CRITICAL 4:22 VSB-DB-007 SQL statement built by concatenating request data
await db.query(`DELETE FROM users WHERE id = ${id} AND owner = ${userId}`);
CRITICAL 4:22 VSB-AUTH-004 Record ownership taken from the request instead of the session (IDOR)
7 files · 1 KiB · 412 files/s · 17 ms · 80 rules
⚠ 3 critical findings — rotate any exposed credential before anything else.
Fix it npx -y @vibefoundry/vibe-shield scan --fix-prompt # writes SECURITY_PATCH_PROMPT.md for your agent
Explain npx -y @vibefoundry/vibe-shield explain VSB-AUTH-001
Gate CI npx -y @vibefoundry/vibe-shield scan --fail-on critical --format github
Then hand the fix list to the agent that wrote the bug:
npx -y @vibefoundry/vibe-shield scan --fix-prompt # → SECURITY_PATCH_PROMPT.md
That file contains, for every finding: the severity, the CWE id and link, the exact file:line, the vulnerable snippet, the ordered remediation steps, the target code shape, and a verification command. It is written for a machine to execute and a human to audit.
# 1. Scan (npx may download the package; the scanner itself is offline)
npx -y @vibefoundry/vibe-shield scan
# 2. Give your agent the fix list
npx -y @vibefoundry/vibe-shield scan --fix-prompt
# 3. Install the gate permanently — skill + CI + ignore file
npx -y github:avivgerz-hue/vibe-shield#v2 init --agents all
Use the scoped name. vibe-shield is published as
@vibefoundry/vibe-shield. The unscoped namevibe-shieldon npm belongs to an unrelated project, sonpx vibe-shieldruns someone else's code. Always include the@vibefoundry/scope. The package ships a prebuiltdist/, needs no TypeScript, and starts in milliseconds.
Run this from the repository you want to protect (Node.js and Git required):
npx -y github:avivgerz-hue/vibe-shield#v2 init --agents all
To configure selected agents, substitute a comma-separated list such as --agents claude,cursor,zed:
| Agent | Selector | Native integration |
|---|---|---|
| Claude Code | claude |
.mcp.json, CLAUDE.md, .claude/skills/vibe-shield/SKILL.md, .claude-plugin/plugin.json |
| OpenCode | opencode |
opencode.json MCP and AGENTS.md |
| OpenAI Codex CLI / universal agents | codex |
AGENTS.md and .agents/skills/vibe-shield/SKILL.md |
| Cursor | cursor |
.cursor/mcp.json and .cursor/rules/vibe-shield.mdc |
| Windsurf | windsurf |
.windsurfrules |
| VS Code / GitHub Copilot | copilot |
.vscode/mcp.json and .github/copilot-instructions.md |
| Cline / Roo Code | cline or roo |
.clinerules |
| Zed | zed |
.zed/settings.json context server |
The existing --agent claude|cursor|generic|all remains supported. The shared .mcp.json, ignore file, and (unless --no-workflow is set) CI workflow are also installed. JSON configuration is merged by server name; malformed JSON or JSON with comments is left untouched and reported. Existing instructions are appended only once, and existing files are not overwritten without --force. Restart the relevant editor or reload its configuration after setup.
Traditional SAST rules are built around human mistakes: a forgotten escape, a missing prepare(). Agent-written code fails differently — it is confidently complete and structurally plausible:
| What a human does | What an agent does |
|---|---|
| forgets to validate one input | writes a perfect endpoint with no auth at all |
uses eval in one legacy file |
puts a tool execute that shells out behind an LLM |
commits a .env by accident |
puts SUPABASE_SERVICE_ROLE_KEY behind NEXT_PUBLIC_ because "it needed the env var" |
writes CREATE TABLE |
writes CREATE TABLE and forgets the ENABLE ROW LEVEL SECURITY, so the anon key reads everything |
adds dangerouslySetInnerHTML to render a doc |
renders model output with it, creating stored XSS with a step counter |
vibe-shield encodes those specific shapes: 92 signatures across eight defensive categories, each one derived from a real agent-generated bug rathe