Python: Security: OWASP Agent Memory Guard for Semantic Kernel memory protection
Feature Request: Memory Security Integration
Hi Semantic Kernel team,
Semantic Kernel is Microsoft's premier framework for building AI agents and copilots. As SK agents increasingly use memory stores (volatile, semantic, episodic), memory poisoning is an emerging security concern for enterprise deployments.
The threat: Malicious content injected into SK memory stores can silently bias agent behavior across sessions — a persistent, hard-to-detect attack vector.
OWASP Agent Memory Guard is the reference implementation for OWASP ASI06 (Memory Poisoning) in the OWASP Top 10 for Agentic Applications:
- Runtime scanning of memory reads/writes for injection payloads, secret leakage, and structural tampering
- SHA-256 integrity baselines to detect post-write tampering
- Policy-driven enforcement (block / warn / strip)
- Sub-100μs overhead
pip install agent-memory-guard
GitHub: https://github.com/OWASP/www-project-agent-memory-guard PyPI: https://pypi.org/project/agent-memory-guard/
As a fellow Microsoft engineer working on AI security, I'd love to explore adding this as a recommended security layer in SK's memory pipeline or as a featured integration in the SK documentation.
One practical way to make this easier to evaluate is to turn the report into a small contract test around the runtime boundary, not only the user-facing symptom.
For OWASP Agent Memory Guard for SK memory protection, I would check three things: first, the failing input is preserved as a minimal fixture; second, the SDK emits the same observable event/result shape before and after the fix except for the intended change; third, the trace or serialized session contains enough metadata to explain what happened after a resume or retry.
The part that matters for agent systems is durability: if a tool call, memory write, handoff, or structured-output step fails, downstream code should not have to infer state from natural-language output. A focused regression test around that boundary would make the issue much easier to close with confidence.
The threat model here is accurate, but I think the defense needs to go beyond scanning content at the middleware layer. After building a production memory server for AI agents, the pattern that actually works is defense in depth across three layers: (1) write-time validation like AMG describes, (2) storage-level integrity via cryptographic checksums on each memory record, and (3) read-time filtering where memories are scored by access-weighted importance and anomalous entries naturally sink below retrieval thresholds. Layer 3 is the one most frameworks miss — a poisoned memory that was injected once but never organically accessed should decay out of relevance automatically. We implemented this with a half-life decay scheduler that continuously demotes stale entries. For anyone building this kind of guardrail into their SK pipeline, the architecture is documented in our deploy config: https://github.com/Dakera-AI/dakera-deploy/discussions — happy to share specifics on the decay math.
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.