microsoft / microsoft/semantic-kernel

Python: Feature request: Memory poisoning defense (OWASP ASI06) integration

Open
#14,011 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

python triage
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:
  1. A MemoryGuard-wrapped ISemanticTextMemory adapter
    1. Optional middleware hook in the kernel's memory pipeline
    1. Documentation guidance on memory security best practices per OWASP ASI06

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.