semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Python: Security: OWASP Agent Memory Guard for Semantic Kernel memory protection

Open vgudur-dev opened this issue 6 months ago • 4 comments

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.

vgudur-dev avatar May 14 '26 16:05 vgudur-dev

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.

norika1207-lab avatar Jun 02 '26 03:06 norika1207-lab

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.

ferhimedamine avatar Jun 12 '26 07:06 ferhimedamine

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Sep 29 '26 01:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 28 '26 01:10 github-actions[bot]