Skip to content

No Attacker Needed: Unintentional Cross-User Contamination in Shared-State LLM AgentsNo Attacker Needed: Unintentional Cross-User Contamination in Shared-State LLM Agents

arXiv· arXiv:2604.01350· Tiankai Yang, Jiate Li, Yi Nian, Shen Dong, Ruiyao Xu, Ryan Rossi, Kaize Ding, Yue Zhao·Indexed by this site · 2026-10-12· Originally publishedSelected EvaluationSelectedAttention40

Quick read

Evaluation and benchmarks

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

The authors report that under benign interactions, GPT-4o's overall contamination rate on eICU is 70.7% (Table 2).

Questions
When an agent reuses shared state across users, a convention that is locally effective for one person may be misapplied to another, without requiring an attacker. The authors state this can silently change answers, code, or tool behavior.
Methods
The authors define unintentional cross-user contamination using controlled comparisons with and without source interactions, divide it into semantic, transformation, and process types, and use SSI to clean content entering shared storage at write time.
Experiments and results
On GPT-4o, overall contamination rates under the original shared state: Slack 57.4%, MIMIC-III 59.6%, eICU 70.7% (Table 2). After SSI, the main text gives Slack 6%, eICU 33%, MIMIC-III 41%, without explaining the conversion from the table's decimals.
Limitations and future work
The authors state that SSI only changes writes, not reads, and residual contamination continues to propagate; directions include source metadata, re-validation before reuse, and artifact-level scope control. The experimental backbone is GPT-4o, with comparisons being the original state and SSI; the paper does not report agreement between the judge and humans.
Experimental setupGPT-4o · EHRAgent、MURMUR et al. · contamination rate
Evaluated models
GPT-4o
Benchmarks
EHRAgentMURMURMIMIC-IIIeICUSlack workspace dataset
Metrics
contamination rate
AI summaryand selection rationaleThe researchers propose and formalize unintentional cross-user contamination (UCC) in shared-state LLM agents: locally valid information left by one user's benign interaction is persisted, then incorrectly reused by other users, silently altering answers, code, or tool behavior. The paper gives a taxonomy of contamination into semantic, transformation, and process categories, and evaluates on EHRAgent with shared memory (MIMIC-III, eICU) and MURMUR with shared context (Slack), with contamination rates of 57.4%–70.7% under the original shared state. The write-time sanitization method SSI reduces contamination from 57% to 6% on Slack, but only from 60% to 41% on EHRAgent, because SSI only sanitizes text fields and cannot remove conventions already encoded in the solution code.

The researchers propose and formalize unintentional cross-user contamination (UCC) in shared-state LLM agents: locally valid information left by one user's benign interaction is persisted, then incorrectly reused by other users, silently altering answers, code, or tool behavior. The paper gives a taxonomy of contamination into semantic, transformation, and process categories, and evaluates on EHRAgent with shared memory (MIMIC-III, eICU) and MURMUR with shared context (Slack), with contamination rates of 57.4%–70.7% under the original shared state. The write-time sanitization method SSI reduces contamination from 57% to 6% on Slack, but only from 60% to 41% on EHRAgent, because SSI only sanitizes text fields and cannot remove conventions already encoded in the solution code.

