Skip to content

MRMMIA: Membership Inference Attack Targeting Chat Agent MemoryMRMMIA: Membership Inference Attacks on Memory in Chat Agents

arXiv· arXiv:2605.27825· Kai Chen, Yan Pang, Tianhao WangUniversity of VirginiaIndexed by this site · 23 days ago· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose MRMMIA, which uses multiple recall probes to infer whether a candidate statement is in a chat agent's memory; the authors state that it outperforms baselines under all three access settings.

Threat modelThe attacker's goal is to infer whether a candidate statement is a member of a chat agent's memory store (Exact Membership Rule). Knowledge has three levels: black-box sees only response text; gray-box additionally obtains output token probabilities; white-box can access the retrieved memory units. The attacker cannot modify or poison the memory store, access the system prompt, view the full memory store, or read others' memories. The victim system is a chat agent with persistent memory (Mem0, MemGPT backends).

Questions
Membership inference attacks (MIA) have previously mainly targeted training corpora and RAG retrieval stores; membership inference research targeting chat agents' persistent memory is scarce, yet memory may contain sensitive user interaction and preference information.
Methods
Proposes MRMMIA: use an auxiliary LLM to generate multiple recall probes for a candidate statement centered on atomic topics with follow-up rationale questions, query the agent and then score responses according to the access setting—black-box uses LLM scoring, gray-box adds token log probabilities, white-box further adds retrieved memory similarity, and the aggregate is compared with a threshold.
Experiments and results
On the Qwen2.5-7B-Instruct backbone, with the two memory backends Mem0 and MemGPT and three datasets, the authors state that MRMMIA outperforms the baselines under every access setting, with the largest gap at low FPR; a system-prompt defense only slightly reduces the metrics; when holding only semantically similar candidates, performance drops but still outperforms baselines holding exact candidates.
Limitations and future work
The authors note that the experimental datasets consist mainly of everyday conversation and personal facts, do not cover scenarios requiring domain expertise or broader world knowledge, and study only chat agents, not complex systems involving planning, tool use, and multi-agent collaboration; the experiments are conducted on only one 7B backbone model.
Experimental setupQwen/Qwen2.5-7B-Instruct · PerLTQA、LoCoMo et al. · ROC-AUC、PR-AUC et al.
Evaluated models
Qwen/Qwen2.5-7B-Instruct
Benchmarks
PerLTQALoCoMoMSC
Metrics
ROC-AUCPR-AUCTPR@FPR1%
AI summaryThe researchers propose MRMMIA, a membership inference attack method targeting chat agent memory, used to determine whether a given candidate memory unit belongs to an agent's memory store. The method extracts membership signals by launching multiple recall probes against the agent, covering black-box, gray-box and white-box settings; the authors' experiments show that MRMMIA consistently outperforms baseline methods. The authors state that this result reveals the privacy risks of agents and provides a preliminary evaluation framework for membership leakage in chat agent memory systems. Prior membership inference research mainly focused on training corpora or retrieval databases, while the agent memory scenario has received less attention.

