Knowledge Base Regulation Tracker Standards & Frameworks OSS Directory AI Incident Database Research Paper Library Case Studies Society Articles News Jobs About Charter Sign inBecome a Member
Home/AI Incident Database/Google Gemini's long-term memory poisoned through a document using "delayed tool invocation"

Google Gemini's long-term memory poisoned through a document using "delayed tool invocation"

Rehberger showed that a summarised document could instruct Gemini to save false "memories" about the user the next time they typed a common word, corrupting future conversations persistently.

Severity: Mediumgeminimemorydelayed tool invocation

Incident Overview

On February 11, 2025, researchers demonstrated a method to exploit Google’s Gemini Advanced long-term memory feature through a technique involving prompt injection and delayed tool invocation. The attack leveraged a malicious document to manipulate Gemini into storing false user-related information persistently across sessions. This vulnerability affected users of Gemini Advanced, a subscription-based feature designed to retain user-specific data for continuity in conversations. The exploit was confirmed by Google, which classified it as a medium-severity issue with low overall impact but acknowledged the potential for significant individual-level consequences.

The attack vector relied on a user uploading an untrusted document—such as a PDF or text file—and requesting a summary from Gemini. Within the document, hidden instructions were embedded to manipulate the summarization process. These instructions included a covert trigger mechanism: if the user responded with a common word (e.g., 'yes,' 'sure,' or 'no'), Gemini would execute a memory tool to store false information. The false data could include arbitrary claims, such as fabricated personal details (e.g., a nickname, age, or preferences), which would persist in the user’s long-term memory. Subsequent interactions with Gemini would reflect this corrupted data, leading to misinformation or biased responses.

The persistence of these false memories was demonstrated end-to-end. After the user triggered the memory tool by responding to a prompt within the malicious document, Gemini stored the attacker’s chosen data. When queried later about the fabricated information (e.g., 'What is my age?'), Gemini would retrieve and display the false data as if it were genuine. This confirmed that the exploit successfully bypassed Gemini’s safeguards against direct memory manipulation, exploiting instead the model’s reliance on user input to invoke sensitive tools.

The attack was not limited to uploaded documents. While the primary demonstration used a document as the vector, the researcher noted that other indirect channels—such as email attachments or Google Docs—could also serve as entry points. The technique builds on a previously documented method called delayed tool invocation, where an attacker embeds instructions in the chat context to manipulate the model into executing tools at a later stage. In this case, the instructions were disguised within the summarization process, making detection difficult without careful review of the generated output.

Google’s response to the vulnerability was to rate it as a low-impact, abuse-related risk with low likelihood of exploitation. However, the company did not fully address the underlying pattern that enabled the attack. The delayed tool invocation technique had been reported to Google over a year prior, suggesting that the root cause—weaknesses in tool invocation safeguards—remained unresolved. This vulnerability was later exploited in the SafeBreach calendar attacks, further highlighting its broader implications for AI security.

