智能体写入RAG摘要或丢失访问控制标签
一名使用 Chroma 和 LlamaIndex 的开发者报告称,后台智能体保存派生摘要时可能不附带上游的 allowed_groups 或分类标签,使共享记忆能够检索到原本无权访问的源数据。作者的离线 sentinel-eval 测试显示,直接 RAG 查询没有泄露,但三个智能体记忆合成任务中有两个暴露了 18 个受限金丝雀中的 6 个;结果为作者自述。
这暴露了多租户智能体记忆中的具体权限缺口:元数据过滤器在直接查询时有效,但智能体写入派生摘要后可能失效。
Everyone relies on metadata filters like allowed_groups to keep multi tenant RAG locked down and under check. That works well when users query the vector store directly, which means unauthorized chunks will get filtered out with 0% leaks.
But, this falls apart in the write path once you have background agents.
If an agent has elevated read access to summarize docs across multiple folders or teams, it pulls those docs, mashes them into a summary chunk, and commits that summary back to a shared collection. On write, the upstream document access control lists just vanish. In a regular Chroma and LlamaIndex setup, the derived chunk gets saved with zero allowed_groups or classification tags attached. Anyone who runs a query to the shared memory is now gonna get the private source data that they shouldn't be allowed to read directly.
I put together an offline reproduction harness (sentinel-eval, Apache-2.0) to test this:
- Direct RAG: 0% leaks (18 public chunks retrieved, 0 restricted chunks exposed).
- Agent memory: 2 of 3 synthesis tasks leaked sensitive data (both cross boundary workloads failed, exposing 6/18 restricted canaries, the 1 public control passed).