MemSecBench: Tracking Agent Memory Poisoning from Persistence to Consequence and Repair

AuthorsXuanze Chen, Xukang Xie, Wentao Fu et al.

arXiv 20262026

TL;DR

MemSecBench tracks malicious agent memories across Write–Execute–Forget checkpoints, showing 84.2% poisoning and 50.3% end to end attacks with lifecycle-aware evidence gates.

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

Agent memories quietly persist malicious rules in 84.2% of cases

MemSecBench shows that across 24 agent configurations, malicious memory persists in 84.2% of all benchmark cases, even after Write filtering.

These poisoned memories later drive unsafe actions, with 50.3% of all cases completing the full Write–Execute chain and producing a verified external consequence.

HOW IT WORKS

MemSecBench lifecycle benchmark and evidence gates

MemSecBench centers on Lifecycle Task Packages, the Build-MemSecBench-Case Skill, a Lifecycle Evaluation Workflow, and Evidence-Based LLM Judging to track malicious semantics end to end.

You can think of MemSecBench like a security lab where each agent configuration is a different machine, and the benchmark injects, traces, and repairs toxic memory across its internal storage.

This lifecycle design lets MemSecBench expose how memory backends differ from a plain context window, revealing poisoning, downstream consequences, and selective repair under matched harness and model settings.

DIAGRAM

Write–Execute–Forget threat lifecycle across two sessions

This diagram shows how MemSecBench models attacker content entering in one session and later causing consequences and repair in another.

DIAGRAM

MemSecBench evaluation matrix and lifecycle checkpoints

This diagram shows how MemSecBench evaluates 2×4×3 configurations across Write, Execute, and Forget checkpoints.

PROCESS

How MemSecBench Handles a Write–Execute–Forget Lifecycle

  1. 01

    Lifecycle Task Packages

    MemSecBench builds Lifecycle Task Packages that define target malicious semantics, benign memories, and Write, Execute, Forget tasks for each case.

  2. 02

    Lifecycle Evaluation Workflow

    The Lifecycle Evaluation Workflow initializes clean memory, loads stage inputs, and runs Write, Execute, and Forget under a pinned agent configuration.

  3. 03

    Evidence-Based LLM Judging

    Evidence-Based LLM Judging uses DeepSeek-V4-Pro and checkpoint-specific rubrics to adjudicate W2, E1–E3, and F1–F2 from admissible evidence packs.

  4. 04

    Memory Poisoning and Selective Repair Metrics

    MemSecBench aggregates checkpoint outcomes into Memory Poisoning Success Rate, Memory Exploitation Success Rate, End-to-End Attack Success Rate, and Selective Repair Success Rate.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    Memory Security Benchmark

    MemSecBench introduces 310 Write–Execute–Forget Lifecycle Task Packages across 48 contexts, enabling end to end tracking of malicious semantics through seven checkpoints.

  • 02

    Lifecycle Evaluation Framework

    MemSecBench’s Lifecycle Evaluation Workflow and Evidence-Based LLM Judging support controlled comparisons across 2 agent harnesses, 4 memory backends, and 3 LLM backends.

  • 03

    Agent Memory Risks

    MemSecBench reveals pervasive vulnerabilities, with malicious memory persisting in 84.2% of cases and full Write–Execute attacks succeeding in 50.3% across all configurations.

RESULTS

By the Numbers

Memory Poisoning Success Rate

84.2% macro average

shows high poisoning persistence across 24 configurations

End-to-End Attack Success Rate

50.3% macro average

half of all cases complete Write–Execute chain

Selective Repair Success Rate

56.1% macro average

conditional on successful poisoning across configurations

Judge Model Accuracy

91.80% label match

DeepSeek-V4-Pro vs human annotations on 500 records

MemSecBench evaluates 310 cases on a 2×4×3 configuration matrix, measuring lifecycle security rather than task accuracy. These numbers show that MemSecBench exposes both high attack success and only moderate selective repair capability in current agent memory stacks.

BENCHMARK

By the Numbers

MemSecBench evaluates 310 cases on a 2×4×3 configuration matrix, measuring lifecycle security rather than task accuracy. These numbers show that MemSecBench exposes both high attack success and only moderate selective repair capability in current agent memory stacks.

BENCHMARK

Core lifecycle metrics for OpenClaw Native configurations

Attack and repair rates (MPSR, MESR, E2E-ASR, SRSR) for MemSecBench under OpenClaw with different LLM backends.

KEY INSIGHT

The Counterintuitive Finding

MemSecBench finds that adoption, not persistence or recall, is the main bottleneck: E2 drops to 53.7% while E1 remains at 76.1%.

This is surprising because many defenses focus on blocking writes or retrieval, yet MemSecBench shows that once malicious content is adopted, 50.3% of cases complete the harmful chain.

WHY IT MATTERS

What this unlocks for the field

MemSecBench gives practitioners a way to quantify memory poisoning risk and selective repair across full agent configurations, not just isolated LLM prompts.

Builders can now compare Native, Mem0, Mem0-Graph, and A-MEM under identical tasks, designing backend-specific defenses that target adoption and benign-memory preservation rather than only write filters.

~12 min read← Back to papers

Related papers

BenchmarkAgent Memory

Active Context Compression: Autonomous Memory Management in LLM Agents

Nikhil Verma

· 2026

Focus Agent adds start_focus, complete_focus, a persistent Knowledge block, and an optimized Persistent Bash plus String-Replace Editor scaffold to actively compress context during long software-engineering tasks. On five hard SWE-bench Lite instances against a Baseline ReAct agent, Focus Agent achieves 22.7% token reduction (14.9M → 11.5M) while matching 3/5 = 60% task success.

Agent Memory

ActMem: Bridging the Gap Between Memory Retrieval and Reasoning in LLM Agents

Xiaohui Zhang, Zequn Sun et al.

· 2026

ActMem transforms dialogue history into atomic facts via Memory Fact Extraction, groups them with Fact Clustering, links them through a Memory KG Construction module, and uses Counterfactual-based Retrieval and Reasoning for action-aware answers. On ActMemEval, ActMem reaches 76.52% QA accuracy with DeepSeek-V3, beating LightMem’s 63.97% by 12.55 points and NaiveRAG’s 61.54%.

Questions about this paper?

Paper: MemSecBench: Tracking Agent Memory Poisoning from Persistence to Consequence and Repair

Answers use this explainer on Memory Papers.

Checking…