Lune

CCS2026Top-tier venue

Understanding and Mitigating Prompt Leaking Attacks in Real-World LLM-Based Applications

Yong Yang, Chong Fu, Tong Zhang, Rui Zeng, Qingming Li, Tianyu Du, Zonghui Wang, Shouling Ji, Wenzhi Chen

Abstract

Large language model (LLM)-based applications rely on system prompts to encode their core logic and developer-defined constraints, making them a critical form of intellectual property. However, these prompts are highly vulnerable to prompt leaking attacks. While the feasibility of such attacks has been demonstrated in controlled settings, a significant gap exists in understanding their prevalence, underlying mechanisms, and practical defenses within real-world deployments. In this paper, we bridge this gap by providing a systematic investigation into the landscape of prompt leaking in real-world LLMbased applications. Our study unfolds in three key aspects. First, we conduct a large-scale measurement of 1,200 applications across six major commercial platforms, revealing that over 80% of deployments leak system prompts under realistic adversarial queries, often exposing sensitive information like third-party API keys. Besides, our evaluation of existing defenses shows that they fail to prevent leakage without degrading usability. Second, to understand the root cause of these failures, we perform an attention-level mechanistic analysis and uncover a fundamental phenomenon we term attention drift, where query-key alignment bias and softmax amplification cause the LLMs to progressively ignore defensive constraints. Finally, guided by these insights, we propose AREA, a practical defense that re-anchors the LLM's attention via an optimizable soft prompt. Extensive experiments and real-world case studies demonstrate that AREA matches the leakage resistance of state-of-the-art defenses while improving average usability by over 33% and reducing optimization overhead by nearly 3×. The real-world significance of our work is further underscored by our responsible disclosure to affected vendors, two of whom have officially classified these leaks as medium-severity vulnerabilities.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • PLeak: Prompt Leaking Attacks against Large Language Model Applications cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
  • Optimization-based Prompt Injection Attack to LLM-as-a-Judge cites PLeak: Prompt Leaking Attacks against Large Language Model Applications
  • Optimization-based Prompt Injection Attack to LLM-as-a-Judge cites Formalizing and Benchmarking Prompt Injection Attacks and Defenses
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on14

  1. Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
  2. Formalizing and Benchmarking Prompt Injection Attacks and DefensesYupei Liu, Yuqi Jia, Runpeng Geng, Jinyuan Jia et al.USENIX Security 2024 · 308 citations
  3. The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt InjectionsMilad Nasr, Nicholas Carlini, Chawin Sitawarin, Sander V. Schulhoff et al.USENIX Security 2026 · 134 citations
  4. Optimization-based Prompt Injection Attack to LLM-as-a-JudgeJiawen Shi, Zenghui Yuan, Yinuo Liu, Yue Huang et al.CCS 2024 · 33 citations
  5. PLeak: Prompt Leaking Attacks against Large Language Model ApplicationsBo Hui, Haolin Yuan, Neil Gong, Philippe Burlina et al.CCS 2024 · 28 citations

Related papers

  1. PromptKeeper: Safeguarding System Prompts for LLMsZhifeng Jiang, Zhihua Jin, Guoliang HeEMNLP Findings 2025 · 4 citations
  2. PRSA: Prompt Stealing Attacks against Real-World Prompt ServicesYong Yang, Changjiang Li, Qingming Li, Oubo Ma et al.USENIX Security 2025
  3. ProxyPrompt: Securing System Prompts against Prompt Extraction AttacksZhixiong Zhuang, Maria-Irina Nicolae, Hui-Po Wang, Mario FritzACL Findings 2026 · 1 citation
  4. Proxy Barrier: A Hidden Repeater Layer Defense Against System Prompt Leakage and JailbreakingPedro Schindler Freire Brasil Ribeiro, Iago Alves Brito, Rafael Teixeira Sousa, Fernanda Bufon Färber et al.EMNLP Findings 2025
  5. Defenses Against Prompt Attacks Learn Surface HeuristicsShawn Li, Chenxiao Yu, Zhiyu Ni, Hao Li et al.ACL 2026 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines