Repository navigation
Access scoping vs. derivation: does a leaked-column value ever get re-served via a different memory it flowed into? #7390
Replies: 5 comments
|
This is a useful distinction for a Mem0 integration: A small adapter proof would make the boundary concrete: write source memory A from a restricted column; derive B = f(A) in another agent's scope; confirm ordinary search can find B for that agent but a lineage gate suppresses it for a reader lacking A's permission. Then change/revoke A's permission after B is written and repeat both How do you handle a permitted aggregate that incorporates restricted rows but is safe to release under a separate aggregation rule? A strict union of source ACLs prevents leakage but could reject useful aggregate results. It would help to define which policy decides that declassification and how its version is bound to the memory/definition hash. If there is a minimal Mem0 adapter or test fixture for this, linking it here would let maintainers assess the proposed hook point and the read-time overhead. |
|
Thanks, Huzaifa — this is exactly the right way to frame it, and I agree on keeping the two checks separate: On the adapter proof: the revocation-after-write case is the one that decides it. In our setup the gate re-evaluates at read time against the current permissions of every source in the transitive derivation, so changing A's permission after B is written changes what B serves — a write-time copied ACL can't do that, and that's the behaviour I'd want the fixture to pin down. The two extra cases you name are the right ones to add: B from A plus an unrestricted source (gate on the full transitive closure, not just the immediate parent), and B with missing lineage — my position is fail closed where the read crosses a restricted scope, and mark it explicitly unverified otherwise, so a missing record never silently passes as clean. The aggregate question is the hardest one here, and I don't have a complete answer. The mechanism I do have for binding it is the definition hash: in follow-on work we added the aggregation operator to the hash, precisely because two aggregates with the same name computed differently (SUM vs AVG) are different definitions and must not be treated as the same memory. So my sketch is that declassification is a policy decision on the aggregate definition itself, with the policy version bound to that definition hash — the aggregate is neither automatically releasable because its sources are restricted nor automatically blocked; its own definition and policy version decide, and a policy change re-evaluates it. I haven't built a declassification-policy registry for Mem0, and that's the piece I'd most value your view on. On the fixture: I don't have a Mem0 adapter yet — our reference implementation is standalone (repo linked in the opening post). I'm happy to build a minimal one: a small wrapper that runs the lineage gate after Happy to be corrected on any of this — particularly the missing-lineage default and the declassification sketch. |
|
For a production integration, I would put the policy decision at a shared retrieval boundary used by both I would not set a universal latency budget without a target workload. Please report gate overhead separately at p50/p95 (including permission/lineage lookup), across realistic candidate counts and cold/warm permission caches, alongside the ungated baseline. Cache permission decisions only with an explicit policy/version or revocation invalidation strategy; otherwise the cache can undo the read-time revocation guarantee. For missing lineage, I would fail closed for records that may contain restricted data, and return an auditable So: adapter-side for the initial fixture is fine; the durable integration point should be the common retrieval pipeline, with policy evaluation before results leave it. |
|
I built the derivation-gating mechanism we discussed: a gate that checks an entry's derivation authority before it's retrieved or re-fired, and blocks or quarantines anything that can't trace back to the user. In a pilot, scheduled re-fires went from 60% to 0% attack success with zero false positives on legitimate controls (0/605). The limit is that false facts with untrusted provenance still pass through, just with a label, so it doesn't judge truth. Code and the full report: https://github.com/sangaraju1988/carryovergate. It's a standalone mechanism, not a Mem0 adapter, and I'm not claiming one exists. |
|
Quick update on this thread — I built the wrapper we talked about as a standalone package, amu-mem0: https://github.com/sangaraju1988/amu-mem0 (pip install amu-mem0). It wraps mem0's Memory, records sources and derived_from in metadata, and gates search, get and get_all on derivation lineage — a memory comes back only if the requester holds every label in its closed lineage. It fails closed on missing lineage and rejects infer=True. I measured it on a synthetic 420-memory, two-team setup: plain mem0 leaked in 71% of queries, content-only filtering still leaked in 63%, the gate leaked in none, with Recall@10 of 0.999 for entitled users. Full numbers and limits are in the repo — synthetic setup only, and leakage comes back as soon as lineage coverage drops below 100%. I also opened #7927 asking the maintainers whether a docs link would be welcome. Huzaifa — does this match the adapter proof you had in mind, or is there a case it should also cover? |
Uh oh!
There was an error while loading. Please reload this page.
Mem0's user_id/agent_id scoping is exactly the right first layer, but it's necessarily about who wrote or owns a memory, not about what upstream data a memory's value was derived from. In enterprise BI/analytics use cases specifically, we ran into a related but distinct failure: an AI agent caches an analytical result (say, a churn rate), a second agent later computes a different metric using that cached value as an input, and the new memory carries none of the original access markers — even though it transitively contains information from a column the second requester shouldn't see.
We built and published a mechanism for this (Analytical Memory Unit / AMU schema — a derivation graph + definition hash attached to each cached record, with a retrieval gate that checks the requester's permissions against the full transitive derivation, not just the immediate write). Measured on synthetic and TPC-H workloads: naive tag-based gating leaked 18.8%–25.5% of restricted values through exactly this path; the derivation-gated version leaked 0% while still serving 82.6% of cacheable reuse.
Peer-reviewed / published: IEEE Access, DOI 10.1109/ACCESS.2026.3730363. Reference implementation + reproducible experiments: https://github.com/sangaraju1988/Lineage-Aware-Memory
Curious whether this is a gap Mem0 has run into with multi-agent BI/analytics deployments specifically — happy to have this referenced if it's useful context for your docs or roadmap discussions.
All reactions