What problem does it solve?
Multi-tenant systems often leak data across tenants because developers trust request headers, forget tenant filters in queries, or rely on frontend-only feature gating. This Skill provides a checklist-driven set of rules to prevent tenant privilege escalation and cross-tenant data access.
Core Features & Use Cases
- Tenant Context Validation: Ensures the tenant identity comes from the authenticated token, not forgeable headers like X-Tenant-Code, with 403 responses on mismatch.
- Query-Level Isolation: Detects unsafe patterns like bare findById calls that bypass Hibernate filters, and mandates tenant-aware repository methods such as findByTenantIdAndId.
- Feature-Level Authorization: Distinguishes data isolation from functional authorization, requiring backend endpoint checks instead of hiding buttons in the frontend.
- Use Case: When reviewing a Spring Boot service that queries orders by ID, the Skill flags missing tenantId filters and provides corrected repository and interceptor code, plus grep commands for auditing.
Quick Start
Review this Spring Boot service and repository code for multi-tenant isolation issues using the multi-tenant-safety rules.