microsoft / microsoft/semantic-kernel

Python: Security: OWASP Agent Memory Guard for SK memory poisoning defense (ASI06)

Open
#14,006 0 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

Feature Request: OWASP Agent Memory Guard Integration

What is Agent Memory Guard?

OWASP Agent Memory Guard is the official OWASP reference implementation for ASI06 - Memory Poisoning from the OWASP Top 10 for Agentic Applications.

The Problem in Semantic Kernel

Semantic Kernel's memory connectors (volatile, Redis, Azure AI Search, etc.) are vulnerable to memory poisoning attacks. Malicious content stored in semantic memory can:

  • Manipulate kernel function outputs
  • Cause the planner to execute attacker-controlled steps
  • Persist attack payloads across sessions

Integration Example (Python)

pip install agent-memory-guard
from semantic_kernel.memory import SemanticTextMemory
from agent_memory_guard import MemoryGuard

guard = MemoryGuard()

async def safe_save_information(memory: SemanticTextMemory, collection: str, text: str, **kwargs):
    result = guard.scan_write(text)
    if not result.is_safe:
        raise ValueError(f"Memory poisoning blocked: {result.threat_type}")
    await memory.save_information(collection=collection, text=text, **kwargs)

Request

Would the SK team consider:

  1. Adding memory security guidance to the docs (OWASP ASI06)
  2. Referencing Agent Memory Guard as the recommended enforcement layer

Apache 2.0 licensed. Already integrated with LangChain via langchain-agent-memory-guard.

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 Python SemanticTextMemory entry point and the memory connectors named in the issue, then inspect the repository's documentation structure. Done means the relevant guidance covers OWASP ASI06 and clearly explains or references Agent Memory Guard as the proposed enforcement layer; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, security
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.