Skip to content

feat: Memory contamination detection for agent memory debugging (State Contamination) #196

@acailic

Description

@acailic

Paper Reference

  • Title: State Contamination in Memory-Augmented LLM Agents
  • Authors: Yian Wang, Agam Goyal, Yuen Chen, Hari Sundaram
  • Year: 2026
  • URL: https://arxiv.org/abs/2605.16746
  • Venue: arXiv preprint

Paper Summary

Studies "memory laundering" where adversarial context is compressed into seemingly-safe memory summaries that still influence behavior downstream. Introduces sub-threshold propagation gap (SPG) metric for measuring hidden influence in compressed memories.

Proposed Feature

Implement memory state validation and contamination detection:

Core Capabilities

  • Memory Influence Tracking: Track how past experiences influence current agent decisions through memory
  • Contamination Detection: Detect when adversarial or corrupted information persists through memory compression
  • SPG Metric Dashboard: Show the sub-threshold propagation gap for memory states
  • Memory Sanitization: Flag and offer to sanitize memory entries with detected contamination

Technical Approach

  • Add memory state tracking to the SDK's session capture
  • Implement influence propagation analysis between memory entries and decisions
  • Build memory health dashboard showing contamination scores per memory entry
  • Add sanitization controls in the UI

Impact

Critical for agents using RAG, long-term memory, or compressed context. Memory bugs are extremely difficult to debug manually — this provides automated detection.

Labels

enhancement, paper-inspired, safety

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions