swarm-rls-multitenancy-agent

Audit multi-tenant isolation gaps in gnubok RLS policies and query filters.

209|46|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/erp-mafia/gnubok --skill swarm-rls-multitenancy-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swarm-rls-multitenancy-agent
Source: https://github.com/erp-mafia/gnubok/tree/main/.claude/skills/swarm-rls-multitenancy-agent
Command: npx skills add https://github.com/erp-mafia/gnubok --skill swarm-rls-multitenancy-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Read-only audit agent for gnubok's multi-tenant isolation. It sweeps for defense-in-depth company_id filtering in application code, RLS policy completeness and correctness in migrations, service role usage without company_id filters, user_company_ids() helper usage, team→company membership sync correctness, invitation security. Invoked by /swarm — not for direct user use.

Core Features & Use Cases

  • Read-only auditing of multi-tenant boundaries across app/api routes and data layer
  • Verification of RLS policies, migrations, and company_id scoping
  • Validation of service role usage and team-member synchronization
  • Review of invitation and access-control workflows

Quick Start

Run the swarm-rls-multitenancy-agent to perform a read-only audit of multi-tenant isolation across the gnubok deployment.

Frequently Asked Questions about swarm-rls-multitenancy-agent

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

FAQPage Schema
How do I audit multi-tenant isolation gaps in Postgres RLS policies?

To audit multi-tenant isolation gaps, this agent sweeps application query filters, migration files, and RLS policies to identify missing company_id scoping. It verifies defense-in-depth filtering across API routes and validates that the user_company_ids() helper is correctly applied to enforce server-side access control.

What does row level security check for multi-tenant access control look for?

A row level security check for multi-tenant access control verifies RLS policy completeness in migrations and ensures application code applies context-driven company_id filtering. It validates that service role usage includes proper filters and that team-to-company membership synchronization prevents unauthorized data access.

How do I verify user_company_ids() helper usage and team-to-company sync in a multi-tenant codebase?

To verify user_company_ids() helper usage and team-to-company sync, the agent performs a read-only review of invitation flows and API routes. It validates that queries enforce context-driven company_id filtering and confirms team-member synchronization correctly restricts users to permitted company data.

Can I use this agent to check service role usage without company_id filters?

Yes, you can use this agent to check service role usage without company_id filters. It performs a read-only audit to detect unfiltered service role queries, ensuring that database-level RLS and server-side checks prevent cross-tenant data leakage across the application codebase.

What is the best way to validate invitation security and access-control workflows in a multi-tenant app?

The best way to validate invitation security and access-control workflows is a non-invasive read-only audit. This agent reviews invitation flows to ensure users only access permitted company data, verifying that RLS policies and application query filters maintain strict multi-tenant boundaries.

Does this multi-tenant RLS audit modify database migrations or application code?

No, this multi-tenant RLS audit does not modify database migrations or application code. It operates strictly as a read-only agent, identifying and reporting isolation gaps across app/api routes, lib/supabase, and migrations without altering any deployment files.