Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Chang, Zhiyuan, Li, Mingyang, Huang, Yuekai, Jiang, Ziyou, Jia, Xiaojun, Xiong, Qian, Wang, Junjie, Li, Zhaoyang, Wang, Qing
Format: Preprint
Publié: 2026
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914460561571840
author Chang, Zhiyuan
Li, Mingyang
Huang, Yuekai
Jiang, Ziyou
Jia, Xiaojun
Xiong, Qian
Wang, Junjie
Li, Zhaoyang
Wang, Qing
author_facet Chang, Zhiyuan
Li, Mingyang
Huang, Yuekai
Jiang, Ziyou
Jia, Xiaojun
Xiong, Qian
Wang, Junjie
Li, Zhaoyang
Wang, Qing
contents Large language model (LLM)-integrated applications have become increasingly prevalent, yet face critical security vulnerabilities from prompt injection (PI) attacks. Defending against PI attacks faces two major issues: malicious instructions can be injected through diverse vectors, and injected instructions often lack clear semantic boundaries from the surrounding context, making them difficult to identify. To address these issues, we propose InstruCoT, a model enhancement method for PI defense that synthesizes diverse training data and employs instruction-level chain-of-thought fine-tuning, enabling LLMs to effectively identify and reject malicious instructions regardless of their source or position in the context. We evaluate InstruCoT across three critical dimensions: Behavior Deviation, Privacy Leakage, and Harmful Output. Experimental results across four LLMs demonstrate that InstruCoT significantly outperforms baselines in all dimensions while maintaining utility performance without degradation
format Preprint
id arxiv_https___arxiv_org_abs_2601_04666
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning
Chang, Zhiyuan
Li, Mingyang
Huang, Yuekai
Jiang, Ziyou
Jia, Xiaojun
Xiong, Qian
Wang, Junjie
Li, Zhaoyang
Wang, Qing
Artificial Intelligence
Cryptography and Security
Large language model (LLM)-integrated applications have become increasingly prevalent, yet face critical security vulnerabilities from prompt injection (PI) attacks. Defending against PI attacks faces two major issues: malicious instructions can be injected through diverse vectors, and injected instructions often lack clear semantic boundaries from the surrounding context, making them difficult to identify. To address these issues, we propose InstruCoT, a model enhancement method for PI defense that synthesizes diverse training data and employs instruction-level chain-of-thought fine-tuning, enabling LLMs to effectively identify and reject malicious instructions regardless of their source or position in the context. We evaluate InstruCoT across three critical dimensions: Behavior Deviation, Privacy Leakage, and Harmful Output. Experimental results across four LLMs demonstrate that InstruCoT significantly outperforms baselines in all dimensions while maintaining utility performance without degradation
title Know Thy Enemy: Securing LLMs Against Prompt Injection via Diverse Data Synthesis and Instruction-Level Chain-of-Thought Learning
topic Artificial Intelligence
Cryptography and Security
url https://arxiv.org/abs/2601.04666