You're leaking data if your agent memory uses post-filter tenant scoping

Critical-Home9648 · reddit · 2026-09-16

A detailed post-mortem on multi-tenant agent memory isolation: a shared index plus a system-prompt rule "only use customer X's memories" fails because retrieval leaks data before the model sees anything.

Three leak paths

Model: scope attaches at write time (missing scope = failed write, no default bucket); hierarchy is user→customer→client as a materialized path; retrieval requires an explicit scope path so out-of-scope data never enters the process — making prompt injection irrelevant. Entity resolution must also be scoped, with low-confidence matches routed to review queues: an unmerged duplicate is an annoyance, a wrong merge is an incident. Deletion is the real test — tombstoned vectors aren't deleted; dropping a partition is.

Testing: use two tenants with near-identical records (same names, closest embeddings) and verify zero cross-tenant rows at every k, then repeat with one tenant 1000x larger to expose post-filter recall drops.

Original post →

More from coding & agent

coding & agent channel →