DriftGuard: Online Memory-Drift Detection via Causal Attribution for LLM Agents

Licheng Pan, Yuzhou Chen, Zhixuan Chu, Yichen Sun, Han Zheng +7 more
11/19/2026
cs.AI

No confident code implementation found for this paper.

Abstract

Large language model (LLM) agents rely on persistent memory to plan tool calls and complete multi-step tasks, which exposes them to memory drift: an adversarial or misleading memory alters the execution path and final outcome. In this work, we investigate online memory-drift detection, which estimates each retrieved memory's causal contribution to potential drift at serving time.

Show full abstract

We identify two fundamental challenges. (1) Content-level features are insufficient for causal memory-drift attribution, as perplexity or retrieval relevance alone cannot determine which retrieved memory would change agent behavior if neutralized; (2) Counterfactual attribution is prohibitively expensive for online detection, as it requires replaying downstream agent and tool execution for each candidate memory, exceeding real-time serving budgets. To address these challenges, we propose DriftGuard, a two-stage framework that decouples offline causal supervision from online estimation. Specifically, DriftGuard first constructs causal supervision through repeated paired counterfactual replays, continuing the original and single-memory neutralized trajectory suffixes from a shared pre-action state. The resulting annotations are aggregated by component-wise majority voting into a memory drift score (MDS) that captures action change, attack removal, violation removal, and task recovery. Guided by this supervision, DriftGuard then learns an online risk model that estimates MDS from pre-action information and flags drift-inducing memories via its maximum component risk, without online counterfactual rollouts. Extensive experiments demonstrate that DriftGuard accurately identifies drift-inducing memories and enables efficient online defense. Code is available at https://anonymous.4open.science/r/DriftGuard-7F0B.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pan2026driftguard,
  title  = {DriftGuard: Online Memory-Drift Detection via Causal Attribution for LLM Agents},
  author = {Licheng Pan and Yuzhou Chen and Zhixuan Chu and Yichen Sun and Han Zheng and Zhiyu Wang and Hao Wang and Yan Wang and Bingyu Zhu and Haiwen Hong and Longtao Huang and Kui Ren},
  year   = {2026},
  eprint = {2611.25583},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.25583v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.25583.svg)](https://codeofpaper.com/paper/2611.25583)

Discussion