microsoft / microsoft/semantic-kernel
Python: Feature request: Memory poisoning defense (OWASP ASI06) integration
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 28.6k
- Forks
- 4.8k
- Avg merge
- 14h 13m
- Merged PRs (30d)
- 18
Description
Summary
OWASP recently published the Top 10 for Agentic Applications, which includes ASI06: Memory Poisoning — a threat category specific to AI agents that persist memory across sessions.
As Semantic Kernel adds more persistent memory and agent loop capabilities, it would be valuable to have a built-in or recommended defense layer for this attack surface.
The threat
When an agent stores information in memory (conversation history, retrieved facts, tool outputs, scratchpads), a malicious actor can craft inputs that get stored as "trusted" memories. Those poisoned memories then influence the agent's future behavior — causing it to leak data, take unauthorized actions, or be persistently manipulated across sessions.
This is distinct from prompt injection (which targets user input at the front of the loop) — memory poisoning targets the memory store itself.
Proposed integration
The OWASP reference implementation for ASI06 is agent-memory-guard (MIT/Apache-2.0 licensed, pure Python, zero external dependencies):
pip install agent-memory-guard
It provides:
- Runtime memory validation (prompt injection, secret leakage, protected-key tampering)
-
- Cryptographic integrity verification (SHA-256 baselines)
-
-
- Declarative YAML policy engine
-
-
-
-
- Point-in-time snapshots and rollback
-
-
-
-
-
-
- Drop-in middleware for common memory backends
Suggested integration points for Semantic Kernel:
- Drop-in middleware for common memory backends
-
-
-
- A
MemoryGuard-wrappedISemanticTextMemoryadapter -
- Optional middleware hook in the kernel's memory pipeline
-
- Documentation guidance on memory security best practices per OWASP ASI06
References
- OWASP Top 10 for Agentic Applications: https://genai.owasp.org/
-
- agent-memory-guard (OWASP reference impl): https://github.com/OWASP/www-project-agent-memory-guard
-
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the ISemanticTextMemory adapter and the kernel memory pipeline mentioned in the proposal, then examine how Semantic Kernel currently handles persistent memory. Determine whether the integration should be an adapter, middleware hook, documentation guidance, or a combination, and define completion criteria for memory validation, integrity checks, policy handling, and rollback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100