Python: [Feature] Memory validation layer to protect against memory poisoning attacks (OWASP AMG integration)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza siguiendo el flujo de memoria de Python a través de TextMemoryPlugin, SemanticTextMemory, connectors y las implementaciones de IMemoryStore. Compara los enfoques propuestos de middleware o de pipeline configurable con la ruta de persistencia existente y la integración de OWASP Agent Memory Guard. Se considerará terminado cuando una capa de validación opcional pueda analizar las entradas antes de la persistencia y bloquear el contenido de memory poisoning detectado sin afectar a los stores no configurados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C#
- Estrellas
- 28.6k
- Forks
- 4.8k
- Merge medio
- 13 h 24 min
- PR fusionados (30 d)
- 11
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/semantic-kernel
-
python triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
microsoft/semantic-kernel#14491 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
python triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/semantic-kernel#14490 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
microsoft/semantic-kernel#14483 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
.NET python triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
microsoft/semantic-kernel#14482 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Python: [Python] as_agent_framework_tool drops parameter defaults (optionals become required)Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
microsoft/semantic-kernel#14481 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/semantic-kernel
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/fluentui-blazor#5364 ·
Los mantenedores suelen responder en 1 día
-
.NET triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
microsoft/agent-framework#8811 ·
Los mantenedores suelen responder en 1 día
-
.NET Docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
getsentry/sentry-dotnet#5637 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QuantConnect/Lean#9842 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NethermindEth/nethermind#14012 ·
Los mantenedores suelen responder en 1 día