Python: [Feature] Memory validation layer to protect against memory poisoning attacks (OWASP AMG integration)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
まず、TextMemoryPlugin、SemanticTextMemory、connectors、および IMemoryStore の実装を通る Python メモリフローを追跡します。提案されている middleware または設定可能な pipeline のアプローチを、既存の永続化パスおよび OWASP Agent Memory Guard の統合と比較します。オプションの検証レイヤーが永続化前にエントリをスキャンし、検出された memory-poisoning コンテンツをブロックでき、未設定のストアに影響を与えない状態を完了とします。
索引モデルが issue の本文から書いたものです。
説明
Scenario
Semantic Kernel's memory features (TextMemoryPlugin, VolatileMemoryStore, connectors) allow agents to store and retrieve information across interactions. However, there's currently no built-in validation to prevent memory poisoning attacks — where adversarial content gets stored in memory and alters agent behavior in subsequent sessions.
This is now a documented attack class: Memory Poisoning Attacks in LLM Agents (arxiv, June 2026)
Proposal
Add an optional memory validation layer that scans entries before they're persisted to any IMemoryStore implementation. This could be implemented as:
- A middleware/decorator pattern for IMemoryStore
- A configurable validation step in the memory pipeline
There's an existing open-source solution that already supports Semantic Kernel: OWASP Agent Memory Guard
What it detects:
- Prompt injection hidden in memory entries
- Instruction override attempts ("ignore previous instructions...")
- Persona/identity manipulation
- Cross-session persistence attacks
- Encoding-based obfuscation (base64, hex, rot13)
Integration example (Python SK):
from agent_memory_guard import MemoryGuard
from semantic_kernel.memory import SemanticTextMemory
guard = MemoryGuard()
# Validate before saving to memory
async def save_with_validation(memory: SemanticTextMemory, collection, text, id):
result = guard.scan(text)
if result.is_safe:
await memory.save_information(collection, text, id)
else:
raise MemoryPoisoningError(f"Blocked: {result.threat_type}")
Key details:
pip install agent-memory-guard- 98.7% detection rate, <2ms latency per validation
- OWASP Incubator project (Apache 2.0)
- Already has integrations for CrewAI, AutoGen, LangChain, and Semantic Kernel
Benefits
- Protects SK agents from having their behavior silently altered via poisoned memories
- Complements existing SK security practices
- Minimal performance impact (<2ms per memory operation)
- Could be opt-in via configuration
- 主要言語
- C#
- スター
- 28.6k
- フォーク
- 4.8k
- 平均マージ
- 13時間 24分
- マージ済み PR(30日)
- 11
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/semantic-kernel のほかの issue
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14491 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/semantic-kernel#14490 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/semantic-kernel#14483 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
.NET python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/semantic-kernel#14482 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14481 ·
メンテナーはふだん 2 日以内に返信
microsoft/semantic-kernel の issue をすべて見る
似ている issue
-
WPF: each page's `Title` overwrites the window title, and returning to a page does not restore itオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
agentic-workflows area/Docs partner/agentic-workflows
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jamesmontemagno/tiny-clips#378 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
go 🏃 testing 🧪
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#7239 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15462 ·
メンテナーはふだん 1 日以内に返信