microsoft / microsoft/semantic-kernel

.Net: C#: Feature request: Memory poisoning defense (OWASP ASI06) for Semantic Kernel memory stores

Open
#14,025 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.NET python triage
Dominant language
C#
Stars
28.6k
Forks
4.8k
Avg merge
14h 13m
Merged PRs (30d)
18

Description

Memory Poisoning Defense for Semantic Kernel Memory Stores (OWASP ASI06)

Hi Semantic Kernel team 👋

Following up on the Python issue filed earlier — wanted to also raise this for the C# SDK specifically, as Semantic Kernel's IMemoryStore and VectorStoreRecordCollection are widely used in enterprise .NET agentic applications.

ASI06 — Memory Poisoning (from the OWASP Top 10 for Agentic Applications 2025) describes how malicious content written to an agent's memory can persist across sessions and silently alter future behavior.

Reference Implementation

OWASP Agent Memory Guard is an official OWASP reference implementation (Python) that defines the scan-before-write pattern. The algorithm is directly portable to C#.

// Proposed C# interface
var guard = new MemoryGuard();
var result = await guard.ScanAsync(memoryContent);
if (result.IsSafe)
{
    await memoryStore.UpsertAsync(collection, record);
}
Ask

Would the SK team be open to:

  1. A security note in the IMemoryStore / VectorStoreRecordCollection docs about ASI06?
  2. A IMemoryFilter interface for pluggable memory validation in the kernel pipeline?

Happy to draft a docs PR for the C# SDK.

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 with the IMemoryStore and VectorStoreRecordCollection documentation, then compare the proposed C# MemoryGuard flow with the OWASP Agent Memory Guard reference. Done is a maintainer-approved scope for the security note and/or IMemoryFilter design, with any required C# SDK work clearly specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ai, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.