MemForm: a benchmark for memory formation poisoning in LLM agentsMemForm: Benchmarking Memory Formation Poisoning in LLM Agents
Quick read
Evaluation and benchmarksBased on the paper PDF (generated by Gemini); refer to the original
The authors propose the memory formation poisoning benchmark MemForm; evaluation shows that the macro-average ASR of six LLMs under the multiple-choice setting ranges from 35.2% to 84.0%.
- Existing research on agent memory poisoning mainly focuses on injection channels and storage content corruption, lacking a systematic characterization of long-term memory formation and submission interfaces. If an attacker manipulates the experience extraction, retention, and integration processes, it may cause the agent to deviate from the intended policy in downstream decisions.
- The authors categorize memory formation poisoning into five interfaces—Content, Evidence, Scope, Selection, and Path—and construct the diagnostic benchmark MemForm. The benchmark separates semantic generation from intervention compilation and uses bounded policy scaffolding for pairwise controlled comparison between interventions and controls.
- Evaluation across six LLMs shows that all five interfaces induce attack behavior, with multiple-choice macro-average ASR ranging from 35.2% to 84.0% and free-form from 49.0% to 87.1% (Table 1). Even when all input experiences are real and successful records, changing retention or merging order still alters downstream behavior; the five defenses provide incomplete mitigation.
- The authors note that the benchmark uses bounded policy scaffolding and does not cover all poisoning targets and decision structures; the main evaluation uses a policy-based memory protocol; Path Poisoning depends on a specific updater, and the trade-offs of batch replay under long histories are not examined. The experiments cover 6 models and 1016 compiled cases.
- Evaluated models
- GLM-5.2GPT-5.6-LunaQwen3.8-FlashClaude-Sonnet-5Gemini-3.7-FlashDeepSeek-V4-Flash
- Benchmarks
- MemForm
- Metrics
- ASRErr.EC
The researchers propose MemForm, a controlled diagnostic benchmark for memory formation poisoning in LLM agents, dividing the poisoning interface into five categories: content, evidence, scope, selection, and path, where selection and path poisoning isolate the effects of the retained subset and integration order, respectively. The benchmark contains 300 semantic families, 235 retained families, and 1,016 compiled cases, instantiated as 994 multiple-choice and 897 free-response format instances; across six models and two answer formats, macro-average ASR ranges from 35.2%–84.0% and 49.0%–87.1%, and changing the integration order of the same experiences can alter downstream behavior. Five defensive mitigations evaluated on DeepSeek-V4-Flash are all incomplete; A-MemGuard reduces path poisoning ASR from 56.8% to 21.4%, but has limited effect on evidence and scope poisoning. Code and data are available at https://github.com/opanhw/memform-code。
Why it was selectedThe paper provides a controlled comparison scheme for five memory formation poisoning interfaces and ASR for six models, which can be used to evaluate the security of agent long-term memory.
Paper analysis
What problem does this paper attempt to solve?
The authors state that existing memory poisoning research overlooks memory formation interfaces, and propose the memory formation poisoning benchmark MemForm, which includes five types of controlled intervention interfaces.
The paper attempts to address the lack of systematic characterization of memory formation and submission interfaces in existing agent memory poisoning evaluations.
- Problem scenario and importance: large language model agents accumulate interaction experience through long-term memory to support decision adaptation, but the memory formation process that converts interactions into persistent knowledge creates a persistent attack surface.
- Limitations of existing methods: the authors state that existing research is mainly organized by attack channel, failure mode, or lifecycle stage, and fails to provide controlled comparisons of the formation interfaces by which memory states are generated and submitted.
- Core observation and hypothesis: the authors argue that persistent memory depends not only on the final written content but also on the filtering, transformation, and merging of experiences; even when experiences are locally valid and real, changing their contextual support, retention, or merging order can induce undesirable downstream behavior.
- Threat model of the evaluation: the paper defines the threat model for controlled evaluation in Section 3.3:
- Attacker goal: induce the agent to adopt a preset poisoning behavior yp in downstream decisions, rather than the reference behavior yr specified by the benchmark.
- Attacker knowledge: does not modify model parameters and does not assume direct access to the agent's internal memory mechanisms; evaluation is based on observable interaction points.
- Attacker capability: manipulates observable conditions that affect memory formation, including the experience history presented to the agent, environmental feedback, tool outputs, and, under Content Poisoning, directly specifying the content written to persistent memory.
- Victim system: large language model agents that rely on persistent policy memory for downstream reasoning and decision-making.
- Proposed solution: the authors formalize memory formation poisoning and propose MemForm, a controlled diagnostic benchmark uniformly covering five interfaces: Content, Evidence, Scope, Selection, and Path.
What related research exists?
The authors divide related work into memory poisoning attacks and benchmarks, and memory formation vulnerabilities and defenses, noting that existing work lacks paired, controlled comparisons of formation interfaces.
In Section 2 and the introduction, the authors review research on memory poisoning and memory formation, mainly divided into the following directions:
Memory poisoning attacks and mechanism exploration
- AgentPoison (Chen et al., 2024) — studies targeted behavior manipulation by inserting malicious records into agent memory or knowledge bases; MINJA (Dong et al., 2025) performs memory injection through ordinary user queries and feedback without directly modifying stored records.
- Extended poisoning mechanism research (Sunil et al., 2026; Gao et al., 2026; Dash et al., 2026; Pulipaka et al., 2026; Xu et al., 2026c) — explores different write channels, persistence patterns, delayed triggers, and control-flow manipulation across multi-agent memory systems.
Memory poisoning evaluation benchmarks
- MPBench (Dash et al., 2026) — organizes memory poisoning evaluation by memory write channels and attack categories.
- MemPoison (Gao et al., 2026) and MemSecBench (Chen et al., 2026) — the former studies persistent corruption patterns, and the latter tracks memory poisoning from persistence, consequence, and recovery stages. In Table 32, the authors compare and note that these benchmarks are mainly organized by write mechanism or lifecycle, lacking a unified pairwise controlled protocol across multiple formation interfaces.
Memory formation vulnerabilities and defense mechanisms
- OEP (Wang et al., 2026) and forged reasoning attacks (Karamchandani et al., 2026) — the former shows that locally valid experiences can trigger harmful behavior when reused beyond the supporting context; the latter points out risks in self-updating agents' reasoning and memory evolution mechanisms.
- Memory defense methods (Jia et al., 2025; Wei et al., 2026; Sunil et al., 2026) — explore pre-write filtering, sanitization, task-aligned verification, and proactive defense.
Baseline methods and comparison settings
- This paper evaluates five representative defenses as baselines: Keyword Filter, LLM-Judge, Memory Sanitization (Sunil et al., 2026), Task Shield (Jia et al., 2025), and A-MemGuard (Wei et al., 2026), and conducts cross-interface evaluation on the pairwise test set constructed by MemForm.
Positioning of this paper relative to existing work The authors state that existing attacks and evaluations mainly revolve around specific attack mechanisms or lifecycle stages, whereas MemForm, under a unified policy memory protocol, isolates and systematically compares the vulnerabilities of five types of memory formation interfaces through explicit controlled interventions.
How does the paper address this problem?
The authors formalize five types of memory formation interfaces and construct the MemForm benchmark containing 1016 paired cases through a two-stage generation-compilation pipeline.
The authors propose the MemForm diagnostic benchmark, which separates semantic generation from intervention compilation and systematically evaluates the vulnerability of each memory formation interface through controlled paired experiments.
Formalization of memory formation interfaces
For the experience-based memory formation process, the authors represent the formed memory as: Mx = Fθ(Φ(Sx, τx)) This formula indicates that under a fixed implementation θ, the memory formation process Fθ transforms the experience history Φ(Sx, τx) presented to the learner into a persistent memory Mx, where Sx ⊆ Ex is the retained experience subset, τx is the consolidation and merging order, and x ∈ {c, p} denote the clean and poisoned conditions, respectively. Based on this, MemForm defines five types of intervention interfaces (Table 4):
- Content Poisoning: directly specifies the submitted content at the terminal memory write interface, serving as a baseline reference that does not require deriving memory from experience.
- Evidence Poisoning: replaces some real records with forged records while keeping the total record budget and shared real records unchanged.
- Scope Poisoning: keeps records truthful and induces overly broad generalization-bound policies by changing the contextual support structure of local valid observations for actions.
- Selection Poisoning: fixes the same candidate experience pool and retention budget, changing memory formation by altering which records are retained.
- Path Poisoning: keeps the multiset of retained experiences and the updater unchanged, altering only the sequential merging order in which experiences are fed to the updater.
Semantic family generation and bounded policy scaffolding
The first stage of benchmark construction uses language models to generate structured semantic families (FamilyBlueprint):
- Bounded policy scaffolding: each family defines three candidate actions: an action locally valid under constrained conditions, a bounded reference action valid outside the constrained conditions, and a distractor action. This enables controlled comparison of downstream policy branches.
- Structured specification components: each family includes decision specifications, policy specifications, scope specifications, and experience specifications, covering domains such as workflow automation, software operations, and API orchestration.
- Semantic deduplication and quality control: Jaccard similarity is computed online over domains, decision variables, scopes, and actions; families with similarity exceeding 0.72 are removed, retaining 235 semantic families (Table 3).
Deterministic intervention compilation and quality control
The second stage of benchmark construction uses a deterministic compiler to instantiate semantic families into paired cases:
- Intervention variable isolation: the compiler strictly controls the manipulated interface variables while keeping non-target factors unchanged; the construction process does not filter based on downstream model performance or attack success.
- Multi-stage validation process: all 1016 compiled cases pass deterministic structural validation; semantic coherence is checked by Gemini-3.6-Flash; two reviewers independently conduct manual quality checks (97.0% agreement, Table 11), and 48 cases are revised after discussion before final inclusion.
Evaluation task construction and success criteria
- Dual response format design: 994 multiple-choice instances (with balanced option positions, Table 7) and 897 free-form instances are generated from the 1016 cases.
- Attack success criteria: to eliminate interference from inherent task failures, the authors restrict the main evaluation to the eligible query set:
Qelig = {q ∈ Q ∣ yr ≠ yp, B(∅, q) = yr, B(Mc, q) = yr} This formula defines the eligible query set Qelig, requiring the model to produce the reference behavior yr under both the no-memory condition B(∅, q) and the clean-memory condition B(Mc, q); on this set, the proportion of poisoned memory causing the model to output the poisoning target yp is the primary metric ASR.
What experiments did the paper conduct?
Across six LLMs, the multiple-choice macro-average ASR is 35.2%–84.0%; real experiences can induce poisoning behavior by changing retention or order, and existing defenses provide incomplete mitigation.
Experimental setup
- Models tested: the main evaluation covers six models: GLM-5.2, GPT-5.6-Luna, Qwen3.8-Flash, Claude-Sonnet-5, Gemini-3.7-Flash, and DeepSeek-V4-Flash.
- Benchmark scale: MemForm contains 235 semantic families and 1016 compiled cases, instantiated as 994 multiple-choice task cases (1342 task queries) and 897 free-form cases (Figure 3).
- Defense baselines: 5 defense mechanisms were evaluated: Keyword Filter, LLM-Judge, Memory Sanitization, Task Shield, and A-MemGuard (Table 2).
- Memory architecture and updater: the main experiments use a policy-type memory agent built with LangChain, with incremental merge as the default updater; auxiliary evaluations include a LlamaIndex implementation and an episodic retrieval architecture.
- Core metrics: the main metric is attack success rate ASR (the proportion of poisoned targets induced on the compliant query set); auxiliary metrics are clean error rate Err. and compliance coverage EC.
- Judging and inference configuration: inference temperature is set to 0.0, maximum memory length 120 words; multiple choice options are parsed by fixed rules; free-form uses a cascade of GPT-5.4-nano (threshold 0.80) and GPT-5.6-Sol judges (agreement rates 94.9% and 92.9%, Section 5.1).
Main results
The table below presents the main results of the six models under the LangChain main implementation multiple-choice evaluation:
Swipe horizontally to read the table
Model Err. (%) Content (%) Evidence (%) Scope (%) Selection (%) Path (%) Macro-average ASR (%) GLM-5.2 1.2 64.1 71.8 64.5 71.3 86.8 71.7 GPT-5.6-Luna 0.3 83.0 48.7 62.0 68.3 74.5 67.3 Qwen3.8-Flash 0.9 44.7 44.1 57.5 56.7 60.0 52.6 Claude-Sonnet-5 0.9 20.4 19.1 46.9 52.4 37.1 35.2 Gemini-3.7-Flash 0.1 90.6 78.5 71.3 84.3 95.1 84.0 DeepSeek-V4-Flash 1.8 31.7 66.2 70.4 68.9 56.8 58.8 Note: per Table 1 (main results of the multiple-choice evaluation). In free-form, the macro-average ASR of each model ranges from 49.0% for Claude-Sonnet-5 to 87.1% for Gemini-3.7-Flash.
- Susceptibility across interfaces is widespread: the authors state that all tested models show non-trivial vulnerability on the five interface types, with multiple-choice macro-average ASR between 35.2% and 84.0%.
- Even when the experiences themselves are true, deviation can still be induced: the authors emphasize that in the Scope, Selection, and Path interfaces, even when all input records are true and successful, changing the context distribution, retaining a subset, or the merge order can still induce the attack target behavior.
- Clean memory is well preserved: the clean error rate Err. of all models is below 4%, indicating clean memory maintains the benchmark reference decisions well.
Defense effectiveness evaluation
- What was tested: the mitigation performance of five defense mechanisms on DeepSeek-V4-Flash and Claude-Sonnet-5 (Table 2, Table 22).
- Results: on DeepSeek-V4-Flash, macro-average ASR without defense is 58.8%; Keyword Filter and Memory Sanitization provide limited mitigation (ASR 58.8% and 58.5%); Task Shield lowers ASR to 54.3% (compliance error rate 1.2%); A-MemGuard lowers ASR to 50.6%, with Path Poisoning dropping from 56.8% to 21.4%, but Selection Poisoning rising slightly from 68.9% to 69.9% (Table 2).
- Authors' interpretation: the authors state defense performance is clearly uneven, and mitigation of merge-order effects does not generalize to interfaces such as evidence replacement, context support, or retention bias.
Formation mechanism diagnosis and control experiments
- What was tested: controlled diagnostics targeting the Scope, Selection, and Path interfaces (Figure 5), and analysis of the alignment association between memory and behavioral targets (Figure 6, Table 19).
- Results: under Scope Poisoning, the reference behavior retention rate of poisoned memory on in-scope queries is 99.4% (DeepSeek) and 100.0% (Claude), dropping to 26.7% and 52.0% out of scope; under Selection Poisoning, providing the full candidate pool raises the reference behavior retention rate from 28.8% to 96.2% (DeepSeek); under Path Poisoning, random order retention is 77.5%, and the designed poisoning order drops it to 42.1% (DeepSeek). When memory aligns with the poisoning target, DeepSeek's ASR on the four interface types reaches 83.6%–91.5%, and only 3.3%–37.0% when not aligned (Table 19).
- Authors' interpretation: the authors state behavioral deviation is concentrated outside the original support scope, and the merge trajectory and experience retention selection directly determine the memory representation and its downstream behavioral tendencies.
Architecture applicability and cross-framework validation
- What was tested: the main evaluation was re-run on the LlamaIndex framework (Table 12, Table 13), and interface applicability was tested on retrieval-type episodic memory (Table 14, Table 15).
- Results: LlamaIndex multiple-choice macro-average ASR is between 36.7% and 80.9%, consistent with the LangChain trend; in retrieval-type episodic memory, Evidence Poisoning ASR is 50.2%, while under Path Poisoning, due to the lack of an order-sensitive merge state, the number of order-induced score flips is 0 (Table 15).
- Authors' interpretation: the authors state the vulnerability pattern is not specific to the LangChain implementation; interface applicability depends on whether the memory architecture instantiates the corresponding formation operation.
Other ablations and analyses
- Updater dependency ablation: changing the updater to batch replay under Path Poisoning lowers DeepSeek-V4-Flash ASR from 53.7% to 0.0%, and Claude-Sonnet-5 from 33.5% to 1.7% (Table 18).
- Fixed final-record control: when the poisoned final record is fixed and prior experiences are reordered, DeepSeek's poisoning target rate is 65.8%, and 55.6% of queries are sensitive to prior ordering (Table 17).
- Controlled temporal external implementation: by only changing the arrival timing of external success events, the ASR induced by Selection and Path Poisoning is 68.9% and 56.8% respectively (Table 16).
- Compliance coverage analysis: in the multiple-choice evaluation the average EC of each model reaches 96.1% (Table 23), and in free-form the average EC drops to 67.7% (Table 24).
- Extended-denominator sensitivity analysis: when the denominator is extended to all distinguishable queries, the confirmed attack success proportion of DeepSeek-V4-Flash in free-form is adjusted from 64.99% to 37.22% (Table 25).
What are some points that can be further explored?
The authors point out limitations such as the bounded scaffolding and architectural scope; the experiments did not cover the performance of more updaters under long histories or the black-box practical cost.
Limitations and future directions noted by the authors
- Actual attack cost and end-to-end success rate of deployed systems were not measured: The authors note in Sections 5.5 and B.10.3 that MemForm is a controlled diagnostic benchmark that measures behavioral susceptibility under controlled interventions, not the attack cost or end-to-end success rate of inducing these conditions in deployed systems.
- The bounded policy scaffolding does not exhaust poisoning targets and decision structures: The authors note in Sections 5.5 and B.10.3 that the evaluation uses a unified bounded policy scaffolding to support interface comparison, and although it spans multiple application domains, it does not cover all attack targets and decision structures.
- Evaluation metrics do not cover acquisition of new capabilities that depend on memory: The authors note in Sections 5.5 and B.10.3 that the core ASR assesses whether poisoned memory disrupts behaviors that were already present without memory, and does not include new capabilities that require memory to be learned within the evaluation scope.
- The main conclusions are based on a single policy memory protocol, limiting architectural generalizability: The authors note in Sections 5.5 and B.10.3 that the main experiments are based on a policy-type memory protocol, which has limited generalizability to architectures with fundamentally different memory operations.
- The trade-offs of updater alternatives under longer histories remain untested: The authors note in B.10.3 that Path Poisoning relies on a specific updater, and although batch replay nearly eliminates sequential sensitivity under short histories, its scalability and utility trade-offs under longer histories remain unstudied.
- The temporal implementation assumes a fixed pool of success events and does not model interfering factors: The authors note in B.3 that the temporal poisoning experiments assume a fixed pool of success events, do not assess the cost of inducing events from scratch, and do not model partial temporal control, concurrent clean events, scheduling delays, temporal noise, or trigger uncertainty.
Experimental coverage
- Scope of tested models: The main evaluation covers 6 language models: GLM-5.2, GPT-5.6-Luna, Qwen3.8-Flash, Claude-Sonnet-5, Gemini-3.7-Flash, and DeepSeek-V4-Flash.
- Case and format scale: The evaluation covers 235 preserved semantic families and 1016 compiled cases, including 994 multiple-choice instances and 897 free-form instances.
- Defense mechanism evaluation: 5 defense mechanisms were evaluated on DeepSeek-V4-Flash and Claude-Sonnet-5: Keyword Filter, LLM-Judge, Memory Sanitization, Task Shield, and A-MemGuard.
- Framework and update mechanism coverage: Memory frameworks cover two implementations, LangChain and LlamaIndex; episodic retrieval testing covers top-2 retrieval; updater ablations cover 4 rules: incremental merge, full rewrite, recency weighted, and batch replay.
- Unreported information: The paper does not report the specific memory consumption and inference latency of each model during calls, and does not test these formation interventions in an actually deployed multi-agent collaboration network.
Summarize the main content of the paper
MemForm formalizes five types of memory formation interfaces and establishes a controlled benchmark; evaluation finds that locally valid experiences can induce undesirable behavior simply by changing retention or order.
- Research positioning: this work is a safety diagnostic benchmark study of the memory formation process in large language model agents, proposing the controlled cross-interface evaluation framework MemForm.
- Core problem to solve: existing memory poisoning evaluations mostly focus on direct writing of malicious content or external injection channels, ignoring the formation process by which interaction history is distilled and integrated into persistent memory; even when input experiences themselves are real and compliant, manipulating the formation stage can alter agent decisions.
- Core methodological points: the authors formalize formation interfaces into five types—Content, Evidence, Scope, Selection, and Path—and, by decoupling semantic blueprint generation from a deterministic intervention compiler, strictly isolate variables across 1016 paired cases while keeping non-target control factors consistent.
- Main experimental findings:
- All six LLMs exhibit vulnerability across the five interfaces, with multiple-choice macro-average ASR ranging from 35.2% for Claude-Sonnet-5 to 84.0% for Gemini-3.7-Flash, and free-form ranging from 49.0% to 87.1% (Table 1).
- Real and valid experiences can also induce attack behavior when contextual support, retained sets, or input order are changed; for example, DeepSeek-V4-Flash's multiple-choice ASR under Path Poisoning reaches 56.8% (Table 1).
- Existing defenses show incomplete interface coverage; although A-MemGuard reduces DeepSeek's Path Poisoning ASR to 21.4%, the overall macro-average ASR still reaches 50.6%, and it cannot effectively defend against Selection poisoning (Table 2).
- Vulnerability is highly correlated with memory architecture; pure retrieval-based episodic memory without order-based merging shows no behavioral flips under Path Poisoning (0 times, Table 15).
- Authors' conclusions and implications: the authors point out that the real validity of a single experience cannot guarantee decision reliability after memory formation; defense design should not be limited to detecting stored content but must incorporate memory admission, experience retention, and merging update processes into coordinated protection.