The researchers propose MRMMIA, a membership inference attack method targeting chat agent memory, used to determine whether a given candidate memory unit belongs to an agent's memory store. The method extracts membership signals by launching multiple recall probes against the agent, covering black-box, gray-box and white-box settings; the authors' experiments show that MRMMIA consistently outperforms baseline methods. The authors state that this result reveals the privacy risks of agents and provides a preliminary evaluation framework for membership leakage in chat agent memory systems. Prior membership inference research mainly focused on training corpora or retrieval databases, while the agent memory scenario has received less attention.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The study investigates membership inference attacks (MIA) against the persistent memory of chat agents; the authors state that this attack surface had previously been overlooked.

    Core question: given a candidate statement, can an attacker determine whether it exists in a chat agent's memory store.

    • Setting and importance: chat agents persistently write user conversation fragments, preferences, and inferred personal facts during interaction, which the authors argue makes the memory module a privacy-sensitive attack surface; confirming that a record belongs to the system's private data can itself leak user information.
    • Gaps in existing work: the authors state that prior MIA mainly targets training corpora and RAG retrieval databases; Wang et al. [25] study extracting original content from agent memory, whereas membership inference targeting memory has been "largely overlooked."
    • Three challenges: memory units are highly compressed short statements, so loss and token-probability signals are weak; memory units are related to each other, so non-member content may be inferred from other memories; memory content overlaps with the model's parametric priors, so responses may come from priors rather than the target memory.
    • Paper contributions: formalize the chat agent memory membership inference problem; propose the MRMMIA attack, covering black-box, gray-box, and white-box access settings; provide a preliminary evaluation protocol, and the authors state that experiments show MRMMIA outperforms the compared baselines.
    • Threat model:
      • Target: under the Exact Membership Rule, determine whether candidate statement x is exactly identical to some memory unit (Appendix D discusses a semantic-equivalence rule).
      • Knowledge: the attacker holds the exact candidate statement x; the authors acknowledge this is a strict assumption.
      • Capabilities: black-box can only observe response text; gray-box additionally obtains output token probabilities; white-box can access the retrieved memory units.
      • Restrictions: cannot modify or poison the memory store, access the system prompt, view the full memory store, control the memory write policy, or read other users' memories.
  2. What related research exists?

    Related work falls into three categories: classical and LLM membership inference, RAG membership inference and data extraction, and agent memory privacy attacks.

    Membership inference for classical machine learning and LLMs

    • Shokri et al. (2017), Yeom et al. (2018)—infer training-set membership from differences in confidence or loss between members and non-members; Carlini et al. (2022) improve reliability at low false-positive rates with a likelihood-ratio test calibrated by per-sample shadow distributions.
    • For language models where shadow models cannot be trained: loss/perplexity scoring and reference-model calibration in Carlini et al. (2021); paraphrase-neighborhood comparison in Mattern et al. (2023); low-probability token aggregation (Min-K) in Shi et al. (2024) and Zhang et al. (2025); self-calibrated reference models for fine-tuning scenarios in Fu et al. (2024).

    Membership inference and leakage in RAG systems

    • Anderson et al. (2025), Li et al. (2024), Liu et al. (2025), Naseh et al. (2025)—in RAG the model is not trained on the retrieval database, so attacks rely on retrieval and grounding behavior; probe designs include direct yes/no questions, semi-document continuation, masked fill-in-the-blank, and covert sets of document-related questions.
    • Zeng et al. (2024), Qi et al. (2024)—study extraction rather than inference: leaking retrieved documents from the context window using adversarial prompts and instruction-following vulnerabilities.

    Privacy risks of LLM agents

    • Wang et al. (2025)—black-box extraction of historical user queries from agent memory; Chen et al. (2024) (AgentPoison)—poisoning the agent's long-term memory or knowledge base to implant backdoor triggers.
    • The paper states that these works establish agent memory as an attack surface, but focus on extracting original content or implanting adversarial behavior; membership inference targeting memory still lacks systematic study.

    Baselines and benchmarks: the experiments compare five baselines—Loss [3], MinK [23], Reference [14] (gray-box only), Naive Probe, Interrogation Attack (IA) [15]; evaluated on three memory datasets: PerLTQA, LoCoMo, MSC. In the method section, the paper notes that the RAG MIA methods of Naseh et al. [15] and Anderson et al. [1] rely on multiple yes/no questions that directly ask about membership, and in the memory setting the answer may be inferred from other memory units, so they may not be applicable.

    The authors position this paper as: introducing membership inference, a paradigm complementary to extraction attacks, into the agent memory setting, and providing a unified attack and preliminary evaluation framework covering three access settings.

  3. How does the paper address this problem?

    MRMMIA uses an auxiliary LLM to generate multiple recall probe queries for the agent, then scores the responses according to the access setting and aggregates them to determine membership.

    MRMMIA (Multi-Recall Memory MIA) overall idea: if the candidate statement is in memory, the agent should be able to answer various detailed follow-up questions about it precisely and give a basis; if not, the agent can only infer from related memories and cannot answer all details or give a reliable reason. The attack has two steps: generate multiple recall queries, then probe the agent and score the responses (Figure 1, Algorithm 1).

    Problem formalization

    • Memory membership is determined by the Exact Membership Rule: Rexact(x, M) = 𝕀[∃ mi ∈ M s.t. x = mi], i.e., the candidate statement counts as a member only if it is verbatim identical to some memory unit; the authors state this avoids the ambiguity of semantic matching.
    • The attack outputs Ac,R(x; F) → {0,1}, where 1 means predicted as a member; Appendix D defines a variant under a semantic-equivalence rule.

    Recall query generation

    • An auxiliary LLM (query generator Gq) generates K probes for the candidate statement, following three criteria:
      • Atomic topics: each probe asks about only one aspect of the candidate statement, with the remaining details as context.
      • Ask for reasons: require the agent to state the source of its answer (e.g., "how do you know"), which the authors state can extract more signal and make it harder for the agent to guess the attack intent.
      • Diversity: cover different aspects such as time, place, and objects; when topics are insufficient, rewriting old questions is allowed.
    • Appendix B.2 gives the full query-generation prompt template (Figure 6), requiring output of topic, expected answer, and question.

    Probing and scoring

    • black-box: scoring model Mr takes the candidate statement, query, and response as input, outputs a match-degree classification, and the score is sb = 1/K∑i wr Mr(x, qi, ri).
    • gray-box: adds the average log probability of the response tokens to the black-box score, with weight wp.
    • white-box: additionally adds a memory-similarity term: auxiliary model Mm compares the candidate statement with the retrieved memory units, takes the maximum, with weight wm.
    • The K probe scores are averaged and compared with threshold γ; a score not below γ is judged as a member.

    Key parameters and implementation

    • Default K = 5, weights wr = wp = wm = 1.0; the target agent backbone is Qwen/Qwen2.5-7B-Instruct, served via vLLM's OpenAI-compatible endpoint.
    • The query generator Gq, response scorer Mr, and memory scorer Mm all use Qwen/Qwen2.5-7B-Instruct; the authors state that memory units are mostly short statements, so a 7B open-source model suffices.
    • Scoring uses four discrete levels: 1.0 / 0.67 / 0.33 / 0.0; the authors state discrete scores are more stable than continuous scores and easier to control with scoring rubrics (Appendix B.2; scoring prompts in Figures 7, 8).

    Success determination

    • Report ROC-AUC, PR-AUC, and TPR@FPR1% following membership inference evaluation conventions; member memory units are injected directly into the agent's memory store, non-members are not injected, and splits are by user to control semantic similarity.
  4. What experiments did the paper conduct?

    Compares 5 baselines across 2 memory backends × 3 datasets × 3 access settings, and conducts ablation, defense and semantically similar candidate experiments.

    Experimental setup

    • Systems under test: Two local memory-augmented chat agent backends, Mem0 and MemGPT, both with a Qwen/Qwen2.5-7B-Instruct backbone.
    • Datasets: PerLTQA (140 users, 16,605 memory units, 8,048 members / 8,557 non-members, up to 20 members + 20 non-members tested per user), LoCoMo (10 users, 2,541 units, 1,268 / 1,273), MSC (964 user pairs, 9,824 units, 5,171 / 4,653), all split into members/non-members by user or session (Appendix A).
    • Baselines: Loss, MinK, Reference (gray-box only; Reference requires building a reference agent without target memory, which the paper calls an oracle-style baseline), Naive Probe, IA (K=5, aligned with MRMMIA in query count and scoring criteria).
    • Metrics: ROC-AUC, PR-AUC, TPR@FPR1%; Appendix C adds Acc.@1%, TPR@10%, [email protected]%.
    • Repeats: Each evaluation is run 3 times, reporting mean and standard deviation.
    • Default parameters: K = 5, wr = wp = wm = 1.0.

    Main results

    According to Table 2 (gray-box setting, TPR@FPR1%):

    Swipe horizontally to read the table

    Memory backendDatasetLossMinKReferenceNaive ProbeIAMRMMIA
    Mem0PerLTQA2.7%2.5%24.0%24.2%26.0%78.3%
    Mem0LoCoMo1.5%1.6%7.2%6.5%13.5%55.9%
    Mem0MSC6.2%6.2%39.5%47.6%49.5%87.2%
    MemGPTPerLTQA7.4%7.4%44.7%43.1%47.0%81.3%
    MemGPTLoCoMo4.4%4.4%13.9%17.3%13.6%63.4%
    MemGPTMSC6.0%6.5%73.3%73.5%61.4%92.0%
    • The authors claim MRMMIA outperforms baselines under all three access settings, both backends and all three datasets, with the largest gaps at low FPR; under black-box, MRMMIA's TPR@FPR1% is 45.2%–91.4%, while Naive Probe is 0.0% throughout and IA is mostly 0.0% (Table 1).
    • Under white-box, MRMMIA's TPR@FPR1% reaches 86.4%–99.0%, with ROC-AUC mostly 0.99–1.00 (Table 3).
    • The authors argue this shows that directly porting LLM or RAG MIA methods is insufficient for the agent memory setting.

    Ablation: number of probes and follow-up rationale

    • Number of probes K: On PerLTQA + Mem0, increasing K improves all metrics when K < 5, and plateaus after K ≥ 5 (Figure 3); the trend is the same on MemGPT (Figure 10). The authors speculate that saturation stems from the low information content of memory units, with about 5 questions sufficient to cover them.
    • Follow-up rationale questions: Under black-box, removing the follow-ups lowers metrics on all datasets, with TPR@FPR1% dropping to 0% (Figure 5); the gap is smaller under gray-box and white-box (Figures 11, 12). In the example in Figure 4, without follow-ups the agent conflates application features with user behavior, while with follow-ups it gives a clear inferential answer.

    Evaluation of system prompt defense

    • The defense states in the system prompt that memory is private and forbids revealing or confirming specific memory details; evaluated on PerLTQA (Table 4).
    • Under black-box, Mem0's TPR@FPR1% falls from 72.1% to 68.9%, and MemGPT from 77.0% to 75.0%; gray-box shows similar decreases; white-box is almost unchanged (e.g., Mem0 from 96.3% to 96.2%).
    • The authors say a simple system prompt defense cannot fully prevent memory leakage, and argue this highlights the importance of finding reliable defenses.

    Semantically similar candidates (Appendix D)

    • The variant MRMMIAs simulates the case where the attacker holds only rewritten, semantically similar candidates x′.
    • Performance drops across the board relative to MRMMIA with exact candidates, e.g., on gray-box, Mem0, LoCoMo, TPR@FPR1% falls from 55.9% to 40.8% (Table 8); the authors attribute this to decreased scoring accuracy.
    • The authors say MRMMIAs still outperforms baselines holding exact candidates (IA is 13.5% under the same conditions).

    Other ablations and analyses

    • Weight wp (gray-box, LoCoMo + Mem0): performance improves as the weight increases when below 1.0, and plateaus above 1.0 (Figure 13).
    • Weight wm (white-box, LoCoMo + Mem0): the same trend (Figure 14).
    • On the supplementary metrics Acc.@1%, TPR@10%, [email protected]%, MRMMIA likewise outperforms all baselines (Tables 5–7).
  5. What are some points that can be further explored?

    The authors list two types of limitations, dataset domain and agent complexity, and propose three defense directions yet to be validated.

    Limitations and future directions noted by the authors

    • The experimental datasets center on everyday conversation and personal facts and do not cover scenarios requiring deeper domain expertise or broader world knowledge; the authors consider these scenarios harder and more valuable for research (Section 7).
    • Only chat agents are studied, not complex agent systems with richer planning, tool use, or multi-agent collaboration; the authors list evaluation on more complex datasets and agent architectures as future work (Section 7).
    • Appendix E proposes three potential defenses but does not experimentally validate them: output-level (stricter output filtering), retrieval-level (similarity thresholds, retrieval-ranking randomization, embedding noise addition, with a privacy-utility trade-off), and memory-level (rewriting or generalizing before storage, adding differential privacy at write time, filtering highly identifiable information).
    • The authors note a challenge shared by all three defenses: memory units are related to each other, so protecting a single unit may not prevent an attacker from reconstructing membership signals from related memories; systematically studying these defenses is future work (Appendix E).

    Scope of experimental coverage

    • The only tested model is one backbone, Qwen/Qwen2.5-7B-Instruct, with two memory backends, Mem0 and MemGPT (Section 5.1).
    • The datasets are three: PerLTQA, LoCoMo, MSC, with member/non-member splits by user or session (Appendix A).
    • Defense evaluation covers only one system-prompt defense and is conducted only on the PerLTQA dataset (Table 4).
    • The auxiliary models (query generation, response scoring, memory scoring) are all Qwen/Qwen2.5-7B-Instruct; the paper does not report experiments using other models in these roles.
    • Each evaluation is repeated 3 times and standard deviations are reported; the paper does not report the total number of attack queries or the time cost.
  6. Summarize the main content of the paper

    The membership inference attack MRMMIA targeting chat agent memory outperforms baselines under three access settings, and a simple prompt defense has limited effect.

    A paper on privacy attacks: studying the feasibility of membership inference attacks (MIA) on chat agents' persistent memory, a previously less-studied attack surface.

    • Problem: Determine whether a candidate statement exists in the agent's memory store. The authors note that memory units are short and compressed, interrelated, and overlap with model priors, weakening the MIA signal of traditional LLM/RAG.
    • Method: MRMMIA uses an auxiliary LLM to generate K=5 recall probes centered on atomic topics with follow-up rationale questions, and scores them according to the access setting—black-box uses an LLM to score responses, gray-box adds token log probabilities, white-box further adds retrieved memory similarity, and the aggregate is compared with a threshold.
    • Main results: On a Qwen2.5-7B-Instruct backbone, Mem0/MemGPT backends and the three datasets PerLTQA, LoCoMo and MSC, the authors claim MRMMIA outperforms five baselines under every access setting; on gray-box, Mem0, LoCoMo, TPR@FPR1% rises from 13.5% for IA to 55.9% (Table 2).
    • Ablation: Performance saturates after K ≥ 5; under black-box, removing the follow-up rationale questions reduces TPR@FPR1% to 0% (Figure 5).
    • Defense: System prompt defense brings only a small decrease, with almost no effect under white-box (Table 4); performance drops when only semantically similar candidates are held, but still outperforms baselines holding exact candidates (Table 8).
    • Authors' conclusion: Agent memory is a concrete privacy attack surface, and more work is needed to safeguard agent privacy and security; the authors list more complex datasets, more complex agent architectures and systematic defense research as future directions.

Related papers

Read originalarxiv.org