security-audit

Audit backend code for multi-tenancy leaks, missing auth guards, and sensitive data exposure.

1|Updated Jul 20, 2026
One-click install
npx skills add https://github.com/gonzoblasco/ai-developer-stack --skill security-audit-gonzoblasco
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-audit
Source: https://github.com/gonzoblasco/ai-developer-stack/tree/main/backend-infra/security-audit
Command: npx skills add https://github.com/gonzoblasco/ai-developer-stack --skill security-audit-gonzoblasco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Backend code often ships with critical vulnerabilities that linters miss: cross-tenant data leaks from service-role database clients, API endpoints without authentication checks, unvalidated webhook signatures, and sensitive fields leaking to frontend responses. This Skill applies a backend-specific threat model to detect these issues before production. ## Core Features & Use Cases - Multi-Tenancy Isolation Audit: Detects database queries using bypass clients (service_role, admin_client) that lack explicit tenant filters in their WHERE clauses. - Auth Guard Verification: Ensures every API route validates the user's session unless explicitly documented as public. - Webhook & Internal Secret Validation: Checks that endpoints consumed by external integrations (n8n, Stripe, Mercado Libre) verify secret headers or cryptographic signatures. - Frontend Leak Prevention: Flags API responses that serialize password hashes, refresh tokens, or internal metadata to the client. - Use Case: Before closing an epic on a multi-tenant SaaS, run this audit to catch a query like db.from('records').select('*') that would expose every tenant's data, triggering a critical failure that blocks release. ## Quick Start Ask the AI to run a security audit on the backend code developed in this cycle and report any critical findings in multi-tenancy isolation or authentication guards.

Frequently Asked Questions about security-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit backend code for multi-tenancy data leaks?▼

Audit every database query made with service-role or admin clients, since these bypass row-level security. Each query must include an explicit tenant filter such as company_id in its WHERE clause, otherwise it risks exposing data across tenants.

How to check if API endpoints have authentication guards?▼

Review every file in API route directories and confirm each method verifies the user's active session at the start. Only endpoints explicitly documented as public may skip this verification.

Does this audit work with Supabase service_role clients?▼

Yes, the audit specifically targets service_role and admin_client usage because these bypass RLS policies. Any query using them without an explicit tenant filter is flagged as a critical failure.

What happens when the security audit finds a critical issue?▼

Findings in the Multi-Tenancy or Auth Guards categories trigger an automatic CRITICAL FAILURE status. This blocks execution of the Close-Epic skill, preventing the release from proceeding until fixed.

How do I validate webhook signatures for external integrations?▼

Endpoints consumed by external services like n8n, Stripe, or Mercado Libre must validate secret headers such as x-internal-secret or x-webhook-signature. The audit flags any webhook endpoint missing this validation.

What are the limitations of this security audit?▼

The audit focuses on four specific vectors: tenant isolation, auth guards, webhook secrets, and frontend data leaks. It is not a general-purpose linter and does not replace penetration testing or dependency vulnerability scanning.