learning-it by example

Back to the video

Multi-Tenant AI Agent Platform: Four Leaks and How to Test

I gave every tenant its own database, and one tenant's data still leaked.

Video #247 ยท Enterprise architecture and AI agents

Steps in the video

  1. 0:00 A separate database for every tenant, and the data still leaked
  2. 0:32 The idea
  3. 1:08 Setup
  4. 1:37 One table, filters by habit
  5. 2:04 One table, one scoped layer
  6. 2:31 A database for each tenant
  7. 3:23 What this does not show
  8. 4:03 Mistakes to avoid
  9. 4:34 My take and next steps
  10. 5:06 Recap

Files

  • compare.py (26 lines)
  • tenants.py (91 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

Three made-up tenants and four mistakes I chose, in SQLite; no agent or model is run, the session is assumed trusted, the index is a plain query, and the script prints leaks but does not fail a build.

Sources

Learning IT by Example.