Users of Gemini Advanced were advised to review their saved information regularly via the saved-info page (accessible at https://gemini.google.com/saved-info) and to exercise caution when interacting with untrusted documents. Google also noted that there is a UI indicator when the memory tool is invoked, providing a hyperlink to the saved-info page. However, the researcher emphasized that the attack’s success hinged on social engineering—tricking the user into continuing the conversation—which could be challenging to detect without explicit user awareness or additional safeguards.

The incident underscored broader risks associated with long-term memory features in AI systems. When memories can be manipulated through untrusted inputs, adversaries can stealthily insert or modify information in a user’s storage, potentially influencing future interactions. This risk is compounded as context lengths in large language models grow, making it increasingly difficult to detect hidden instructions within lengthy responses. The researcher also pointed out that similar vulnerabilities had been demonstrated in other AI systems, such as ChatGPT, suggesting that delayed tool invocation and context pollution are recurring challenges in AI security.

Possible Root Cause

  • Delayed Tool Invocation: Gemini’s architecture allowed tools to be invoked not only through direct user commands but also through instructions embedded within the chat context. The attack relied on polluting the chat context with instructions that would trigger tool invocation only when the user provided a specific response (e.g., a common word like 'yes'). Gemini interpreted these responses as direct user commands, bypassing safeguards that would otherwise restrict tool use in untrusted contexts.
  • Weak Safeguards for Untrusted Data: Gemini was designed to restrict the invocation of sensitive tools when processing untrusted inputs, such as uploaded documents. However, this mitigation did not extend to the memory tool, which was vulnerable to delayed invocation. The model’s reliance on user input to confirm tool execution—rather than requiring explicit, standalone commands—allowed attackers to exploit social engineering tactics. By crafting a document that prompted the user to respond in a predictable manner, the attacker could trick Gemini into storing false memories under the guise of user intent.
  • Lack of Explicit User Confirmation: The memory tool did not require explicit user confirmation before persisting new entries. Instead, it relied on contextual cues and user responses to infer intent. This absence of a confirmation step enabled the attack, as Gemini would store false data based solely on the user’s interaction with a malicious document. Even if the user was unaware of the hidden instructions, the model would treat the response as a valid command to invoke the memory tool.
  • Context Pollution and Deception: The attack exploited Gemini’s tendency to retain and act upon instructions embedded within lengthy chat contexts. By embedding covert commands within a benign document summary, the attacker could delay the execution of the memory tool until a later interaction. This technique—termed context pollution*—allowed the attacker to bypass immediate detection while ensuring the false memories would persist across sessions. The growing length of LLM contexts further complicates the detection of such hidden instructions, as malicious payloads can be buried within extensive responses.
  • Incomplete Fixes for Known Vulnerabilities: The delayed tool invocation technique had been reported to Google over a year prior to this incident, yet the underlying issue persisted. The company’s assessment of the vulnerability as low impact may have contributed to a delayed or incomplete mitigation strategy. While Google acknowledged the potential for future fixes, the lack of a comprehensive solution left the memory tool vulnerable to similar exploits, as demonstrated by its reuse in subsequent attacks (e.g., SafeBreach calendar attacks).

Takeaways

The Gemini memory poisoning incident revealed critical vulnerabilities in the design and security of long-term memory features in AI systems. Several key takeaways emerged from the research and Google’s response:

  • Delayed Tool Invocation Remains a Persistent Risk: The technique exploited in this attack—delayed tool invocation—had been previously documented and reported to Google. Its reuse in this incident and subsequent attacks (e.g., SafeBreach calendar attacks) highlights the need for proactive mitigation strategies. Developers must implement robust safeguards to prevent tools from being invoked based on manipulated or inferred user intent, particularly in untrusted contexts.
  • Untrusted Data Requires Strict Isolation: The attack demonstrated that even benign-seeming inputs, such as document summaries, can be weaponized to manipulate AI systems. To mitigate such risks, AI models should enforce strict isolation for untrusted data, including mandatory user confirmation before executing sensitive tools or persisting new memories.
  • User Awareness and Transparency Are Critical: The success of this attack relied heavily on social engineering—tricking users into continuing a conversation with a malicious document. While technical safeguards are essential, user education and transparency are equally important. AI systems should provide clear indicators when sensitive tools are invoked, such as explicit notifications or confirmation prompts. Users should also be encouraged to review their saved information regularly, particularly after interacting with untrusted sources.
  • Long-Term Memory Features Demand Rigorous Auditing: Features designed to retain user-specific data across sessions introduce new attack surfaces that require rigorous security auditing. Developers must conduct thorough threat modeling to identify potential vectors for memory manipulation, including prompt injection, context pollution, and delayed tool invocation. Regular security assessments and red-team exercises can help uncover such vulnerabilities before they are exploited.
  • Context Length Growth Increases Attack Complexity: As large language models support longer contexts, the challenge of detecting hidden malicious instructions grows. Attackers can embed complex payloads within extensive responses, making it harder for models to distinguish between legitimate and manipulated content. To address this, AI systems should implement dynamic context analysis, such as real-time monitoring for anomalous patterns or unexpected tool invocations, particularly in untrusted interactions.
  • Responsible Disclosure and Collaboration Are Essential: The researcher followed responsible disclosure practices by reporting the vulnerability to Google prior to public disclosure. This collaborative approach allowed the company to assess and address the issue, even if the fix was not fully implemented. Developers and security researchers should prioritize transparent communication to mitigate risks across the industry.
  • Similar vulnerabilities have been demonstrated in other AI systems, such as ChatGPT, suggesting that delayed tool invocation and context pollution are systemic challenges. These findings emphasize the need for standardized security frameworks for AI models, particularly those with long-term memory or tool-integration capabilities. Without unified guidelines, the risk of exploitation will persist across platforms.
  • Individual-Level Impact Can Be Significant: While Google classified the vulnerability as low impact overall, the potential consequences for individual users were substantial. False memories could influence decision-making, perpetuate misinformation, or even enable further exploitation (e.g., data exfiltration or policy bypass). This incident serves as a reminder that AI security must consider not only systemic risks but also the potential for targeted manipulation at the user level.
  • Future-Proofing Against Evolving Attack Vectors: As AI systems become more sophisticated, so too will the tactics used to exploit them. The Gemini attack leveraged a combination of prompt injection, social engineering, and delayed execution—a technique that may evolve with advancements in LLM capabilities.

Sources

Contribute

Spot an error, or know a record we should add? Members can propose additions and submit corrections.