Shared Agent Memory Leaks. Enforce the Boundary in PostgreSQL
Agents with long-term memory often keep it in one vector store shared by many users, and often by many agents. Ownership is a metadata column, and the boundary is a WHERE clause in application code. This post argues that the boundary belongs in the database instead. Why the database? Because it is the one layer every query has to pass through, including the ones nobody remembers writing. The post…
Shared memory among agents in multi-tenant systems can lead to significant data leakage. A study called MemLeak (Mudgal et al., October 2026) found that under pooled memory retrieval, data leakage can reach up to 70-100% without any external attacker. Another research, AgentLeak (El Yagoubi et al.), identified several channels through which data could be leaked, including final output, inter-agent messages, and shared memory.
None of the four frameworks tested offered a way to intercept inter-agent messages. The proposed solution is to enforce strict ownership boundaries directly within the PostgreSQL database. By setting up a role that does not own the memory table and applying row-level security policies, the system can prevent both cross-user semantic bleed and lateral movement between agents.
This approach adds about 1.4 ms of mean latency per query but ensures that data leakage is minimized to a clean baseline.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.