mlsanityData to 14 Oct 2026

ContextLeak: Exfiltrating LLM Agent Context via Malicious Tools

arXiv 2608.27800 ↗First posted 28 Aug 2026cs.CR cs.AIcited by 0

On the map: LLM agents and tool use → Agent threats, guardrails and governance

Abstract (arXiv)

Exfiltrating an LLM agent's runtime context -- such as the user prompt, execution trajectory, and tool list -- poses severe security and privacy risks to users. Such attacks can be carried out via malicious tools and typically require three conditions: (1) the agent selects the malicious tool for task execution, (2) the agent passes its runtime context as input arguments to the tool, and (3) the tool's implementation transmits these inputs to an attacker-controlled endpoint. Existing work primarily focuses on conditions (1) and (3), leaving condition (2) largely unexplored, despite its critical role in enabling successful context exfiltration. In this work, we bridge this gap by developing ContextLeak, a malicious tool attack that induces the agent to both select the tool and disclose its context as input arguments. We realize this attack by carefully crafting the tool's name and description using reinforcement learning. Specifically, ContextLeak employs an LLM, referred to as the attack LLM, to automatically generate the malicious tool's name and description. To improve attack effectiveness, we fine-tune the attack LLM via reinforcement learning on a set of shadow users with diverse, simulated agent contexts. Our key technical contribution is the design of novel reward functions tailored to the context exfiltration objective, enabling effective reinforcement-learning-based fine-tuning of the attack LLM. Extensive evaluation demonstrates that our attack remains highly effective even when the shadow users' contexts differ substantially from those of the victim users. Moreover, ContextLeak significantly outperforms existing malicious tool attacks when adapted to this setting.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 20 of its 25 references that are in the map. First posted on arXiv 28 Aug 2026.

Builds on

20 of 25 references.

Closest ancestors · 6

Same direction, newest first

  1. 2026MalTool: Malicious Tool Attacks on LLM Agents12 Feb
  2. 2025ObliInjection: Order-Oblivious Prompt Injection Attack to LLM Agents with Multi-source Data10 Dec
  3. 2025ToolTweak: An Attack on Tool Selection in LLM-based Agents2 Oct
  4. 2025Attractive Metadata Attack: Inducing LLM Agents to Invoke Malicious Tools4 Aug
  5. 2025PromptArmor: Simple yet Effective Prompt Injection Defenses21 Jul
  6. 2025Prompt Injection Attack to Tool Selection in LLM Agents28 Apr

Other references · 14

  1. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  3. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  4. 2023A Survey on Large Language Model based Autonomous Agentscited by 2,242
  5. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
  6. 2025gpt-oss-120b & gpt-oss-20b Model Cardcited by 1,386
  7. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 672
  8. 2020Making Monolingual Sentence Embeddings Multilingual using Knowledge Distillationcited by 593
  9. 2023ToolAlpaca: Generalized Tool Learning for Language Models with 3000 Simulated Casescited by 393
  10. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 364
  11. 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 210
  12. 2024Optimization-based Prompt Injection Attack to LLM-as-a-Judgecited by 143
2 more
  1. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attackscited by 143
  2. 2025PromptLocate: Localizing Prompt Injection Attackscited by 28

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026ARGUS: Defending LLM Agents Against Context-Aware Prompt Injection
  2. 2026A Framework for Formalizing LLM Agent Security
  3. 2026Your LLM Agent Can Leak Your Data: Data Exfiltration via Backdoored Tool Use
  4. 2026Agents at Risk: How Users Unwittingly Undermine LLM Safety
  5. 2026Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks
  6. 2024Imprompter: Tricking LLM Agents into Improper Tool Use
  7. 2024Prompt Infection: LLM-to-LLM Prompt Injection within Multi-Agent Systems
  8. 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis