agentleFS
TacunsTacuns/vibe-aegis/skills/security-redteam-loop/SKILL.md

security-redteam-loop

Skill1 starsChanged 15 days agoMITView on GitHub

Deep Low-to-Critical application security auditor for vibe-coded apps. Performs multi-file data-flow analysis, STRIDE threat modeling, OWASP Top 10 auditing, BaaS/RLS verification, payment flow validation, and AI/LLM endpoint hardening.

  • Reads credentials

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 0 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify no private keys, database connection strings, or service-role keys appear in client-bundled env vars (NEXT_PUBLIC_*, VITE_*, …

    line 14
  2. Very specific:

    Check git history and root files for committed .env, .pem, .key, or hardcoded bearer tokens.

    line 15
  3. Very specific:

    Verify all package dependencies in package.json or requirements.txt are legitimate packages (catching AI-hallucinated "slopsquatting" …

    line 16
  4. Very specific:

    Check that JWTs are verified with jwt.verify() (never just jwt.decode()) and session tokens are stored in HttpOnly.

    line 23
  5. Very specific:

    Check for raw SQL interpolation ($queryRawUnsafe, template literals inside .query(), Python f"SELECT ...").

    line 29
  6. Very specific:

    Check for race conditions (TOCTOU) in credit balances, coupon redemptions, or quota counters (require atomic UPDATE ...

    line 35
  7. Very specific:

    Check URL-fetching endpoints for Server-Side Request Forgery (SSRF) against internal metadata services (169.254.169.254, localhost).

    line 40
  8. Very specific:

    Verify production configuration sets Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options: nosniff, …

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Red-Team Loop — Low-to-Critical Vulnerability Auditor

Perform a thorough, defensive architectural and source-code security audit tailored to the exact failure modes of AI-generated ("vibe-coded") applications.

Audit Checklist Across 5 Trust Boundaries

1. Secrets, Environment & Supply Chain (CRITICAL / HIGH)

  • Verify no private keys, database connection strings, or service-role keys appear in client-bundled env vars (NEXT_PUBLIC_*, VITE_*, EXPO_PUBLIC_*, REACT_APP_*).
  • Check git history and root files for committed .env, .pem, .key, or hardcoded bearer tokens.
  • Verify all package dependencies in package.json or requirements.txt are legitimate packages (catching AI-hallucinated "slopsquatting" package names).

2. Authentication, Session & Access Control (CRITICAL)

  • Enumerate every API route (app/api/**, pages/api/**, FastAPI @app.post/put/delete, Express routers) and every Next.js Server Action ("use server").
  • Confirm each route verifies the caller's session on the server before executing logic.
  • Trace every database read/write that accepts an id, userId, orgId, or slug from the request. Confirm the query filters by the authenticated session owner (WHERE id = $1 AND user_id = $2 or enforced RLS) to prevent Insecure Direct Object Reference (IDOR).
  • Check that JWTs are verified with jwt.verify() (never just jwt.decode()) and session tokens are stored in HttpOnly; Secure; SameSite cookies rather than localStorage.

3. Database & Backend-as-a-Service (Supabase / Firebase / SQL / Prisma) (CRITICAL / HIGH)

  • Inspect all .sql migrations: every table in the public schema must enable Row-Level Security (ALTER TABLE ... ENABLE ROW LEVEL SECURITY;) and define granular policies. Flag any USING (true) policy on write operations or sensitive tables.
  • Inspect firestore.rules / database.rules.json: flag allow read, write: if true.
  • Check for raw SQL interpolation ($queryRawUnsafe, template literals inside .query(), Python f"SELECT ...").

4. Payments, Webhooks & Business Logic (CRITICAL / HIGH)

  • Trace Stripe, Razorpay, LemonSqueezy, or PayPal checkout creation: confirm prices, plan IDs, and trial eligibility are resolved on the server from trusted constants or database records—never from client request bodies.
  • Confirm webhook endpoints verify cryptographic signatures (stripe.webhooks.constructEvent) using the raw unparsed request body and enforce idempotency against replay of already-processed event.ids.
  • Check for race conditions (TOCTOU) in credit balances, coupon redemptions, or quota counters (require atomic UPDATE ... SET credits = credits - 1 WHERE credits >= 1).

5. AI/LLM Endpoints, Network & Deployment Posture (HIGH / MEDIUM / LOW)

  • For apps calling OpenAI, Anthropic, Gemini, or open-weight models: verify authentication, per-user rate limits, explicit max_tokens / maxTokens caps, and separation between untrusted user data and system instructions.
  • Check URL-fetching endpoints for Server-Side Request Forgery (SSRF) against internal metadata services (169.254.169.254, localhost).
  • Verify production configuration sets Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options: nosniff, and strict CORS origins.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.