microsoft / microsoft/semantic-kernel
.Net: C#: Feature request: Memory poisoning defense (OWASP ASI06) for Semantic Kernel memory stores
Nobody has claimed this yet.
- 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:
- A security note in the
IMemoryStore/VectorStoreRecordCollectiondocs about ASI06? - A
IMemoryFilterinterface for pluggable memory validation in the kernel pipeline?
Happy to draft a docs PR for the C# SDK.
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 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