Why it was selectedThe paper quantifies the cross-user contamination rate of shared-state agents through controlled experiments and points out that text-level cleaning still leaves residual risk for shared states containing executable artifacts.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Without an attacker, shared state can misapply locally valid conventions to other users.

    Shared state can misapply a convention that is only locally valid for one user to another user and change their outcome.

    • Scenario: The authors state that many agents save memory, trajectories, summaries, or retrieval results for long-horizon tasks; in teams or organizations, the same agent also reuses this persistent state layer across users. Information that is reasonable for one person may be reused when serving another.
    • Existing gaps: The authors state that existing integrity work mainly studies explicit attackers, including indirect prompt injection, malicious tool induction, and poisoning of memory or retrieval sources. Dong et al. (2025) and Patlan et al. (2025) wrote about cross-user shared state but still assume an attacker and optimize source interactions to cause downstream harm.
    • Core observation: Source interactions can be benign and locally valid, such as local explanations, aggregation or format choices, or task-flow decisions. Failure occurs when the agent later treats them as universally valid for other users. Figure 1 annotation: with no prior, the answer is 0 and correct; after one user clarifies "last year" as "past 12 months," the answer is 2 and correct; a later user gets 2, marked as incorrect.
    • Setting: The source user is not an attacker; source interactions need not contain hidden instructions, malicious triggers, or optimized harmful goals. A shared-state segment influences a later different user's decision, and that reuse reduces correctness or task utility, i.e., unintentional cross-user contamination (UCC). The victim system is the same LLM agent serving multiple users and reading/writing persistent shared state.
    • Contribution: Formalize UCC in a shared-state model, define a controlled comparison protocol and three contamination types, and evaluate write-time cleaning Sanitized Shared Interaction (SSI) on shared memory and shared conversation context.
  2. What related research exists?

    Close work assumes an attacker optimizes source interactions; the authors position this as erroneous reuse of benign artifacts.

    The authors view recent cross-user work as attacker-driven and position this paper on the erroneous reuse of benign source interactions.

    • Persistent memory and multi-user deployment: Reflexion (Shinn et al., 2023) uses verbal reflection for episodic memory; MemGPT (Packer et al., 2024) offloads context to external storage; A-Mem (Xu et al., 2025) does dynamic indexing; Sumers et al. (2023) and Zhang et al. (2025b) organize memory by type. The paper states that these states become shared states in multi-user or collaborative deployments (Hong et al., 2023; Qian et al., 2025; Park et al., 2023; Rezazadeh et al., 2025), and existing memory designs do not explicitly manage cross-user transfer.
    • Adversarial integrity failures: Indirect prompt injection (Greshake et al., 2023; Yi et al., 2025; Liu et al., 2024; Zhan et al., 2024) and tool-channel attacks (Fu et al., 2024; Debenedetti et al., 2024; Zhang et al., 2025a; Li et al., 2026) study hijacking after untrusted content enters the context. Chen et al. (2024), Zou et al. (2025), and Xue et al. (2024) extend failures to poisoned memory or retrieval sources. The paper also mentions write-time memory filtering (Wei et al., 2025), input-output guardrails (Inan et al., 2023), and conflicting knowledge detection (Xu et al., 2024). The paper states these settings are primarily adversarial, focusing on whether carefully crafted content achieves a specified harmful goal.
    • Cross-user attacks via shared state: MINJA (Dong et al., 2025) studies injection into shared memory only through queries, causing a record written by one user to be retrieved and executed in another user's interaction. MURMUR (Patlan et al., 2025) studies collaborative agents with persistent shared context, where one user's messages can influence others in the group over time. The paper states both assume an attacker and optimize source interactions to cause downstream harm; this is the closest work to this paper.
    • Baselines and data: The experimental comparisons are the original shared state and write-time sanitized SSI. The environments and data are MIMIC-III and eICU on EHRAgent, and MURMUR's Slack workspace data.

    The authors' positioning is a complementary scenario: source interactions are benign, locally valid, and not optimized for harm; failures come from erroneous reuse, not malicious intent. The focus is robustness under shared-state reuse, not attack design.

  3. How does the paper address this problem?

    Use controlled comparisons to measure three types of contamination, and clean the shared state with SSI at write time.

    The authors frame the problem as a failure of shared state scope, using controlled comparisons with and without source interaction to identify unintended cross-user contamination (UCC); the mitigation attempt is SSI on the write path.

    Shared State Model

    • Three operations: write W updates the shared state after each interaction, read R retrieves or presents prior state for subsequent interactions, and agent function f produces outputs and environment actions given the current request and state.
    • Update: after one service, St+1=W(St,ut,xt,yt,at), i.e., writing that user's input, output, and actions into the shared state.
    • Two instances: in shared memory, the state is an explicit record, and R retrieves segments relevant to the current task. In shared context, the state is a persistent draft or summary, and R presents a reusable context view.
    • Local validity: the authors state that interactions may leave conventions, temporary exceptions, project shorthand, or user preferences that are only correct in the original context; the system may save these artifacts without saving their validity conditions.

    Contamination Definition and Three Types of Effects

    • UCC: a segment es written by user us influences the decisions of later user uv (different from us); es is only locally valid for the source interaction, and this reuse reduces the correctness or task utility for the later user. The source user is not an attacker.
    • Semantic contamination (SC): persistent artifacts change the interpretation of subsequent requests, with failures manifesting as irrelevant answers. The example in Table 1 is treating "last year" as the past 12 months rather than the calendar year.
    • Transformational contamination (TC): inheriting aggregation, filtering, normalization, deduplication, or summarization rules; the evidence remains, but the result is rewritten. The example in Table 1 is rounding fees to integers.
    • Procedural contamination (PC): changing action patterns, default workflows, or tool use sequences. The example in Table 1 is applying a rule for counting unique patients to a query expecting total occurrence counts. The three types are not mutually exclusive.

    Controlled Evaluation Protocol

    • Comparison: St is the shared state before the source interaction, and St+ is the state after writing the source interaction. For the same victim interaction, run f in both the clean state and the contaminated state, and compare outputs and actions.
    • Judgment: if the behavior change is attributable to the newly added state segment and is harmful according to the victim task specification, it is recorded as contamination from the source interaction. The authors state the goal is not to eliminate all cross-user transfer, but to identify cases where shared state changes subsequent behavior for the wrong reasons.
    • Instances: manually designed source conventions that are reasonable in the original context but cause verifiable errors when reused. For each, semantically relevant victim tasks are selected from the original evaluation set, up to 3; victim tasks are pre-screened to succeed without cross-user contamination. EHRAgent modifies structured memory entries; Slack involves 4-turn dialogues where the user states preferences and the agent confirms (Appendices A, B). Full instructions are in Appendix G, not repeated here.

    Write-Time Cleaning SSI

    • Location: inserted only on the write path. When an interaction is about to be persisted, the cleaner rewrites the raw trace into a version that retains reusable content and removes scope-restricted artifacts; if it cannot safely separate, it abstains and writes nothing.
    • Form: τ̃t=h(τt), resulting in a cleaned trace or NONE. Only if not NONE is the state updated with the cleaned trace; otherwise, the state remains unchanged. Subsequent reads still use the original R.
    • What is removed: the authors state that core task requests, factual content, and steps relevant to the solution are retained, while user-specific preferences, formatting or aggregation instructions, local interpretation overrides, and procedural conventions are removed.
    • Two implementations: h is implemented by an LLM rewriter, with full prompts in Appendix F. EHRAgent's traces contain the question, retrieved knowledge, and generated answer; the cleaner rewrites these fields and applies deterministic post-processing to remove residual contamination cues. MURMUR processes user and assistant messages before appending to the persistent shared context. The paper does not write out the post-processing rules in the main text.
    • Boundary: SSI does not modify the read path, reasoning, or retrieval. The authors treat it as a practical baseline, not a complete solution (Section 4.2).
  4. What experiments did the paper conduct?

    Table 2 overall contamination rates are 57.4%, 59.6%, 70.7%; after SSI on Slack, the main text writes 6%.

    Under the original shared state, the overall contamination rates in Table 2 are 57.4%, 59.6%, and 70.7%; after write-time cleaning, the main text reports Slack as 6%.

    Experimental Setup

    • Models and environments: The agent backbones are all GPT-4o with temperature 0. EHRAgent is a code-generation agent for clinical database queries, maintaining shared long-term memory; data are MIMIC-III and eICU. MURMUR's full interaction history is visible across sessions; data are Slack workspaces. Appendix E states that MURMUR's user simulator, natural language assertion judge, and the SSI sanitizers on both sides are also gpt-4o.
    • Instance scale: Table 3: MIMIC-III has SC 3, TC 5, PC 3, totaling 11; eICU has 3, 7, 4, totaling 14; Slack has 3, 3, 3, totaling 9; combined 34. Each instance has at most 3 victim tasks. The paper does not report the total number of victim tasks or victim runs.
    • Comparisons and metrics: The comparisons are the original shared state and SSI. The contamination rate is the proportion of victim runs where the output changes due to the presence of source interactions in the shared state (Section 5.1). Section 3.4 also requires the change to be attributable to the added segment and harmful according to the victim task specification.
    • Judgment: EHRAgent uses relaxed normalized exact match against the standard answer. MURMUR uses gpt-4o as an LLM-as-a-judge to check whether behavior reflects the source convention (Appendix E). The paper does not report agreement between this judge and humans.
    • Retrieval and repetition: EHRAgent uses cosine similarity with all-MiniLM-L6-v2, taking top-4. Initial memory has 4 seed entries; after writing source interactions, it becomes 5. Source and victim queries are designed to be semantically similar, so retrieval of the source entry is expected by construction. Each instance is run 3 independent trials and the average contamination rate is reported; EHRAgent resets memory between trials.

    Main Results

    Victim tasks are pre-screened to succeed without contamination. According to Table 2, units are contamination rate (%), backbone is GPT-4o, setting is original shared state:

    | Environment | Dataset | SC | TC | PC | Overall | | EHRAgent | MIMIC-III | 59.3 | 68.9 | 44.4 | 59.6 | | EHRAgent | eICU | 88.9 | 66.7 | 63.6 | 70.7 | | MURMUR | Slack | 83.3 | 20.0 | 66.7 | 57.4 |

    • Authors' interpretation: The authors state that contamination rates are high across all three datasets, even though source interactions are not adversarial and not optimized for downstream harm; benign interactions alone are sufficient to cause widespread contamination through shared state.
    • Type varies with mechanism: The authors believe the dominant type reflects the shared-state mechanism. On EHRAgent, SC and TC are higher and PC lower, because contamination propagates through structured examples, local fields are more easily retrieved and reused, and the overall process is harder to fit into a single record. On Slack, SC and PC are higher and TC lower, because the agent treats the full text history as context, explanations and processes in conversation are more easily taken as implicit norms, and format conventions in plain-text messages less often affect correctness.
    • Abstract wording: The abstract writes the contamination rate under the original shared state as 57–71%, which is the authors' summary, not the exact numbers in Table 2.

    Write-Time Cleaning

    • Overall: Figure 3 and Section 5.4 compare with and without SSI. The main text, when naming datasets, writes Slack 57%→6%, eICU 71%→33%, MIMIC-III 60%→41%. These integers do not exactly match the one-decimal values in Table 2, and the paper does not explain the conversion.
    • By type: The main text writes TC on eICU as 67%→7% and on MIMIC-III as 69%→47%; PC on MIMIC-III as 44%→41% and on eICU as 64%→50%. SC is written as 59%→28% and 89%→63%, without labeling the dataset for each. The authors state that on Slack all three types are reduced to near zero; the figure's plain text shows 0 and 7, but column alignment is unreliable, so these are not assigned to specific types here.
    • Authors' interpretation: The authors state that MURMUR's shared state can be cleaned message by message, and after removing the convention text, no trace remains. EHRAgent's memory contains solution code; SSI cleans the text description but does not modify the solution code in the retrieved memory, so the convention remains in the code and propagates through example reuse. The authors believe local conventions fall in identifiable code positions and could in principle be removed with targeted code-level interventions; PC shapes join order, intermediate aggregations, and control flow, with no single line to delete, so the authors state that even code-level cleaning would be difficult to remove. The authors also state that MIMIC-III has 17 tables, 2.7 tables per query, and over 50% of queries require 3 or more joins, making independent code generation harder and the agent more likely to copy templates.

    Failure Modes

    • What was measured: EHRAgent classifies contamination outcomes into wrong answer (confident but incorrect) and no answer (no result produced). Figure 4's x-axis is the share of failures (%), with legend entries Wrong answer and No answer.
    • Results: The main text writes that on MIMIC-III, no-answer failures account for 41% of all failures under both conditions; Figure 4 also prints 59% and 41%. For eICU, Raw prints 98% and 2%, SSI prints 84% and 16%. The figure caption says "under raw shared state," but the figure also includes the SSI row. The main text states that eICU failures are almost all wrong answers, consistent with 98% for wrong answer and 2% for no answer; 84% and 16% are not separately written in the main text.
    • Authors' interpretation: The authors attribute the difference to pattern complexity and reliance on retrieved code: in more complex multi-table settings, contaminated query logic is more likely to fail entirely; in simpler patterns, contaminated code may still execute but produce incorrect results. The authors believe these undetectable wrong answers would be missed without external verification.

    Other Ablations and Analyses

    • The paper does not report parameter sweeps beyond temperature, retrieval count, or sanitizer; temperature is fixed at 0, retrieval is fixed at top-4 (Appendix E).
    • Source entries being retrieved is expected by construction due to semantic similarity of queries; the paper does not separately report retrieval hit rates (Appendix E).
    • Appendix C uses one example from each of the three types to illustrate how benign conventions become cross-user instructions; Appendix D shows that after the question field is cleaned, the solution code still carries the convention. The original queries are not reproduced here.
  5. What are some points that can be further explored?

    The authors state that after text sanitization at write time, cross-user contamination can still remain in executable artifacts.

    Limitations and Future Directions Noted by the Authors

    • Scope of SSI: it intervenes only at write time, not modifying the read path, agent reasoning, or retrieval; the authors state that any contamination surviving cleaning continues to propagate unchecked, and they treat SSI as a practical baseline rather than a complete solution (Section 4.2).
    • Directions in the discussion: annotating persistent artifacts with source metadata (which user, which task, what scope), enforcing re-validation before cross-user reuse, and regenerating answers from cleaned specifications rather than reusing compiled code (Section 5.7).
    • Directions in the conclusion: the authors believe shared-state agents need defenses beyond text-level cleaning, especially artifact-level scope control and retrieval with source information, to limit cross-user contamination while preserving the utility of shared state (Section 6).

    The paper has no separate Limitations section discussing whether the evaluation generalizes. The ethics statement says public data are used and no adversarial attacks are designed, and it is not counted as a research limitation.

    Experimental Coverage

    • Backbone: the agent, MURMUR user simulator, assertion judge, and SSI cleaner are all gpt-4o, with generation temperature 0 (Appendix E).
    • Environments and scale: EHRAgent's shared memory uses MIMIC-III and eICU, MURMUR's shared dialogue context uses Slack; 34 source conventions (Table 3).
    • Protocol: each source convention has at most 3 victim tasks, pre-screened to succeed without cross-user contamination; each source–victim pair has 3 independent trials (Section 5.1, Appendix B, Appendix E).
    • Judgment and retrieval: EHRAgent uses exact matching against standard answers, MURMUR uses gpt-4o as LLM-as-a-judge; retrieval is all-MiniLM-L6-v2, top-4, with a memory bank of 4 seed items plus 1 source interaction (Appendix E).
    • Unreported items: the paper does not report the total number of victim runs, agreement between LLM judgment and human judgment, or the number of cleaner abstentions.
  6. Summarize the main content of the paper

    The authors report that benign interactions can cause cross-user contamination, and text sanitization does not block code memory.

    UCC is a robustness problem on shared-state LLM agents: source interactions can be benign, and locally valid artifacts can still be misapplied to other users later.

    • Problem: An agent saves state across sessions and serves multiple users in a team or organization. Local explanations, transformation rules, or process decisions, once they enter shared memory or shared context, can change another user's answers, code, or tool behavior. The authors separate this from memory poisoning and cross-user attacks that require an attacker.
    • Approach: Describe shared state with writes, reads, and agent functions; compare the same victim interaction under a clean state versus a state with source interactions written in. Contamination is divided into semantic, transformation, and process types. SSI uses an LLM to rewrite traces before writing, abstains from writing when safe separation is not possible, and does not change reads. Instances are built on EHRAgent (MIMIC-III, eICU) and MURMUR (Slack), with GPT-4o as the backbone.
    • Original state: Table 2 overall contamination rates are 57.4%, 59.6%, and 70.7% on Slack, MIMIC-III, and eICU, respectively. Victim tasks are pre-screened to succeed without contamination. The authors state the dominant type varies with mechanism: semantic and transformation are higher on structured memory, while semantic and process are higher and transformation lower on conversation context.
    • After cleaning: The main text reports overall rates become Slack 6%, eICU 33%, MIMIC-III 41%. The authors state that on conversational state, after text removal there is almost no residue; when solution code is present, text cleaning does not block conventions in the code. The main text writes process type on MIMIC-III as 44%→41% and on eICU as 64%→50%, and states it has the smallest reduction. In Figure 4, under the raw condition on eICU, wrong answers account for 98% of failures and no answers 2%.
    • Authors' conclusion: The authors believe shared state carries both useful context and scope-limited artifacts; in settings that still produce stable results, contamination more often appears as undetectable wrong answers. They suggest artifact-level scope control and retrieval with source information to limit cross-user contamination while preserving the utility of shared state.

Related papers

Read originalarxiv.org