mlsanityData to 7 Oct 2026

CPInj: Uncovering Prompt Injection Risks in Textual Collaborative Prompt Optimization

arXiv 2607.18622 ↗First posted 21 Jul 2026cs.CR cs.AIcited by 0

On the map: LLM safety and security → Prompt injection and agent security

Abstract (arXiv)

Textual Collaborative Prompt Optimization (TCPO) extends TextGrad (Yuksekgonul et al., 2025) to a decentralized setting by allowing multiple clients to jointly improve prompts for large language models (LLMs) while keeping their data locally. Its reliance on free-form textual updating and aggregation introduces a new and largely unexplored attack surface, i.e., malicious instructions can be injected into local prompts and propagated through server-side prompt aggregation. Unlike conventional prompt injection attacks, attacking TCPO targets the collaborative optimization loop in TCPO. This setting is more challenging because malicious instructions must survive aggregation, persist through subsequent benign prompt optimization, and evade server-side defenses. To expose this risk, we propose Collaborative Prompt Injection (CPInj) attack that contaminates the aggregated global prompt with malicious instructions, degrades downstream task performance, resists purification by prompt optimization on benign clients, and evades advanced detection-based defenses on the server. We find that current defense methods are ineffective against CPInj. We further propose Anchored Purification Aggregation (APAgg), a defense-oriented aggregation that purifies malicious instructions without severely degrading TCPO utility. We conduct extensive experiments across three LLM families and five reasoning tasks in math, logic, and medicine, and demonstrate that our proposed attack reveals a critical vulnerability in TCPO. Although we take a first step toward mitigation, the attack remains highly effective and far from fully resolved, calling for more robust defense for TCPO.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 28 of its 34 references that are in the map. First posted on arXiv 21 Jul 2026.

Builds on

28 of 34 references.

Closest ancestors · 7

Same direction, newest first

  1. 2025PromptLocate: Localizing Prompt Injection Attacks14 Oct
  2. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attacks15 Apr
  3. 2024Attention Tracker: Detecting Prompt Injection Attacks in LLMs1 Nov
  4. 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct
  5. 2024Defending Against Indirect Prompt Injection Attacks With Spotlighting20 Mar
  6. 2024StruQ: Defending Against Prompt Injection with Structured Queries9 Feb
  7. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defenses19 Oct

Other references · 21

  1. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  2. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  3. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
  4. 2019PubMedQA: A Dataset for Biomedical Research Question Answeringcited by 1,271
  5. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
  6. 2021BBQ: A Hand-Built Bias Benchmark for Question Answeringcited by 683
  7. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
  8. 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 608
  9. 2025GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learningcited by 449
  10. 2022FOLIO: Natural Language Reasoning with First-Order Logiccited by 233
  11. 2024AdvPrompter: Fast Adaptive Adversarial Prompting for LLMscited by 146
  12. 2025X-Teaming: Multi-Turn Jailbreaks and Defenses with Adaptive Multi-Agentscited by 112
9 more
  1. 2024Query-Based Adversarial Prompt Generationcited by 55
  2. 2024Knowledge Boundary of Large Language Models: A Surveycited by 36
  3. 2025Cats Confuse Reasoning LLM: Query Agnostic Adversarial Triggers for Reasoning Modelscited by 23
  4. 2024Granite Guardiancited by 20
  5. 2024Model Poisoning Attacks to Federated Learning via Multi-Round Consistencycited by 18
  6. 2025Can Textual Gradient Work in Federated Learning?cited by 14
  7. 2025Black-box Optimization of LLM Outputs by Asking for Directionscited by 7
  8. 2025FOCoOp: Enhancing Out-of-Distribution Robustness in Federated Prompt Learning for Vision-Language Modelscited by 2
  9. 2025SABRE-FL: Selective and Accurate Backdoor Rejection for Federated Prompt Learningcited by 2

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injection
  2. 2025Are My Optimized Prompts Compromised? Exploring Vulnerabilities of LLM-based Optimizers
  3. 2024Enhancing Prompt Injection Attacks to LLMs via Poisoning Alignment
  4. 2026Dynamic Deep Prompt Optimization for Defending Against Jailbreak Attacks on LLMs
  5. 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems
  6. 2025Efficient but Vulnerable: Benchmarking and Defending LLM Batch Prompting Attack
  7. 2026Safety in Batches? Understanding and Mitigating Safety Failures in Batch Prompting
  8. 2025Rethinking Prompt Optimizers: From Prompt Merits to Optimization