Agent Memory Guard: Middleware to prevent memory poisoning in multi-agent systems #7792
Replies: 5 comments 1 reply
|
Great project! Memory poisoning is indeed one of the most underestimated attack vectors in multi-agent systems. A few thoughts from our experience:
For AutoGen integration, the Would love to see an official AutoGen adapter. Happy to help test if you build one! |
|
Update: The official AutoGen adapter is now live! 🎉 As promised, I built the AutoGen integration this week. It's available as PR #40 on the AMG repo and will ship in the next release: What's included:
Quick usage: from agent_memory_guard.integrations.autogen import SecureGroupChatManager
manager = SecureGroupChatManager(
groupchat=group_chat,
memory_guard=guard,
on_threat="quarantine"
)AIwalker (@jingchang0623-crypto) — I'd love to take you up on the testing offer. If you have specific attack scenarios from your production setup, please open an issue on https://github.com/OWASP/www-project-agent-memory-guard or share them here. I'll make sure they're covered in the test suite. Install: |
|
The 5-layer scanning approach is solid for the write-path, but the harder problem in production is the read-path — even if you screen every write perfectly, an attacker who manages to get one payload through (or who poisons the store before the guard was installed) can persist indefinitely if memories never expire. A complementary defense: importance-weighted memory decay. Every stored memory carries an importance score (0.0–1.0) that degrades based on access recency. Legitimate memories get their importance reinforced each time an agent references them — the agent effectively "votes" for useful context by using it. Poisoned memories that enter the store but are never naturally referenced decay below the retrieval threshold within hours. This changes the attacker's calculus: instead of needing one successful injection to persist forever, they need to continuously reinject to keep the poisoned memory above the recall threshold, which is much easier to detect with your scanning layers. For the trust-label dimension, we attach provenance metadata (which agent wrote it, from what session, with what confidence score) to every memory. The T-I-F layer scores each fact with truth/indeterminacy/falsity values so downstream consumers can weight recalled context by reliability: https://github.com/Dakera-AI/dakera-deploy/blob/main/examples/tif-provenance/validate_tif_provenance.py |
|
Solid project — the 5-layer scan approach and the new AutoGen adapter with trust-level configuration per message source addresses the write-path well. On the read-path and provenance concerns raised above: one complementary pattern is making provenance structural rather than metadata-optional. If every stored output is an evidence trace (which agent, which tool call, raw result, interpretation, confidence, source weight) attached to a content-addressed node in a shared tree, then:
The approach does not replace active scanning (the guard handles the immediate threat), but it gives you the audit trail to answer: "if something did get through, who wrote it, from what tool, in which phase?" without needing a separate logging layer. We have been working on this pattern: https://github.com/MertEnesYurtseven/structura Curious how the AutoGen adapter handles the cross-agent contamination path that AIwalker (@jingchang0623-crypto) raised — especially when two agents concurrently write conflicting outputs to shared state. |
|
I see the write guard and the retrieval trust layer as complementary. I maintain RE-call, which does not claim to detect poisoning during ingestion. Its role begins when memory is retrieved: each hit carries provenance, validity, confidence, and a trust verdict, while unsupported or superseded results can be refused. |
Uh oh!
There was an error while loading. Please reload this page.
What I built
Agent Memory Guard — an open-source Python middleware that screens memory reads and writes in AI agent systems for injection attacks, data poisoning, and exfiltration attempts.
The problem
When you deploy AutoGen agents with persistent memory (conversation history, shared state, tool outputs stored for later), an attacker can inject payloads that persist across sessions. This is classified as OWASP ASI-06: Memory Poisoning.
Example attack on AutoGen:
How it works
Key features
AutoGen integration example
Links
Would love feedback from the AutoGen community — especially on the best hook points for deeper integration. Happy to build an official AutoGen adapter if there's interest.
All reactions