When large language model (LLM) systems interact with external data to perform complex tasks, a new attack, namely prompt injection, becomes a significant threat. By injecting instructions into the data accessed by the system, the attacker is able to override the initial user task with an arbitrary task directed by the attacker. To secure the system, test-time defenses, e.g., defensive prompting, have been proposed for system developers to attain security only when needed in a flexible manner. However, they are much less effective than training-time defenses that change the model parameters. Motivated by this, we propose DefensiveToken, a test-time defense with prompt injection robustness comparable to training-time alternatives. DefensiveTokens are newly inserted as special tokens, whose embeddings are optimized for security. In security-sensitive cases, system developers can append a few DefensiveTokens before the LLM input to achieve security with a minimal utility drop. In scenarios where security is less of a concern, developers can simply skip DefensiveTokens; the LLM system remains the same as there is no defense, generating high-quality responses. Thus, DefensiveTokens, if released alongside the model, allow a flexible switch between the state-of-the-art (SOTA) utility and almost-SOTA security at test time. The code is available at https://github.com/Sizhe-Chen/DefensiveToken.
Beyond Over-Refusal: Defending Indirect Prompt Injection via Latent Instruction Manifolds
Zhejiang University(浙江大学);Hong Kong Polytechnic University(香港理工大学);University of Science and Technology of China(中国科学技术大学);OPPO Research Institute(OPPO研究院)
ARGUS: Defending Against Multimodal Indirect Prompt Injection via Steering Instruction-Following Behavior
South China University of Technology(华南理工大学);Hong Kong University of Science and Technology(香港科技大学);Zhejiang Normal University(浙江师范大学);Beihang University(北京航空航天大学)
TextCrafter: Optimization-Calibrated Noise for Defending Against Text Embedding Inversion
Shenzhen International Graduate School, Tsinghua University(清华大学深圳国际研究生院);School of Data Science, The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳)数据科学学院)
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)实验教育计划(非学校类型))
Defending against Indirect Prompt Injection by Instruction Detection
Renmin University of China(中国人民大学);Peking University Shenzhen Graduate School(北京大学深圳研究生院);Wuhan University(武汉大学);University of Science and Technology of China(中国科学技术大学);Hong Kong University of Science and Technology(香港科技大学);Sony AI(索尼人工智能);Microsoft Research Asia(微软亚洲研究院)
Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning
State Key Laboratory of Complex System Modeling and Simulation Technology(复杂系统建模与仿真技术国家重点实验室);Science and Technology on Integrated Information System Laboratory, Institute of Software Chinese Academy of Sciences(中国科学院软件研究所综合信息系统技术国家级重点实验室);University of Chinese Academy of Sciences(中国科学院大学);Nanyang Technological University(南洋理工大学);Beijing Forestry University(北京林业大学)
Agentic AI for Autonomous Defense in Software Supply Chain Security: Beyond Provenance to Vulnerability Mitigation
Faculty of Computer and Information System(计算机与信息系统学院);Islamic University of Madinah(麦地那伊斯兰大学);Faculty of Computer Studies(计算机研究学院);Arab Open University-Bahrain(巴林阿拉伯开放大学)