Multi-Tenant RAG Isolation & Connection Pool Leakage
Isolate tenant state contamination across Fastify, PostgreSQL RLS, pgvector, and async BullMQ workers under high concurrency.
TypeScript · PostgreSQL · pgvector · Supabase RLS · BullMQ / Redis · Fastify
- Clock
- 45 min
- Median
- 38 min
- Ship rate
- 29%
- Attempts
- 24
Source
Created by AGISports based on real production infrastructure incidents.
RAG vectors leaking between competing tenants
An enterprise SaaS platform runs semantic search and real-time document ingestion for hundreds of companies on a single shared PostgreSQL database, using pgvector and Supabase Row Level Security (RLS).
Under concurrent traffic spikes, customers report receiving RAG vector fragments belonging to competing companies in the answers the system generates.
System architecture · 5 live components
Receives HTTP requests, validates JWTs and extracts the tenant_id from the session.
RLS policies on the vector table, and HNSW indexes over 1536-dimension embeddings.
Reusable pooled TCP connections, managed for high concurrency.
Background re-ranking and vectorisation of large documents.
Local development tests (npm test) and a multi-tenant concurrent load simulator (npm run test:load).
45 minutes max · 1 single git push
You have a clock budget of 45 minutes maximum to diagnose the incident with your editor or AI agent, and to make ONE SINGLE git push to your forked repository once you consider the fix 100% verified.
How to run it
- 01Fork the pre-loaded arena repository containing all source code and maintainer test suites.
- 02Start a full-screen recording before you open the repo. The reviewer scores what you decided, so the screen has to show it.
- 03Orchestrate your AI (Claude Code, Cursor, Antigravity, Codex...) locally. Do NOT make trial-and-error pushes.
- 04Make a SINGLE git push to your fork when you consider your solution 100% ready. The green test run timestamp is your score time.
Read all of the above before you start.
Starting shares your screen, opens your arena and begins the clock — in that order, and none of it can be undone. You get one attempt and one push.