Large language model (LLM)-based applications rely on system prompts to encode core logic and developer-defined constraints, making these prompts important intellectual property. However, system prompts are vulnerable to prompt leaking attacks. Although prior work has shown such attacks in controlled settings, their prevalence, causes, and defenses in real-world deployments remain unclear.
This paper presents a systematic study of prompt leaking in real-world LLM-based applications. We measure 1,200 applications across six major commercial platforms and find that over 80% of deployments leak system prompts under realistic adversarial queries, sometimes exposing sensitive information such as third-party API keys. We also show that existing defenses often fail to prevent leakage without degrading usability. To explain these failures, we conduct an attention-level mechanistic analysis and identify attention drift, where query-key alignment bias and softmax amplification cause LLMs to progressively ignore defensive constraints. Guided by this insight, we propose AREA, a practical defense that re-anchors the model's attention using an optimizable soft prompt. Experiments and real-world case studies show 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 3x. Our responsible disclosure led two affected vendors to classify these leaks as medium-severity vulnerabilities.
When Prompts Become Payloads: A Framework for Mitigating SQL Injection Attacks in Large Language Model-Driven Applications
Hasso Plattner Institute, University of Potsdam, Germany(波茨坦大学霍斯曼-普拉特研究所, 德国);Chemnitz University of Technology, Chemnitz, Germany(Chemnitz技术大学, Chemnitz, 德国)
Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Intervention
Department of Computer Science(计算机科学系);School of Computing, National University of Singapore(新加坡国立大学计算机学院);Department of Electronics and Communications Engineering(电子与通信工程系)
AMCR: A Framework for Assessing and Mitigating Copyright Risks in Generative Models
Florida International University, Miami, Florida, United States(佛罗里达国际大学);Guangdong University of Foreign Studies, Guangzhou, Guangdong, China(广东外语外贸大学);Carnegie Mellon University, Pittsburgh, Pennsylvania, United States(卡内基梅隆大学)
RAG-CT: Mitigating Privacy Risks on Retrieval-Augmented Generation Systems via Scanning Prompt Distribution
University of Massachusetts Lowell(马萨诸塞大学洛厄尔分校);City University of Hong Kong(香港城市大学);Virginia Tech(弗吉尼亚理工大学);University of South Florida(南佛罗里达大学);Rochester Institute of Technology(罗切斯特理工学院)
AgentSentry: Mitigating Indirect Prompt Injection in LLM Agents via Temporal Causal Diagnostics and Context Purification
Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, School of Cyber Science and Engineering, Wuhan University(航空信息安全与可信计算重点实验室、教育部、网络安全科学与工程学院、武汉大学);Department of Computer Science and Engineering, University at Buffalo, SUNY(计算机科学与工程系、布法罗大学、纽约州立大学);Department of Computer Science, College of Information Science and Technology, Jinan University(计算机科学系、信息科学与技术学院、济南大学);College of Cyber Security, Jinan University(网络安全学院、济南大学)
Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignment
University of Wisconsin-Madison(威斯康星大学麦迪逊分校);University of Michigan-Ann Arbor(密歇根大学安娜堡分校);Princeton University(普林斯顿大学);University of California, Davis(加州大学戴维斯分校);University of Chicago(芝加哥大学)
Confuse the Model, Control the Flow: Understanding and Mitigating Privacy Leakage from LLM Agents with Information Flow Control
University of California, Irvine(加州大学欧文分校);University of California, Santa Cruz(加州大学圣克鲁兹分校);University of California, Davis(加州大学戴维斯分校);University of California, Santa Barbara(加州大学圣巴巴拉分校)
Design and Implementation of a Secure RAG-Enhanced AI Chatbot for Smart Tourism Customer Service: Defending Against Prompt Injection Attacks -- A Case Study of Hsinchu, Taiwan
Department of Information Management, National Dong Hwa University(信息管理系,国立东华大学);By The Student (BTS) Experimental Education Program (Non-School Type)(学生(BTS)实验教育计划(非学校类型))
Stop Tracking Me! Proactive Defense Against Attribute Inference Attack in LLMs
School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);NLPR & MAIS, Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所)