Agent memory write paths leak restricted data: 67% leak vs 0% in direct RAG

ultraprogger · reddit · 2026-11-10

A reproducible offline test suite exposes a blind spot in multi-tenant RAG: metadata filters like allowedgroups give 0% leaks on direct vector-store queries, but break down on the write path once background agents are involved.

An agent with elevated cross-team read access summarizes restricted docs and commits the derived chunk back to a shared collection — and on write, the upstream ACLs vanish. In a stock Chroma + LlamaIndex setup, the summary chunk lands with zero permission tags, so any user querying shared memory can retrieve private source data.

The author open-sourced an Apache-2.0 harness, sentinel-eval, with results:

The obvious "strict intersection" fix (readers must have access to every source doc) plugs the leak but effectively kills multi-doc summaries' retrieval utility. Vector DBs can't evaluate dynamic permission DAGs at query time, so backtracking via sourcedocuments metadata doesn't help either. The harness runs 23 tests offline in seconds with mock vectors, no API keys needed.

The author asks the community how they're actually handling permissions when agents write derived summaries to shared memory.

Original post →

More from coding & agent

coding & agent channel →