ContextLure Hijacks AI Agents via Chat History
Discover ContextLure, a framework hijacking AI agents via benign chat history with 87.3% success. Learn how LLM memory vulnerabilities enable indirect prompt.
TL;DR: Researchers introduced ContextLure, a framework that hijacks AI agents by weaponizing benign chat history with an 87.3% success rate. This finding exposes critical vulnerabilities in LLM memory, proving attackers can exploit accumulated context without prior dialogue contamination.
Key facts
- ContextLure is a red-teaming framework that hijacks AI agents by weaponizing benign chat history, achieving an Attack Success Rate (ASR) of up to 87.3% without prior dialogue contamination.
- The framework exploits LLM memory vulnerabilities by analyzing user and system preferences from past conversations to craft indirect prompt injections that bypass safety guidelines.
- In evaluations using the AgentDojo benchmark, ContextLure achieved an ASR of 67.4%, while specialized tests on the InjecAgent benchmark reached 85.8% for Time-Sensitive conditions.
- ContextLure utilizes three distinct selection policies to identify valuable evidence from dialogue history and employs rewriting strategies like Urgency/Priority matrices to justify unauthorized actions.
- A large-scale study analyzed 1.2 billion URLs across 24.8 million hosts, identifying 15,300 validated instances of indirect prompt injections embedded in non-rendered HTML elements.
The Invisible Weapon in Your Chat History
An AI agent framework called ContextLure can hijack an assistant by weaponizing its own past conversations, achieving a success rate of up to 87.3% without the attacker ever needing to poison the initial dialogue [1][2].
This finding exposes a critical vulnerability in how modern Large Language Model (LLM) agents operate: their memory is also their weakness. As these systems become more capable—handling complex tasks over longer interactions—they accumulate sensitive data about user preferences, task results, and operational constraints [1]. ContextLure, a new red-teaming framework introduced by researchers, demonstrates that an attacker can silently observe this benign conversation history to construct highly effective indirect prompt injections [3].
The core insight is simple but alarming. Attackers do not need control over prior turns or the ability to inject malicious code directly into the active chat window. Instead, they simply watch the AI work, extract useful context from what it has already learned, and then use that evidence to craft a subsequent attack that feels natural to the model [1]. This shifts the threat landscape from direct manipulation to passive exploitation, where the very data intended to improve personalization becomes fuel for adversarial manipulation.
How ContextLure Works
To understand the severity of this vulnerability, it is necessary to look at the mechanics. Indirect prompt injection involves embedding adversarial instructions into external content or tool results that the AI processes on behalf of the user [4][5]. Unlike direct injections, where an attacker explicitly sends a malicious command to the model, indirect attacks hide within the environment the AI interacts with—such as web pages, documents, or, in this case, conversation history [6].
ContextLure addresses two primary challenges: selecting useful evidence from the history and presenting it as a justification for unauthorized actions while leaving the original conversation unchanged [1]. The framework operates by analyzing the dialogue across two dimensions: User Preferences (what the user wants) and System Preferences (how the system behaves) [2]. It utilizes three distinct selection policies to identify which pieces of information are most valuable for constructing an attack [3].
Once evidence is selected, ContextLure transforms it into a malicious request using rewriting strategies. While some reports suggest the use of an Urgency/Priority matrix with four specific strategies [1], other technical breakdowns indicate the framework relies on three distinct conditions: Strategic, Time-Sensitive, and Critical [3]. Regardless of the exact categorization, the goal is to reframe benign historical data into a compelling reason for the AI to bypass its safety guidelines. For instance, if an agent previously learned that a user prefers fast responses over detailed verification, ContextLure can use that preference to justify skipping security checks in a later turn [1].
The effectiveness of this approach is starkly illustrated by benchmark results. In evaluations using the AgentDojo benchmark, ContextLure achieved an Attack Success Rate (ASR) of 67.4% [2]. On the more specialized InjecAgent benchmark, the success rate climbed to 85.8% for Time-Sensitive conditions and reached up to 87.3% in broader tests [1][3]. These numbers demonstrate that attackers can effectively leverage benign interaction evidence in subsequent attacks without prior contamination of the dialogue history [1].
The Broader Landscape of Indirect Threats
ContextLure is not an isolated incident but part of a rapidly expanding threat vector. Indirect prompt injections are already prevalent in the wild, posing significant risks to automated systems and autonomous agents that transition into physical controllers [5]. Large-scale empirical studies have identified thousands of these injections embedded in web resources, often targeting the data pipelines rather than human users directly [4].
One such study analyzed 1.2 billion URLs from 24.8 million hosts, identifying 15,300 validated instances of indirect prompt injections across 11,700 pages [4]. The stealth of these attacks is remarkable: about 70% of the injected instructions appear in non-rendered HTML elements such as headers, comments, or metadata [4]. This makes them nearly invisible to users and difficult for standard web filters to detect. In controlled experiments across 13 different models, compliance with these injections reached up to 8% for smaller models when processing plain-text inputs [4].
The rise of ContextLure highlights a specific gap in this broader landscape. While many defenses focus on filtering external content or training dedicated detection models, these solutions often come with high computational overhead or suffer from high failure rates against sophisticated attacks [5]. Most current prompt-based defenses still struggle to distinguish between legitimate contextual evidence and adversarial manipulation derived from it [2].
Why This Matters for AI Agents
The implications of ContextLure extend beyond theoretical security research. As LLM agents move into enterprise workflows, customer service, and even robotics, they are increasingly tasked with making decisions based on accumulated context [5]. The assumption has been that a longer conversation history improves performance by providing more relevant background information. ContextLure proves that this same history provides attackers with a roadmap for exploitation.
The framework’s ability to achieve high success rates without prior contamination is particularly dangerous. Traditional security models often focus on securing the entry point of an interaction. However, if an attacker can observe the conversation as it happens—or access logs after the fact—they can construct attacks that are tailored specifically to the agent’s learned behaviors and preferences [1]. This turns the AI’s adaptability against itself.
Furthermore, the study analyzed six semantic types of evidence within the ContextLure framework, showing that different types of historical data (e.g., user intent vs. system constraints) can be exploited in various ways [3]. This granularity allows attackers to fine-tune their injections for maximum impact, whether it is bypassing a security guardrail or exfiltrating sensitive information.
The Path Forward
Defending against this type of attack requires a fundamental shift in how AI agents process context. Current defenses, such as tool result parsing, attempt to filter malicious code from external inputs [5]. However, ContextLure shows that the threat is not just in external content but in the internal memory of the agent itself. A defense must be able to identify when benign historical data is being repurposed for malicious ends.
Some research suggests that structured webpage representations can reduce compliance with prompt injections by preserving structural cues [4]. Similarly, training dedicated detection models may offer a path forward, though this comes with significant computational costs [5]. The proposed method in the ContextLure paper aims to achieve competitive Utility under Attack (UA) while maintaining the lowest known Attack Success Rate (ASR), but these are defensive simulations; real-world deployment requires more robust architectural changes [5].
The code for the proposed defense methods is available on GitHub, signaling a collaborative effort within the research community to address these vulnerabilities [5]. However, as AI agents become more integrated into critical systems, the window for patching these vulnerabilities is closing. The ContextLure study underscores that security cannot be an afterthought in agent design; it must be baked into how memory and context are managed from day one.
As LLMs continue to evolve, the line between helpful personalization and security risk will remain thin. Organizations deploying AI agents must recognize that their conversation history is not just a record of past interactions but a potential attack surface waiting to be exploited.
Sources
- ContextLure: Exploiting Benign Conversation History for Indirect Prompt Injection (arxiv.org) — 2026-11-23
- ContextLure:利用良性对话历史实现间接提示注入|arXiv 2611.31424|arXivDaily (www.arxivdaily.com) — 2026-11-25
- ContextLure: Exploiting Benign Conversation History for Indirect Prompt Injection (arxiv.org) — 2026-01-31
- Indirect Prompt Injection in the Wild: An Empirical Study of Prevalence, Techniques, and Objectives (arxiv.org) — 2026-04-29
- Defense Against Indirect Prompt Injection via Tool Result Parsing (arxiv.org) — 2026-01-08
- LLM Prompt Injection: Advanced Exploitation Guide (www.intigriti.com) — 2026-10-28