<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1 20151215//EN" "http://jats.nlm.nih.gov/publishing/1.1/JATS-journalpublishing1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xml:lang="en" article-type="review-article" dtd-version="1.1">
<front>
<journal-meta>
<journal-id journal-id-type="pmc">JAI</journal-id>
<journal-id journal-id-type="nlm-ta">JAI</journal-id>
<journal-id journal-id-type="publisher-id">JAI</journal-id>
<journal-title-group>
<journal-title>Journal on Artificial Intelligence</journal-title>
</journal-title-group>
<issn pub-type="epub">2579-003X</issn>
<issn pub-type="ppub">2579-0021</issn>
<publisher>
<publisher-name>Tech Science Press</publisher-name>
<publisher-loc>USA</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">69841</article-id>
<article-id pub-id-type="doi">10.32604/jai.2025.069841</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Review</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>Enhancing Security in Large Language Models: A Comprehensive Review of Prompt Injection Attacks and Defenses</article-title>
<alt-title alt-title-type="left-running-head">Enhancing Security in Large Language Models: A Comprehensive Review of Prompt Injection Attacks and Defenses</alt-title>
<alt-title alt-title-type="right-running-head">Enhancing Security in Large Language Models: A Comprehensive Review of Prompt Injection Attacks and Defenses</alt-title>
</title-group>
<contrib-group>
<contrib id="author-1" contrib-type="author" corresp="yes">
<name name-style="western"><surname>Mathew</surname><given-names>Eleena Sarah</given-names></name><email>eleena.20214535@mnnit.ac.in</email></contrib>
<aff id="aff-1"><institution>Department of Computer Science and Engineering, Motilal Nehru National Institute of Technology</institution>, <addr-line>Allahabad, 211004</addr-line>, <country>India</country></aff>
</contrib-group>
<author-notes>
<corresp id="cor1"><label>&#x002A;</label>Corrresponding Author: Eleena Sarah Mathew. Email: <email>eleena.20214535@mnnit.ac.in</email></corresp>
</author-notes>
<pub-date date-type="collection" publication-format="electronic">
<year>2025</year>
</pub-date>
<pub-date date-type="pub" publication-format="electronic">
<day>06</day><month>10</month><year>2025</year>
</pub-date>
<volume>7</volume>
<issue>1</issue>
<fpage>347</fpage>
<lpage>363</lpage>
<history>
<date date-type="received">
<day>01</day>
<month>7</month>
<year>2025</year>
</date>
<date date-type="accepted">
<day>08</day>
<month>9</month>
<year>2025</year>
</date>
</history>
<permissions>
<copyright-statement>&#x00A9; 2025 The Author.</copyright-statement>
<copyright-year>2025</copyright-year>
<copyright-holder>Published by Tech Science Press.</copyright-holder>
<license xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>This work is licensed under a <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="TSP_JAI_69841.pdf"></self-uri>
<abstract>
<p>This review paper explores advanced methods to prompt Large Language Models (LLMs) into generating objectionable or unintended behaviors through adversarial prompt injection attacks. We examine a series of novel projects like HOUYI, Robustly Aligned LLM (RA-LLM), StruQ, and Virtual Prompt Injection that compel LLMs to produce affirmative responses to harmful queries. Several new benchmarks, such as PromptBench, AdvBench, AttackEval, INJECAGENT, and RobustnessSuite, have been created to evaluate the performance and resilience of LLMs against these adversarial attacks. Results show significant success rates in misleading models like Vicuna-7B, LLaMA-2-7B-Chat, GPT-3.5, and GPT-4. The review highlights limitations in existing defense mechanisms and proposes future directions for enhancing LLM alignment and safety protocols, including the concept of LLM SELF DEFENSE. Our study emphasizes the need for improved robustness in LLMs, which will potentially shape the future of Artificial Intelligence (AI) driven applications and security protocols. Understanding the vulnerabilities of LLMs is crucial for developing effective defenses against adversarial prompt injection attacks. This paper proposes a systemic classification framework that discusses various types of prompt injection attacks and defenses. We also go through a broad spectrum of state-of-the-art attack methods (such as HouYi and Virtual Prompt Injection) alongside advanced defense mechanisms (like RA-LLM, StruQ, and LLM Self-Defense), providing critical insights into vulnerabilities and robustness. We also integrate and compare results from multiple recent benchmarks, including PromptBench, INJECENT, and BIPIA.</p>
</abstract>
<kwd-group kwd-group-type="author">
<kwd>Natural language processing</kwd>
<kwd>prompt injection</kwd>
<kwd>ChatGPT</kwd>
<kwd>large language models (LLMs)</kwd>
<kwd>adversarial exploitation</kwd>
<kwd>jailbreak</kwd>
<kwd>sensitive data leakage</kwd>
</kwd-group>
</article-meta>
</front>
<body>
<sec id="s1">
<label>1</label>
<title>Paper Story</title>
<p>Large language models (LLMs) [<xref ref-type="bibr" rid="ref-1">1</xref>&#x2013;<xref ref-type="bibr" rid="ref-5">5</xref>] have transformed natural language processing by allowing machines to generate and interpret highly realistic human-like text, forming the backbone of applications such as chatbots, virtual assistants, and content generation. Despite their advantages, LLMs have in recent times also been known for their weak security specifically against adversarial threats [<xref ref-type="bibr" rid="ref-6">6</xref>&#x2013;<xref ref-type="bibr" rid="ref-8">8</xref>].</p>
<p>One of the most significant threats is prompt injection, in which malicious actors introduce crafted data into the LLM to manipulate or override intended instructions [<xref ref-type="bibr" rid="ref-9">9</xref>,<xref ref-type="bibr" rid="ref-10">10</xref>]. Open Worldwide Application Security Project (OWASP) has recently recognized prompt injection as the leading security hazard in LLM deployments.</p>
<p>Prompt injection attacks can be of two types [<xref ref-type="bibr" rid="ref-7">7</xref>,<xref ref-type="bibr" rid="ref-11">11</xref>&#x2013;<xref ref-type="bibr" rid="ref-15">15</xref>] Direct attacks, where the crafted prompts are provided to LLMs to directly alter their behaviour or output, as seen in <xref ref-type="fig" rid="fig-1">Fig. 1</xref>. Indirect attacks involve the poisoning of external data sources that LLMs rely on for context or decision-making, as seen in <xref ref-type="fig" rid="fig-2">Fig. 2</xref>.</p>
<fig id="fig-1">
<label>Figure 1</label>
<caption>
<title>Direct prompt injection</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-1.tif"/>
</fig><fig id="fig-2">
<label>Figure 2</label>
<caption>
<title>Indirect prompt injection</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-2.tif"/>
</fig>
<p>To address these threats, researchers have developed both prevention-based defenses, such as input filtering and prompt isolation, and detection-based methods, which analyze prompt structure and outputs to identify malicious activity. Despite ongoing advances in both approaches, the continually evolving tactics of attackers and increasing complexity of LLMs present new challenges, making it essential for the research community to persistently evaluate and strengthen model defenses [<xref ref-type="bibr" rid="ref-16">16</xref>&#x2013;<xref ref-type="bibr" rid="ref-18">18</xref>].</p>
<p>This review provides a comprehensive overview of current strategies and challenges associated with prompt injection attacks and defenses in LLMs, aiming to guide future work in safeguarding AI-driven applications.</p>
<p>In response to the growing threat, researchers have developed prevention-based and detection-based defenses [<xref ref-type="bibr" rid="ref-19">19</xref>]. Prevention-based defenses aim to prevent an attacker from injecting malicious prompts, while detection-based defenses focus on identifying and mitigating the effects of an attack. Examples include paraphrasing, retokenization, data prompt isolation, proactive detection, windowed perplexity detection, and LLM-based detection [<xref ref-type="bibr" rid="ref-20">20</xref>,<xref ref-type="bibr" rid="ref-21">21</xref>].</p>
<p>Despite these developments, prompt injection attacks remain a significant concern due to the evolving tactics of attackers and the increasing complexity of LLMs, which create new vulnerabilities. Ongoing research and development of effective defenses are essential to ensure the security and integrity of LLMs in various applications [<xref ref-type="bibr" rid="ref-22">22</xref>,<xref ref-type="bibr" rid="ref-23">23</xref>]. This literature review provides a comprehensive overview of current knowledge on prompt injection attacks and defenses in LLMs, highlighting key findings, challenges, and future directions and benchmarks [<xref ref-type="bibr" rid="ref-24">24</xref>] in this area.</p>
</sec>
<sec id="s2">
<label>2</label>
<title>Paper Structure</title>
<p>The paper outlines three main sections on prompt injection attacks: Attacks, Defenses, and various benchmarks for evaluating LLMs.</p>
<p><bold>Systematic Classification System</bold></p>
<p>In order to systemize the study of prompt injection, this review introduces a comprehensive classification methodology for both attacks and their defenses.</p>
<p><bold>Attack Classification:</bold>
<list list-type="simple">
<list-item>
<label>&#x2022;</label><p><bold>Direct Prompt Injection:</bold> Attacks where users directly manipulate the LLM behaviour through techniques such as:
<list list-type="simple">
<list-item><label>&#x2013;</label><p>Jailbreaking techniques: Instructing models to assume prohibited roles or ignore alignment [<xref ref-type="bibr" rid="ref-25">25</xref>].</p></list-item>
<list-item><label>&#x2013;</label><p>Scenario nesting: Embedding malicious instructions within layered or contextual scenarios [<xref ref-type="bibr" rid="ref-26">26</xref>].</p></list-item>
<list-item><label>&#x2013;</label><p>Context-based attacks: Leveraging in-context information to bypass safety checks [<xref ref-type="bibr" rid="ref-27">27</xref>], and Code Injection.</p></list-item>
<list-item><label>&#x2013;</label><p>Template-based attacks: Exploiting reusable or predictable prompt structures [<xref ref-type="bibr" rid="ref-28">28</xref>].</p></list-item>
<list-item><label>&#x2013;</label><p>Obfuscation and Encoding strategies: Concealing adversarial content via symbol substitution, translation, or encoding [<xref ref-type="bibr" rid="ref-29">29</xref>&#x2013;<xref ref-type="bibr" rid="ref-31">31</xref>].</p></list-item>
</list></p></list-item>
<list-item>
<label>&#x2022;</label><p><bold>Indirect Prompt Injection:</bold> Attacks where external sources are poisoned to manipulate the model:
<list list-type="simple">
<list-item><label>&#x2013;</label><p>Data Poisoning: Corrupting training/inference datasets.</p></list-item>
<list-item><label>&#x2013;</label><p>External Source Manipulation: Tampering with sources accessed via Retrieval Augmented Generation (RAG) or other integrations [<xref ref-type="bibr" rid="ref-32">32</xref>,<xref ref-type="bibr" rid="ref-33">33</xref>].</p></list-item>
</list></p></list-item>
</list></p>
<p><bold>Defense Classification:</bold>
<list list-type="simple">
<list-item>
<label>&#x2022;</label><p><bold>Prevention-based:</bold> Strategies to shield models before exposure to attacks, including:
<list list-type="simple">
<list-item><label>&#x2013;</label><p>Input Filtering [<xref ref-type="bibr" rid="ref-34">34</xref>].</p></list-item>
<list-item><label>&#x2013;</label><p>Prompt Preprocessing [<xref ref-type="bibr" rid="ref-35">35</xref>].</p></list-item>
<list-item><label>&#x2013;</label><p>Structured query enforcement.</p></list-item>
</list></p></list-item>
<list-item>
<label>&#x2022;</label><p><bold>Detection Based Defenses:</bold> Methods that identify adversarial prompts or outcomes post-hoc:
<list list-type="simple">
<list-item><label>&#x2013;</label><p>Pattern Recognition.</p></list-item>
<list-item><label>&#x2013;</label><p>LLM-based detection.</p></list-item>
</list></p></list-item>
</list></p>
</sec>
<sec id="s3">
<label>3</label>
<title>Attacks</title>
<p>LLMs like ChatGPT, Bard, and Claude are fine-tuned to avoid producing harmful content. While &#x201C;jailbreaks&#x201D;&#x2014;special queries inducing unintended responses&#x2014;require manual design and can be patched, such behavior may be difficult to patch permanently. Similar adversarial attacks in computer vision have been challenging to address for a decade, suggesting these threats might be an inherent risk of deep learning models.</p>
<p>We demonstrate that adversarial attacks, involving specific sequences of characters appended to user queries, can be automatically generated to cause LLMs to produce harmful content. These automated attacks are effective on open-source LLMs and also transfer to closed-source chatbots like ChatGPT, Bard, and Claude. This raises significant safety concerns as these models are increasingly used autonomously.</p>
<p>Under Attacks, as mentioned in the Paper Structure section, we can broadly divide them into direct and indirect prompt injection attacks. Under direct we can further classify them into Role-Playing attacks (where the user instructs the model to act as a particular entity), Scenario nesting (when the malicious prompt is embedded within layers of context or functional scenarios), Context-based Attacks (leveraging in-context examples or instructions to override safety constraints), and Code Injection (where sequences designed to disrupt the prompt structure or inject commands are directly appended). Other classes include Template-based Attacks, which exploit reusable prompt structures to bypass defenses, and Obfuscation/Encoding strategies, which hide adversarial intent using techniques like symbol substitution, translation, or encoded triggers. Under indirect, we have several types, such as Data poisoning (Where the training data is poisoned) and External Source manipulation (Where malicious content is injected into external knowledge bases, web documents, or retrieved snippets, which are then ingested by the LLM at inference time). In this review paper, we further discuss HouYi attack, a direct prompt injection method under code injection attacks, demonstrating its significance in the landscape of LLM vulnerabilities and Virtual Prompt Injection (VPI), which is a type of data poisoning attack where hidden triggers are added to the training data of instruction-tuned language models. These triggers let attackers secretly control the model&#x2019;s behavior, showing how dangerous and hard-to-detect these kinds of attacks can be [<xref ref-type="bibr" rid="ref-7">7</xref>].</p>
<sec id="s3_1">
<label>3.1</label>
<title>HouYi [<xref ref-type="bibr" rid="ref-36">36</xref>]</title>
<p>The HouYi attack is a highly effective black-box prompt injection methodology, which adapts from web injection strategies in order to hijack LLMs. HouYi consists of a multi-component injection structure, which enables attackers to bypass prompt formatting constraints and defense mechanisms prevalent in LLM-based systems:
<list list-type="simple">
<list-item><label>1.</label><p><bold>Framework Component:</bold> Seamlessly integrates malicious input to mimic natural application flows, making it difficult for static filters to discern adversarial content.</p></list-item>
<list-item><label>2.</label><p><bold>Separator Component:</bold> This component establishes a contextual separation between the application&#x2019;s preset prompts and user inputs, which makes the LLM&#x2019;s operational context favor the attacker&#x2019;s command.</p></list-item>
<list-item><label>3.</label><p><bold>Disruptor Component:</bold> Delivers the active payload, which can be tailored to extract sensitive information, alter LLM output, or compromise security and privacy. An example of the prompt transformation in HouYi is shown in <xref ref-type="fig" rid="fig-3">Fig. 3</xref>.</p>
</list-item>
</list></p>
<fig id="fig-3">
<label>Figure 3</label>
<caption>
<title>Example of prompt transformation in HouYi</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-3.tif"/>
</fig>
<p>The operational process includes three distinct phases:
<list list-type="simple">
<list-item><label>1.</label><p><bold>Context Inference:</bold> Mapping application input&#x2013;output relationships to identify exploitable insertion points.</p></list-item>
<list-item><label>2.</label><p><bold>Payload Generation:</bold> Crafting adversarial prompts that optimally evade simple detection rules.</p></list-item>
<list-item><label>3.</label><p><bold>Feedback Loop:</bold> Continuously refining attacks based on real-world responses from the LLM-integrated system.</p></list-item>
</list></p>
<p>In comprehensive evaluations, HOUYI revealed vulnerabilities in 31 of 36 tested LLM-powered applications, achieving a notable 86.1% attack success rate. Its techniques span Direct Injection (outright malicious command appending), Escape Character exploitation (e.g., the use of unexpected newline/tab characters to rupture prompt boundaries), and Context Ignoring (convincing the model to disregard prior safe instructions). Strikingly, several platforms&#x2014;like CHATPUBDATA and CHATBOTGENIUS&#x2014;showed universal susceptibility. These findings highlight the urgent need for dynamic, context-aware defenses capable of preventing prompt boundary circumvention and arbitrary LLM control. as tested on 36 LLM-integrated applications, identifying 31 as vulnerable, and achieving an 86.1% success rate in launching attacks. The study categorizes attacks into Direct Injection, Escape Characters, and Context Ignoring.</p>
</sec>
<sec id="s3_2">
<label>3.2</label>
<title>Virtual Prompt Injection [<xref ref-type="bibr" rid="ref-37">37</xref>]</title>
<p>Virtual Prompt Injection (VPI) is a novel class of attacks that targets instruction-tuned LLMs. In a VPI attack, the model functions as if there is a &#x2018;virtual prompt&#x2019; added to the user instruction in certain conditions, making it easy for attackers to control the model without changing the input explicitly. By poisoning just 0.1% of the instruction tuning data, half of any answer to any of the topics can be changed, and this is perhaps underemphasizing the value of data quality. Quality-guided data filtering is recognized as a mechanism for protection.</p>
<p>The approach practiced by the attacker entails feeding the model&#x2019;s instruction-tuning dataset with a small portion of contaminated data. The poisoned data can be provided in the form of released datasets (containing poisoned data) or data annotation services. This comprises gathering trigger instructions, creation of poisoned responses, as well as compilation of poisoned instruction tuning data. The model learns with a mixed data set in this case, but the poisoning rate is kept small for the sake of stealth. Some are pre-processing, where poor quality samples are removed by ChatGPT, and post-processing of the generated samples entails debiasing prompting.</p>
<p>In <xref ref-type="fig" rid="fig-4">Fig. 4</xref>, an example of VPI is shown, showing &#x2018;cats&#x2019; as the trigger scenario. Now, if the original prompt contains the word &#x2018;cats&#x2019; in it as the trigger words, then the virtual prompt is introduced into the original prompt and gives a false output.</p>
<fig id="fig-4">
<label>Figure 4</label>
<caption>
<title>Example of prompt transformation using virtual prompt injection</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-4.tif"/>
</fig>
<p>Experiments on Alpaca 7B showed that VPI significantly steers sentiment more effectively than explicit injection, with minimal impact on general instruction quality. VPI&#x2019;s success varied by topic, being easiest for OpenAI (6% to 72%) and hardest for abortion (10% to 32%). Data filtering effectively mitigated most attacks, but debiasing prompting was less effective, especially for sentiment steering. The study&#x2019;s VPI settings do not cover all possible scenarios, and the complexity of virtual prompts and trigger scenarios affects the attack&#x2019;s difficulty. The evaluation was limited to 7 and 13B models, with no systematic study of larger models. The current evaluation framework is also specific to certain attack goals, such as sentiment analysis and code injection.</p>
</sec>
</sec>
<sec id="s4">
<label>4</label>
<title>Defense</title>
<p>In order to mitigate prompt injection attacks in LLMs, some countermeasures have also been invented. They include enhanced alignment checks that help models strictly ignore malicious prompts, extra LLMs for screening and filtering dangerous content, dynamic approaches for resisting advanced adversarial inputs, and multi-layer defense frameworks. These defenses make LLMs more robust and reliable for safe AI applications.</p>
<p>Our review covers two main categories, prevention-based and detection-based defenses. Prevention-based strategies (like input filtering, preprocessing, and structured queries) work to block or clean potentially harmful prompts before they interact with the model. Detection-based strategies (including pattern recognition and LLM-based detection) focus on analyzing prompts or outputs to catch attacks as they happen.</p>
<p>We will also discuss several advanced solutions, such as StruQ (structured queries), LLM Self-Defense, RA-LLM, Defense Against Persuasive Adversarial Prompts (PAP) for LLMs, and GUARDIAN (a multi-layer guardrail framework for maintaining ethical behavior in language models).</p>
<sec id="s4_1">
<label>4.1</label>
<title>StruQ [<xref ref-type="bibr" rid="ref-38">38</xref>]</title>
<p>This study introduces structured queries to counter prompt injection attacks by separating prompts and data into distinct channels. The system supports structured queries through a novel fine-tuning strategy that converts a base LLM into a structured instruction-tuned model. This model follows instructions in the prompt portion of a query while ignoring instructions in the data portion, significantly improving resistance to prompt injection attacks with minimal impact on utility.</p>
<p>StruQ comprises two components:
<list list-type="simple">
<list-item><label>1.</label><p><bold>Front-end:</bold> The front-end of the system encodes queries into a special format using a hard-coded template based on the Alpaca model, with slight adaptations to enhance security. Instead of using textual strings like in Alpaca, modified special tokens are used: specifically, a reserved token <monospace>[MARK]</monospace> is used instead of &#x201C;###&#x201D; as used by Alpaca, three reserved tokens (<monospace>[INST]</monospace>, <monospace>[INPT]</monospace>, <monospace>[RESP]</monospace>) instead of the words in Alpaca&#x2019;s delimiters (&#x201C;instruction&#x201D;, &#x201C;input&#x201D;, and &#x201C;response&#x201D;), and <monospace>[COLN]</monospace> instead of the colon in Alpaca&#x2019;s delimiter. Specially reserved tokens are employed to delimit instructions and data, filtering out these tokens from user data to prevent spoofing by attackers (this can be seen in <xref ref-type="fig" rid="fig-5">Fig. 5</xref>). This method effectively defends against Completion attacks.</p>
</list-item>
<list-item><label>2.</label><p><bold>Specially trained LLM:</bold> A language model (LLM) is trained to accept inputs encoded in a special format using structured instruction tuning. Instruction tuning usually makes LLMs follow instructions wherever they appear in the input, which is not ideal for this particular use case. To address this, a variant that teaches the model is developed to follow instructions only in the prompt part of the input, not in the data part. The model is fine-tuned on samples with correctly placed instructions in the prompt and incorrectly placed instructions in the data, encouraging the model to respond only to correctly positioned instructions.</p></list-item>
</list></p>

<fig id="fig-5">
<label>Figure 5</label>
<caption>
<title>Example of prompt transformation in StruQ</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-5.tif"/>
</fig>
<p>In evaluations against eleven well-established classes of prompt injection attacks on Alpaca and Mistral models, StruQ consistently reduced attack success rates to below 2% for nearly all threats. However, for particularly advanced exploits such as Targeted Adversarial Prompts (TAP), StruQ succeeded in reducing but not fully eliminating risk, lowering propagation from 97% to 9% in Alpaca and from 100% to 36% in Mistral. These results establish StruQ as a leading approach for structural prompt hardening, though further refinement is necessary for defense against complex, adaptive attack strategies.</p>
</sec>
<sec id="s4_2">
<label>4.2</label>
<title>Signed-Prompt [<xref ref-type="bibr" rid="ref-39">39</xref>]</title>
<p>Signed-Prompt is the defense strategy that can be employed to counter the issue of prompt injection attacks on LLMs in integrated applications. To counter this vulnerability, Signed-Prompt proposes a signature of point-sensitive instructions from the origination point of authorized users/agents. These instructions are encoded with specific character sequences that are not like natural languages, so the LLM can check the legitimacy of the instructions.</p>
<p>The Signed-Prompt approach requires two key components: an Encoder to append the signature on the instructions and an LLM that can identify and execute signed instructions. The Encoder also adds a new segment containing signed commands, which were signed by the Encoder only. The LLM is then shifted to distinguish between unsigned and signed instructions so that only signed instructions are performed, illustrated in <xref ref-type="fig" rid="fig-6">Fig. 6</xref>. Possible ways of using the Encoder are presented with Traditional Character Replacement (TCR), fine-tuning Language Model Languages, and Prompt Engineering with general-purpose LLMs. Although TCR is not flexible and fine-tuning is costly, the paper concentrates on the prompt engineering method introduced by ChatGPT-4 from OpenAI for the demonstration.</p>
<fig id="fig-6">
<label>Figure 6</label>
<caption>
<title>Example of prompt transformation using signed-prompt</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-6.tif"/>
</fig>
<p>The analysis shows that LLMs built using either prompt engineering or fine-tuning exhibit strong resilience against various prompt injection attacks, with a 0% attack success rate across four tested groups: directness, multilingual, varied expressions, and implication where Direct: This group consists of straightforward, explicit commands in English, Multilingual: Commands in this group are provided in multiple languages, Varied Expressions: This group includes English commands that ask for a certain action but use varied expressions or synonyms for the action, Implication: Commands in this group imply the action of file deletion without explicitly stating it. However, the correctness of responses from the fine-tuned LLMs was inconsistent across these groups, indicating some limitations in performance.</p>
</sec>
<sec id="s4_3">
<label>4.3</label>
<title>RA-LLM (Robustly Aligned LLM) [<xref ref-type="bibr" rid="ref-17">17</xref>]</title>
<p>Robustly Aligned LLM (RA-LLM) is a novel model-level defense framework engineered to resist prompt injection attacks without costly model training or fine-tuning. The method leverages a robust alignment check process RAC(.) that probabilistically tests model alignment under perturbed input scenarios:</p>
<p>A prompt passes the RAC(.) if, after random masking (partial token removal), the core alignment check (AC) consistently approves the request. The intuition is that many adversarial prompts are brittle, that is, input perturbations often defeat the exploit, whereas benign instructions remain resilient. An example of prompt transformation in RA-LLM of a benign prompt can be seen in <xref ref-type="fig" rid="fig-7">Fig. 7</xref>, and a malicious one in <xref ref-type="fig" rid="fig-8">Fig. 8</xref>.<disp-formula id="eqn-1"><label>(1)</label><mml:math id="mml-eqn-1" display="block"><mml:mi>R</mml:mi><mml:mi>A</mml:mi><mml:mi>C</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mtext mathvariant="bold">x</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mrow><mml:mo>{</mml:mo><mml:mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"><mml:mtr><mml:mtd><mml:mrow><mml:mtext>Fail,</mml:mtext></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if</mml:mtext></mml:mrow><mml:mspace width="thinmathspace" /><mml:mspace width="thinmathspace" /><mml:mi>A</mml:mi><mml:mi>C</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mtext mathvariant="bold">x</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mrow><mml:mtext>Fail</mml:mtext></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mtext>Fail,</mml:mtext></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mtext>if&#xA0;</mml:mtext></mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="double-struck">P</mml:mi></mml:mrow><mml:mrow><mml:mi>r</mml:mi><mml:mo>&#x223C;</mml:mo><mml:mi>U</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>p</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mi>A</mml:mi><mml:mi>C</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>f</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mo stretchy="false">[</mml:mo><mml:mrow><mml:mtext mathvariant="bold">x</mml:mtext></mml:mrow><mml:msub><mml:mo stretchy="false">]</mml:mo><mml:mi>r</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mrow><mml:mtext>Fail</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo><mml:mo>&gt;</mml:mo><mml:mi>t</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mtext>Pass,</mml:mtext></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mtext>otherwise</mml:mtext></mml:mrow></mml:mtd></mml:mtr></mml:mtable><mml:mo fence="true" stretchy="true" symmetric="true"></mml:mo></mml:mrow></mml:math></disp-formula></p>
<fig id="fig-7">
<label>Figure 7</label>
<caption>
<title>Example of benign prompt transformation in RA-LLM</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-7.tif"/>
</fig><fig id="fig-8">
<label>Figure 8</label>
<caption>
<title>Example of malicious prompt transformation in RA-LLM</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JAI_69841-fig-8.tif"/>
</fig>
<p>where <italic>U</italic>(<italic>p</italic>) refers to the distribution of potential masks following the uniform dropping of the p, which is the proportion of indices to be dropped from the input (without replacement), [x]<sub><italic>r</italic></sub> indicates the kept indices r inside x following the dropping operation, It represents the subset of x that remains after dropping p proportion of its tokens. and <italic>r</italic> refers to the uniformly sampled indices mask to indicate kept tokens, which is used to select which tokens in x are retained.</p>
<p>When RA-LLM is deployed on both Vicuna-7B-v1.3-HF and Guanaco-7B-HF, it achieved dramatic reductions in attack success rates, from 98.7% to 10%&#x2014;while preserving high benign answering rates. The defense is highly tunable by adjusting the masking parameter p: higher masking secures greater robustness at some cost to usability for benign cases.</p>
<p>Overall, RA-LLM offers a generalizable and computationally efficient defense strategy, setting a new standard for integrated model safety against subtle and adaptive prompt injection threats.</p>
</sec>
<sec id="s4_4">
<label>4.4</label>
<title>LLM Self Defense [<xref ref-type="bibr" rid="ref-17">17</xref>]</title>
<p>LLM SELF DEFENSE, a simple approach to defend against these attacks by having an LLM screen the induced responses by incorporating the generated content into a pre-defined prompt and employing another instance of an LLM to analyze the text and predict whether it is harmful.</p>
<p>In this defense pipeline, a user provides a potentially malicious text prompt <inline-formula id="ieqn-1"><mml:math id="mml-ieqn-1"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mtext>in</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>. An LLM, referred to as <inline-formula id="ieqn-2"><mml:math id="mml-ieqn-2"><mml:msub><mml:mtext>LLM</mml:mtext><mml:mrow><mml:mtext>gem</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>, processes <inline-formula id="ieqn-3"><mml:math id="mml-ieqn-3"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mtext>in</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> and generates potentially harmful text <inline-formula id="ieqn-4"><mml:math id="mml-ieqn-4"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mtext>resp</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>. This can be expressed as:
<disp-formula id="ueqn-2"><mml:math id="mml-ueqn-2" display="block"><mml:msub><mml:mrow><mml:mtext>LLM</mml:mtext></mml:mrow><mml:mrow><mml:mrow><mml:mtext>gem</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mrow><mml:mtext>in</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mrow><mml:mtext>resp</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:math></disp-formula></p>
<p>To classify harmful content, another LLM, <inline-formula id="ieqn-5"><mml:math id="mml-ieqn-5"><mml:msub><mml:mtext>LLM</mml:mtext><mml:mrow><mml:mtext>filter</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>, is employed. The <inline-formula id="ieqn-6"><mml:math id="mml-ieqn-6"><mml:msub><mml:mtext>LLM</mml:mtext><mml:mrow><mml:mtext>filter</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> can be the same type of LLM used in <inline-formula id="ieqn-7"><mml:math id="mml-ieqn-7"><mml:msub><mml:mtext>LLM</mml:mtext><mml:mrow><mml:mtext>gem</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>. The process begins with <inline-formula id="ieqn-8"><mml:math id="mml-ieqn-8"><mml:msub><mml:mtext>LLM</mml:mtext><mml:mrow><mml:mtext>filter</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> being given a prompt: &#x201C;Does the following text contain harmful content: <inline-formula id="ieqn-9"><mml:math id="mml-ieqn-9"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mtext>resp</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula>? Respond with &#x2018;Yes, this is harmful&#x2019; or &#x2018;No, this is not harmful&#x2019;.&#x201D; The <inline-formula id="ieqn-10"><mml:math id="mml-ieqn-10"><mml:msub><mml:mtext>LLM</mml:mtext><mml:mrow><mml:mtext>filter</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> then reads <inline-formula id="ieqn-11"><mml:math id="mml-ieqn-11"><mml:msub><mml:mi>T</mml:mi><mml:mrow><mml:mtext>resp</mml:mtext></mml:mrow></mml:msub></mml:math></inline-formula> and generates a response indicating whether the content is harmful. This method has proven to be highly effective at filtering out virtually all harmful LLM-generated content.</p>
<p>GPT 3.5 has been found to perform well at classifying harmful content. GPT 3.5 reaches a 98% accuracy. LLaMA-2 has a lower performance of 77%. It has also been discovered that instructing an LLM to determine whether an induced response constitutes harm after the LLM has already processed the text is more effective at distinguishing between harmful and benign responses and has significantly improved the accuracy of GPT 3.5% to 99% and that of LLaMA-2 to 94.6%.</p>
</sec>
<sec id="s4_5">
<label>4.5</label>
<title>Defense Against Persuasive Adversarial Prompts (PAP) for LLMs [<xref ref-type="bibr" rid="ref-40">40</xref>]</title>
<p>This research aims to transform the understanding of how to counter immediate injection attacks through persuasive adversarial prompts (PAP) from a taxonomy of 40 persuasive techniques adopted from social science disciplines. The PAPs are generated automatically to jailbreak the LLMs, thereby increasing the chance of success in an attack. The experiment entails training a Paraphrasing Machine known as the Persuasive Paraphraser and then using the agent to parse PAPs. Further exploration of three adaptive defenses is done using Mutation and Detection tactics.
<list list-type="simple">
<list-item><label>1.</label><p><bold>Adaptive System Prompt:</bold> Instruct the LLM to resist persuasion.</p></list-item>
<list-item><label>2.</label><p><bold>Base Summarizer:</bold> Summarizes adversarial prompts to extract the core query before execution.</p></list-item>
<list-item><label>3.</label><p><bold>Tuned Summarizer:</bold> Fine-tunes a summarizer with pairs of harmful queries and their corresponding PAPs.</p></list-item>
</list></p>
<p>PAPs achieve high attack success rates (&#x003E;92%) across LLaMA-2-7b Chat, GPT-3.5, and GPT-4. Adaptive System Prompts improve resilience, often surpassing baseline defenses. Base and tuned summarizers effectively neutralize PAPs, with the Tuned Summarizer reducing the attack success rate from 92% to 2% on GPT-4 and from 86% to 0% on GPT-3.5.</p>
</sec>
<sec id="s4_6">
<label>4.6</label>
<title>GUARDIAN (Guardrails for Upholding Ethics in Language Models) [<xref ref-type="bibr" rid="ref-41">41</xref>]</title>
<p>To safeguard LLMs from adversarial prompt attacks, GUARDIAN provides a robust multi-tier defense framework.</p>
<p>A set of prompts sufficiently extensive to put pressure on all possible lines of defense of the LLM is constructed, which supports adversarial training. The process includes building a wide range of prompts, including the identified successful attack patterns and the new ones intended to test the weak points of the system. This dataset is useful for each testing phase to give the most thorough examination of the robustness of each layer.
<list list-type="simple">
<list-item><label>1.</label><p><bold>Filter 1:</bold> System Prompt Layer Analysis This stage evaluates the capability of the system prompt layer in identifying and managing input prompts that are either harmful or unethical. This is done using data collection, testing, and metrics.</p></list-item>
<list-item><label>2.</label><p><bold>Filter 2:</bold> Custom Fine-Tuned Layer Evaluation The goal here is to use a fine-tuned classification Large Language Model (LLM) that is specific to the given dataset and improve the detection of risky information within the user&#x2019;s queries. These queries may have escaped the initial pre-processing filter mechanism of this system. Moreover, an Ethical Prompt Auto-Suggestion automatically provides morally appropriate options if a user inputs an unethical question. The procedure consists in obtaining and pre-processing the Toxic Comment Classification Dataset from Google Jigsaw and updating the &#x201C;bert-base-uncased&#x201D; model to a model suitable for classification tasks. An ethical prompt set, which is customized based on the ethical issue, is constructed using the Zephyr-7B-<inline-formula id="ieqn-12"><mml:math id="mml-ieqn-12"><mml:mi>&#x03B1;</mml:mi></mml:math></inline-formula> LLM model to fine-tune the prompt generator. Both of these models are evaluated using training loss and accuracy, with preference to specificity in light of the unique nature of the datasets employed.</p></list-item>
<list-item><label>3.</label><p><bold>Filter 3:</bold> Pre-Display Filter Validation This stage verifies the efficacy of the pre-display filter, which employs another LLM to ensure the ethicality of generated outputs. The procedure involves integrating a secondary LLM to examine outputs for ethical compliance, followed by testing with a range of outputs, including those from prompts that failed to get blocked by the previous layers. The focus is on the accuracy of the ethical filter in identifying unethical content, ensuring that the final output adheres to ethical standards.</p></list-item>
</list></p>
<p>This stage confirms the performance of the pre-display filter, where another LLM is used to guarantee the ethicality of the generated outputs. This procedure includes linking a secondary LLM to review outputs for tainted contents, and sampling with a variety of outputs, including from prompts that the prior layers did not block. It is therefore on the accuracy of the ethical filter to give a perfect indication of the kind of content that may be unethical in order to meet the expected output in terms of ethical behavior.</p>
<p>The LLaMA-2 model demonstrates the capability to block 100% of attack prompts.</p>
</sec>
</sec>
<sec id="s5">
<label>5</label>
<title>Benchmarks</title>
<p>Benchmarking is one of the tools for the evaluation of LLMs, especially in view of their susceptibility to prompt injection attacks. They offer tests that are aimed at evaluating different features of the LLM&#x2019;s performance potential, including natural language comprehension, generation, and even reasoning and tolerance to different tasks. Established benchmarks such as AdvBench and MS MARCO provide detailed findings on model capabilities and limitations so that researchers and developers can focus on potential improvements. These benchmarks are operational and replicate real-life situations, and the set of tasks can range from answering questions to reasoning. The information arriving from these evaluations is vital for assembling superior models that would be more resilient and effective. Furthermore, benchmarking has a critical relevance in promoting transparency and accountability for the AI models in comparison with related new models, as well as providing impetus for the improvement of the AI research field.</p>
<sec id="s5_1">
<label>5.1</label>
<title>PromptBench [<xref ref-type="bibr" rid="ref-42">42</xref>]</title>
<p>PromptBench is a project made to measure LLMs&#x2019; resilience to adversarial prompts. Four different prompts were studied, Zero shot-Task oriented, Role oriented and Few shot-Task oriented, Role oriented. 7 different attacks were also studied (TextBugger, DeepWordBug, TextFooler, BertAttack, CheckList, StressTest, Semantic). Performance was measured using a unified metric called Performance Drop Rate (PDR). It quantifies the relative performance decline following a prompt attack, offering a contextually normalized measure for comparing different attacks, datasets, and models. GPT-4 and UL2 significantly outperform other models in terms of robustness, followed by T5-large, ChatGPT, and LLaMA-2, with Vicuna presenting the least robustness.<disp-formula id="eqn-2"><label>(2)</label><mml:math id="mml-eqn-2" display="block"><mml:mi>P</mml:mi><mml:mi>D</mml:mi><mml:mi>R</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>A</mml:mi><mml:mo>,</mml:mo><mml:mi>P</mml:mi><mml:mo>,</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">&#x0398;</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:mi>D</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mfrac><mml:mrow><mml:munder><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2208;</mml:mo><mml:mi>D</mml:mi></mml:mrow></mml:munder><mml:mi>M</mml:mi><mml:mrow><mml:mo>[</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">&#x0398;</mml:mi></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mo stretchy="false">[</mml:mo><mml:mi>A</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:mi>P</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy="false">]</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:munder><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x2208;</mml:mo><mml:mi>D</mml:mi></mml:mrow></mml:munder><mml:mi>M</mml:mi><mml:mrow><mml:mo>[</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">&#x0398;</mml:mi></mml:msub><mml:mo stretchy="false">(</mml:mo><mml:mo stretchy="false">[</mml:mo><mml:mi>P</mml:mi><mml:mo>,</mml:mo><mml:mi>x</mml:mi><mml:mo stretchy="false">]</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:mrow></mml:mfrac></mml:math></disp-formula></p>
<p>where <italic>A</italic> is the adversarial attack applied to the original prompt (<italic>P</italic>), <italic>P</italic> is the original, non-attacked prompt, <inline-formula id="ieqn-13"><mml:math id="mml-ieqn-13"><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">&#x0398;</mml:mi></mml:msub></mml:math></inline-formula> is the language model being evaluated, and <italic>D</italic> is the dataset used for testing. <italic>M</italic>[ ]: The evaluation function, which checks how well the model performs: For classification tasks (e.g., identifying if a text is positive or negative), it is 1 if the model&#x2019;s answer is correct, and 0 if it&#x2019;s wrong. For reading comprehension tasks, it&#x2019;s the F1-score (a measure of accuracy). For translation tasks, it&#x2019;s the BLEU score (how good the translation is) [<xref ref-type="bibr" rid="ref-43">43</xref>].</p>
</sec>
<sec id="s5_2">
<label>5.2</label>
<title>INJECAGENT: Benchmark for Assessing LLM Agent Vulnerabilities to Indirect Prompt Injection (IPI) Attacks [<xref ref-type="bibr" rid="ref-44">44</xref>]</title>
<p>INJECAGENT tests how well language model agents equipped with external tools can resist indirect prompt injection attacks. These attacks add hidden malicious instructions in the content the agent uses, which can cause the agent to behave wrongly, leak data, or cause financial damage. First, the system finds tools that take input from outside sources that attackers might change. For each tool, a user case is created where the tool is identified, instructions tell the agent to use the tool, required input details are given, and a response template is made that includes a spot to insert attacker instructions. Experts review these cases to make sure they are accurate, resulting in 17 detailed user scenarios.</p>
<p>Next, attacker cases are created for two main types of attacks: those that cause direct harm and those that steal data. The system randomly picks tools for either attack type and generates attacker instructions designed to work with the tools realistically. These attacks are also grouped by their motives, such as financial gain or physical disruption. The user and attacker cases are then combined by replacing the placeholder with the attacker&#x2019;s malicious instructions. In a stronger test setup, extra &#x201C;hacking&#x201D; prompts are added to help the attack succeed.</p>
<p>Testing shows serious weaknesses: GPT-4 using ReAct prompting has attack success rates of 23.6% (base) and 47.0% (enhanced), while LLaMA2-70B fails more than 80% of the time under both conditions. On the other hand, Fine-tuned GPT-4 and GPT-3.5 exhibit lower ASRs of 3.8% and 6.6%, respectively.</p>
</sec>
<sec id="s5_3">
<label>5.3</label>
<title>The Benchmark for Indirect Prompt Injection Attacks (BIPIA) [<xref ref-type="bibr" rid="ref-45">45</xref>]</title>
<p>BIPIA was created to evaluate the risk of indirect prompt injection attacks. It analyzes attack success causes and develops effective black-box and white-box defense methods, significantly reducing attack success rates.</p>
<p>BIPIA encompasses a wide range of scenarios, covering 250 distinct attacker goals across five different application contexts. This includes a set of carefully selected representative tasks such as email question answering (QA), web QA, table QA, general text summarization, and code QA. To thoroughly assess model vulnerability, 30 distinct text-based attack types were designed for the text-related tasks (email, web, table QA, and summarization), while 20 code-specific attack types targeted code QA. For training purposes, 15 text attack types and 10 code attack types were randomly selected, with the remaining attacks reserved for testing.</p>
<p>These instructions were investigated on the ASR. The process involves injecting a malicious instruction into a task-specific external content sample at one of the three positions. A prompt template is merged with user instructions, and the modified external content is used to generate the prompts for our training and testing datasets. The total number of prompts is determined by multiplying the number of external content variations by the number of malicious instructions and the number of positions.</p>
<p>Comparing several of the most used open-source and closed-source LLMs, it could be concluded that they were all susceptible to indirect prompt injection attacks for most of the application tasks. Research shows that both GPT-4 and GPT-3.5 fall victim to such attacks, hence the importance of countermeasures. It was found that the performances in Chatbot Arena, as measured by Elo ratings, were positively related to ASRs on text tasks, but no systematic trend was observed for code tasks due to differences in the model&#x2019;s approach to code generation. Also, ASRs for summarization tasks were higher than for table QA, email QA, and web QA due to the variation in prompt templates. Task-relevant and targeted text attacks were more successful than non-targeted attacks because models prioritized the text information related to the task at hand.</p>
</sec>
</sec>
<sec id="s6">
<label>6</label>
<title>Results and Discussion</title>
<p>We summarize important results from the recent literature on the effectiveness of different defenses. Notably, at present, we are seeing that models have yielded reduced attack success rates as seen in <xref ref-type="table" rid="table-1">Table 1</xref> (regardless of target functionality), as well as maintained operational integrity under adversarial conditions&#x2014;demonstrating considerable progress on LLM security. The new attack models, as mentioned in the above literature, display higher success rates as well, as summarized in <xref ref-type="table" rid="table-2">Table 2</xref>.</p>
<table-wrap id="table-1">
<label>Table 1</label>
<caption>
<title>Defense effectiveness by category</title>
</caption>
<table>
<colgroup>
<col/>
<col/>
<col/>
<col width="50mm"/>
</colgroup>
<thead>
<tr>
<th>Defense type</th>
<th>Method</th>
<th>Models tested</th>
<th>ASR reduction</th>
</tr>
</thead>
<tbody>
<tr>
<td>Prevention</td>
<td>StruQ</td>
<td>Alpaca, Mistral</td>
<td>97%<inline-formula id="ieqn-14"><mml:math id="mml-ieqn-14"><mml:mo stretchy="false">&#x2192;</mml:mo></mml:math></inline-formula>9%, 100%<inline-formula id="ieqn-15"><mml:math id="mml-ieqn-15"><mml:mo stretchy="false">&#x2192;</mml:mo></mml:math></inline-formula>36%</td>
</tr>
<tr>
<td>Model-level</td>
<td>RA-LLM</td>
<td>Vicuna, Guanaco</td>
<td>98.7% to 10.7% (Vicuna-7B-chat-HF), 96% to 6.7% (Guanaco-7BHF)</td>
</tr>
</tbody>
</table>
</table-wrap><table-wrap id="table-2">
<label>Table 2</label>
<caption>
<title>Attack success rates by category</title>
</caption>
<table>
<colgroup>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th>Attack type</th>
<th>Method</th>
<th>Target models</th>
<th>Success rate</th>
</tr>
</thead>
<tbody>
<tr>
<td>Direct injection</td>
<td>HouYi</td>
<td>36 applications</td>
<td>86.1%</td>
</tr>
<tr>
<td>Virtual injection</td>
<td>VPI</td>
<td>Alpaca 7B</td>
<td>39.6% occurrence</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>We evaluated a variety of defense mechanisms against prompt injection attacks and found them not only somewhat successful but also fairly limited in scope. HOUYI was tested on LLM-integrated applications&#x2014;36 were tested and 31 were identified as vulnerable (an attack success rate of 86.1%), suggesting more robust defenses are necessary in the near future. StruQ, tested against eleven types of prompt injection attacks, showed robust security by reducing attack success rates to less than 2% for most techniques on Alpaca and Mistral models, although it struggled against TAP attacks, reducing their success rate to 9% on Alpaca and 36% on Mistral. RA-LLM reduced attack success rates from up to 98.7% to around 10% for individual and transfer attacks on Vicuna-7B-v1.3-HF and Guanaco-7B-HF models. Additionally, adaptive system prompts and tuned summarizers demonstrated high efficacy, with the tuned summarizer reducing attack success rates to 2% on GPT-4 and 0% on GPT-3.5.</p>
<p>In certain experiments, VPI worked well, indicating effective steering of sentiment, especially OpenAI, which displayed varying success rates based on topic. LLM SELF-DEFENSE also led to improved accuracy in classifying harmful content of GPT-3.5 and LLaMA-2 with 99% and 94.6%, respectively. Another defense-based approach, Guardian, also successfully mitigated all the attack prompts on the LLaMA-2 model, which showed its capacity to uphold ethical standards in language models.</p>
<p>Despite such successes, some limitations and literature recommendations were found. Currently, StruQ is only capable of defending programmatic applications, which makes it vulnerable against web-based chatbots. It is shown that VPI settings do not address all the possible cases, and the evaluation was performed only for 7B and 13B models without considering other sizes. Further, virtual prompts and trigger scenarios make up the complexity throughout the planning and execution of an attack. It also suggests the importance of stronger protective measures against IPI attacks, especially for highly capable LLMs connected with various tools. Finally, future research directions include the creation of a comprehensive evaluation dataset to compare the effectiveness of VPI across different studies, the enhancement of simulations against one of the proposed attacks, namely the Completion attack and the TAP-generated attack, and scalability on the larger-scale model variants. In LLM SELF-DEFENSE, using concrete examples of harm, context-based learning, and logit biasing may provide extra layers of protection against such attacks.</p>
<p>It is crucial to note that benchmarks also have a significant responsibility in knowing and enhancing LLM security. PromptBench assesses LLM resilience against numerous types of adversarial prompts and attacks, defining measures such as PDR to compare models. The proposed INJECAGENT approach identifies the susceptibility of LLM agents to IPI attacks, with reference to realistic attack vectors that inflict financial loss and data theft. BIPIA extends the analysis to indirect attacks and shows that many models are vulnerable in different application tasks. These assist in establishing benchmarks that offer important information on specific areas of weakness and inform the enhancement of other better LLMs.</p>
<p>The importance of these benchmarks is that they can be used to quantitatively compare and analyze the level of defense in LLMs and to encourage the development of new, improved approaches to AI security. It helps reveal the deficits, encourages creativity in protective algorithms, and enhances confidence in artificial intelligence.</p>
<p>Indeed, prompt injection attacks are a very serious threat; however, the creation of progressively sophisticated protection measures and the constant search for universal standards are crucial. Through the regular reassessment and improvement of the LLM security, the AI community can guarantee that valuable and important models can be widely implemented while avoiding or preventing malicious manipulations.</p>
</sec>
<sec id="s7">
<label>7</label>
<title>Conclusion</title>
<p>This review describes the larger effect of Injection Attacks on Large Language Models, especially the prompt injection attack, and also cautions future researchers to come up with strong defenses and a range of benchmarks for the attack. While RA-LLM is proven effective, it has not been tested with better attacks. The future of LLM security should include more thorough red teeming as well as better alignment strategies, especially before the release of open source models [<xref ref-type="bibr" rid="ref-46">46</xref>].</p>
<p>Further directions for research are the extension of such types of attacks to a broader class of models, including multi-modal ones, and the further refinement of the possible harm in textual content generated by the models. The analysis of the optimization-based attack strategies and the corresponding remedies is timely, considering that even contemporary applications, interfaced with LLMs, continue struggling with full-scale recovery from the detected attacks.</p>
<p>Secondly, the nature and the interactive and timely characteristics of LLMs also complicate the evaluation of the effectiveness of these attacks, and a more adequate method of testing is needed. The problems with the believability of the post-produced content and the problems with intention to deceive seem to be lurking in the background of each new step that can be made in the use of advanced LLMs.</p>
<p>However, for parameterizing and for &#x2018;whitewashing&#x2019; the corresponding inputs, more elaborate and sophisticated techniques should be used, and when it comes to such issues as filtering between the safe application&#x2019;s calls and such potentially hostile instructions and/or conditions as allowed for by the LLMs, further work is needed. It is also important to reevaluate or remodel the benchmarks to fit new techniques and newer threats in the field. In addition, more concern should be paid to the primary utilized defense of frameworks like Signed-Prompt method in realizations. In the changing nature of cybersecurity threats, these methods should be applied to new trends of attacks and combined with other elements of security measures, for example, behavior analysis and anomaly detection.</p>
<p>Lastly, it should generalize the attacks to several settings and model scales and pay more attention to methods like VPI. Getting a broader perspective of the virtual prompts and trigger scenarios, and creating a single framework to assess the effectiveness of the attack, will be inevitable in the enhancement of security and solidity of LLMs in defeating the prompt injection attacks.</p>
</sec>
</body>
<back>
<ack>
<p>The author thanks and acknowledges the valuable contributions of the open-source research community, whose work on prompt injection attacks and defenses made this comprehensive review possible.</p>
</ack>
<sec>
<title>Funding Statement</title>
<p>The author did not receive funding from public, commercial, or non-profit sectors.</p>
</sec>
<sec sec-type="data-availability">
<title>Availability of Data and Materials</title>
<p>This study is a literature review based on publicly available research papers and datasets. All sources cited in this review are available through their respective publishers and repositories. No new datasets were generated during this study. The references and citations provide complete access information for all materials used in this review.</p>
</sec>
<sec>
<title>Ethics Approval</title>
<p>This study is a literature review that does not involve human subjects, animal experiments, or the collection of primary data. Therefore, ethics approval was not required for this research.</p>
</sec>
<sec sec-type="COI-statement">
<title>Conflicts of Interest</title>
<p>The author declares no conflicts of interest to report regarding the present study.</p>
</sec>
<app-group id="appg-1">
<app id="app-1">
<title>Appendix A</title>
<p><list list-type="bullet">
<list-item>
<p>AI&#x2014;Artificial Intelligence</p></list-item>
<list-item>
<p>ASR&#x2014;Attack Success Rates</p></list-item>
<list-item>
<p>BAR&#x2014;Benign Answering Rate</p></list-item>
<list-item>
<p>BIPIA&#x2014;Benchmark for Indirect Prompt Injection Attacks</p></list-item>
<list-item>
<p>IPI&#x2014;Indirect Prompt Injection</p></list-item>
<list-item>
<p>LLM&#x2014;Large Language Model</p></list-item>
<list-item>
<p>OWASP&#x2014;Open Worldwide Application Security Project</p></list-item>
<list-item>
<p>PAP&#x2014;Persuasive Adversarial Prompts</p></list-item>
<list-item>
<p>PDR&#x2014;Performance Drop Rate</p></list-item>
<list-item>
<p>QA&#x2014;Question-Answering</p></list-item>
<list-item>
<p>RAC(.)&#x2014;Robust Alignment Check function</p></list-item>
<list-item>
<p>RA-LLM&#x2014;Robustly Aligned LLM</p></list-item>
<list-item>
<p>TCR&#x2014;Traditional Character Replacement</p></list-item>
<list-item>
<p>VPI&#x2014;Virtual Prompt Injection</p></list-item>
</list></p>
</app>
</app-group>
<ref-list content-type="authoryear">
<title>References</title>
<ref id="ref-1"><label>[1]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Floridi</surname> <given-names>L</given-names></string-name>, <string-name><surname>Chiriatti</surname> <given-names>M</given-names></string-name></person-group>. <article-title>GPT-3: its nature, scope, limits, and consequences</article-title>. <source>Mines Mach</source>. <year>2020</year>;<volume>30</volume>(<issue>4</issue>):<fpage>681</fpage>&#x2013;<lpage>94</lpage>. doi:<pub-id pub-id-type="doi">10.1007/s11023-020-09548-1</pub-id>.</mixed-citation></ref>
<ref id="ref-2"><label>[2]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Zhang</surname> <given-names>M</given-names></string-name>, <string-name><surname>Li</surname> <given-names>J</given-names></string-name></person-group>. <article-title>A commentary of GPT-3 in MIT technology review 2021</article-title>. <source>Fundam Res</source>. <year>2021</year>;<volume>1</volume>(<issue>6</issue>):<fpage>831</fpage>&#x2013;<lpage>3</lpage>. doi:<pub-id pub-id-type="doi">10.1016/j.fmre.2021.11.011</pub-id>.</mixed-citation></ref>
<ref id="ref-3"><label>[3]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Yao</surname> <given-names>D</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Harris</surname> <given-names>IG</given-names></string-name>, <string-name><surname>Carlsson</surname> <given-names>M</given-names></string-name></person-group>. <article-title>FuzzLLM: a novel and universal fuzzing framework for proactively discovering jailbreak vulnerabilities in large language models</article-title>. In: <conf-name>ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); 2024 Apr 14&#x2013;19</conf-name>; <publisher-loc>Seoul, Republic of Korea</publisher-loc>. p. <fpage>4485</fpage>&#x2013;<lpage>9</lpage>. doi:<pub-id pub-id-type="doi">10.1109/ICASSP48485.2024.10448041</pub-id>.</mixed-citation></ref>
<ref id="ref-4"><label>[4]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Liu</surname> <given-names>X</given-names></string-name>, <string-name><surname>Yu</surname> <given-names>H</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>H</given-names></string-name>, <string-name><surname>Xu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Lei</surname> <given-names>X</given-names></string-name>, <string-name><surname>Lai</surname> <given-names>H</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Agentbench: evaluating LLMS as agents</article-title>. <comment>arXiv:2308.03688. 2023</comment>.</mixed-citation></ref>
<ref id="ref-5"><label>[5]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Hou</surname> <given-names>X</given-names></string-name>, <string-name><surname>Zhao</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Yang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>K</given-names></string-name>, <string-name><surname>Li</surname> <given-names>L</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Large language models for software engineering: a systematic literature review</article-title>. <source>ACM Trans Softw Eng Methodol</source>. <year>2024</year>;<volume>33</volume>(<issue>8</issue>):<fpage>1</fpage>&#x2013;<lpage>79</lpage>. doi:<pub-id pub-id-type="doi">10.1145/3695988</pub-id>.</mixed-citation></ref>
<ref id="ref-6"><label>[6]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Yin</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Ding</surname> <given-names>W</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>J</given-names></string-name></person-group>. <article-title>Alignment is not sufficient to prevent large language models from generating harmful information: a psychoanalytic perspective</article-title>. <comment>arXiv:2311.08487. 2023</comment>.</mixed-citation></ref>
<ref id="ref-7"><label>[7]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zou</surname> <given-names>A</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Carlini</surname> <given-names>N</given-names></string-name>, <string-name><surname>Milad Nasr</surname> <given-names>JZK</given-names></string-name>, <string-name><surname>Fredrikson</surname> <given-names>M</given-names></string-name></person-group>. <article-title>Universal and transferable adversarial attacks on aligned language models</article-title>. <comment>arXiv:2307.15043. 2023</comment>.</mixed-citation></ref>
<ref id="ref-8"><label>[8]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Goyal</surname> <given-names>S</given-names></string-name>, <string-name><surname>Doddapaneni</surname> <given-names>S</given-names></string-name>, <string-name><surname>Khapra</surname> <given-names>MM</given-names></string-name>, <string-name><surname>Ravindran</surname> <given-names>B</given-names></string-name></person-group>. <article-title>A survey of adversarial defenses and robustness in NLP</article-title>. <source>ACM Comput Surv</source>. <year>2023</year>;<volume>55</volume>(<issue>14s</issue>):<fpage>1</fpage>&#x2013;<lpage>39</lpage>. doi:<pub-id pub-id-type="doi">10.1145/3593042</pub-id>.</mixed-citation></ref>
<ref id="ref-9"><label>[9]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Wei</surname> <given-names>A</given-names></string-name>, <string-name><surname>Haghtalab</surname> <given-names>N</given-names></string-name>, <string-name><surname>Steinhardt</surname> <given-names>J</given-names></string-name></person-group>. <article-title>Jailbroken: how does llm safety training fail?</article-title> <comment>arXiv:2307.02483. 2023</comment>.</mixed-citation></ref>
<ref id="ref-10"><label>[10]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Mozes</surname> <given-names>M</given-names></string-name>, <string-name><surname>He</surname> <given-names>X</given-names></string-name>, <string-name><surname>Kleinberg</surname> <given-names>B</given-names></string-name>, <string-name><surname>Griffin</surname> <given-names>LD</given-names></string-name></person-group>. <article-title>Use of llms for illicit purposes: threats, prevention measures, and vulnerabilities</article-title>. <comment>arXiv:2308.12833. 2023</comment>.</mixed-citation></ref>
<ref id="ref-11"><label>[11]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Rossi</surname> <given-names>S</given-names></string-name>, <string-name><surname>Michel</surname> <given-names>AM</given-names></string-name>, <string-name><surname>Mukkamala</surname> <given-names>RR</given-names></string-name>, <string-name><surname>Thatcher</surname> <given-names>JB</given-names></string-name></person-group>. <article-title>An early categorization of prompt injection attacks on large language models</article-title>. <comment>arXiv:2402.00898. 2024</comment>.</mixed-citation></ref>
<ref id="ref-12"><label>[12]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Hines</surname> <given-names>K</given-names></string-name>, <string-name><surname>Lopez</surname> <given-names>G</given-names></string-name>, <string-name><surname>Hall</surname> <given-names>M</given-names></string-name>, <string-name><surname>Zarfati</surname> <given-names>F</given-names></string-name>, <string-name><surname>Zunger</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Kiciman</surname> <given-names>E</given-names></string-name></person-group>. <article-title>Defending against indirect prompt injection attacks with spotlighting</article-title>. <comment>arXiv:2403.14720. 2024</comment>.</mixed-citation></ref>
<ref id="ref-13"><label>[13]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Shi</surname> <given-names>J</given-names></string-name>, <string-name><surname>Yuan</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Huang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Zhou</surname> <given-names>P</given-names></string-name>, <string-name><surname>Sun</surname> <given-names>L</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Optimization-based prompt injection attack to LLM-as-a-judge</article-title>. <comment>arXiv:2403.17710. 2024</comment>.</mixed-citation></ref>
<ref id="ref-14"><label>[14]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Perez</surname> <given-names>F</given-names></string-name>, <string-name><surname>Ribeiro</surname> <given-names>I</given-names></string-name></person-group>. <article-title>Ignore previous prompt: attack techniques for language models</article-title>. <comment>arXiv:2211.09527. 2022</comment>.</mixed-citation></ref>
<ref id="ref-15"><label>[15]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Liu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Deng</surname> <given-names>G</given-names></string-name>, <string-name><surname>Xu</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Li</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Zheng</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>Y</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Jailbreaking chatgpt via prompt engineering: an empirical study</article-title>. <comment>arXiv:2305.13860. 2024</comment>.</mixed-citation></ref>
<ref id="ref-16"><label>[16]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Yan</surname> <given-names>B</given-names></string-name>, <string-name><surname>Li</surname> <given-names>K</given-names></string-name>, <string-name><surname>Xu</surname> <given-names>M</given-names></string-name>, <string-name><surname>Dong</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Ren</surname> <given-names>Z</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>On protecting the data privacy of large language models (LLMS): a survey</article-title>. <comment>arXiv:2403.05156. 2024</comment>.</mixed-citation></ref>
<ref id="ref-17"><label>[17]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Phute</surname> <given-names>M</given-names></string-name>, <string-name><surname>Helbling</surname> <given-names>A</given-names></string-name>, <string-name><surname>Hull</surname> <given-names>M</given-names></string-name>, <string-name><surname>Peng</surname> <given-names>SY</given-names></string-name>, <string-name><surname>Szyller</surname> <given-names>S</given-names></string-name>, <string-name><surname>Cornelius</surname> <given-names>C</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>LLM self defense: by self examination, LLMS know they are being tricked</article-title>. <comment>arXiv:2308.07308. 2024</comment>.</mixed-citation></ref>
<ref id="ref-18"><label>[18]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Qi</surname> <given-names>X</given-names></string-name>, <string-name><surname>Zeng</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Xie</surname> <given-names>T</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>P-Y</given-names></string-name>, <string-name><surname>Jia</surname> <given-names>R</given-names></string-name>, <string-name><surname>Mittal</surname> <given-names>P</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Fine-tuning aligned language models compromises safety, even when users do not intend to!</article-title> <comment>arXiv:2310.03693. 2023</comment>.</mixed-citation></ref>
<ref id="ref-19"><label>[19]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Chan</surname> <given-names>CF</given-names></string-name>, <string-name><surname>Yip</surname> <given-names>DW</given-names></string-name>, <string-name><surname>Esmradi</surname> <given-names>A</given-names></string-name></person-group>. <article-title>Detection and defense against prominent attacks on preconditioned LLM-integrated virtual assistants</article-title>. In: <conf-name>2023 IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE); 2023 Dec 4&#x2013;6</conf-name>; <publisher-loc>Nadi, Fiji</publisher-loc>. p. <fpage>1</fpage>&#x2013;<lpage>5</lpage>. doi:<pub-id pub-id-type="doi">10.1109/csde59766.2023.10487759</pub-id>.</mixed-citation></ref>
<ref id="ref-20"><label>[20]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Liu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Jia</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Geng</surname> <given-names>R</given-names></string-name>, <string-name><surname>Jia</surname> <given-names>J</given-names></string-name>, <string-name><surname>Gong</surname> <given-names>NZ</given-names></string-name></person-group>. <article-title>Prompt injection attacks and defenses in LLM-integrated applications</article-title>. <comment>arXiv:2310.12815. 2023</comment>.</mixed-citation></ref>
<ref id="ref-21"><label>[21]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Bhardwaj</surname> <given-names>R</given-names></string-name>, <string-name><surname>Poria</surname> <given-names>S</given-names></string-name></person-group>. <article-title>Red-teaming large language models using chain of utterances for safety-alignment</article-title>. <comment>arXiv:2308.09662. 2023</comment>.</mixed-citation></ref>
<ref id="ref-22"><label>[22]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Li</surname> <given-names>H</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Luo</surname> <given-names>J</given-names></string-name>, <string-name><surname>Kang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>X</given-names></string-name>, <string-name><surname>Hu</surname> <given-names>Q</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Privacy in large language models: attacks, defenses and future directions</article-title>. <comment>arXiv:2310.10383. 2023</comment>.</mixed-citation></ref>
<ref id="ref-23"><label>[23]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Kumar</surname> <given-names>A</given-names></string-name>, <string-name><surname>Agarwal</surname> <given-names>C</given-names></string-name>, <string-name><surname>Srinivas</surname> <given-names>S</given-names></string-name>, <string-name><surname>Li</surname> <given-names>AJ</given-names></string-name>, <string-name><surname>Feizi</surname> <given-names>S</given-names></string-name>, <string-name><surname>Lakkaraju</surname> <given-names>H</given-names></string-name></person-group>. <article-title>Certifying LLM safety against adversarial prompting</article-title>. <comment>arXiv:2309.02705. 2024</comment>.</mixed-citation></ref>
<ref id="ref-24"><label>[24]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Chan</surname> <given-names>C-M</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>W</given-names></string-name>, <string-name><surname>Su</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Yu</surname> <given-names>J</given-names></string-name>, <string-name><surname>Xue</surname> <given-names>W</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>S</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Chateval: towards better LLM-based evaluators through multi-agent debate</article-title>. <comment>arXiv:2308.07201. 2023</comment>.</mixed-citation></ref>
<ref id="ref-25"><label>[25]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Tang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>B</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>X</given-names></string-name>, <string-name><surname>Zhao</surname> <given-names>D</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>J</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>J</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Rolebreak: character hallucination as a jailbreak attack in role-playing systems</article-title>. <comment>arXiv:2409.16727. 2024</comment>.</mixed-citation></ref>
<ref id="ref-26"><label>[26]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Ding</surname> <given-names>P</given-names></string-name>, <string-name><surname>Kuang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Ma</surname> <given-names>D</given-names></string-name>, <string-name><surname>Cao</surname> <given-names>X</given-names></string-name>, <string-name><surname>Xian</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>J</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>A wolf in sheep&#x2019;s clothing: generalized nested jailbreak prompts can fool large language models easily</article-title>. <comment>arXiv:2311.08268. 2023</comment>.</mixed-citation></ref>
<ref id="ref-27"><label>[27]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Wei</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Li</surname> <given-names>A</given-names></string-name>, <string-name><surname>Mo</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Y</given-names></string-name></person-group>. <article-title>Jailbreak and guard aligned language models with only few in-context demonstrations</article-title>. <comment>arXiv:2310.06387. 2023</comment>.</mixed-citation></ref>
<ref id="ref-28"><label>[28]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zheng</surname> <given-names>X</given-names></string-name>, <string-name><surname>Pang</surname> <given-names>T</given-names></string-name>, <string-name><surname>Du</surname> <given-names>C</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>Q</given-names></string-name>, <string-name><surname>Jiang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Lin</surname> <given-names>M</given-names></string-name></person-group>. <article-title>Improved few-shot jailbreaking can circumvent aligned language models and their defenses</article-title>. <comment>arXiv:2406.01288. 2024</comment>.</mixed-citation></ref>
<ref id="ref-29"><label>[29]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Yuan</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Jiao</surname> <given-names>W</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>W</given-names></string-name>, <string-name><surname>Huang</surname> <given-names>JT</given-names></string-name>, <string-name><surname>He</surname> <given-names>P</given-names></string-name>, <string-name><surname>Shi</surname> <given-names>S</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>GPT-4 is too smart to be safe: stealthy chat with LLMs via cipher</article-title>. <comment>arXiv:2308.06463. 2023</comment>.</mixed-citation></ref>
<ref id="ref-30"><label>[30]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zhang</surname> <given-names>T</given-names></string-name>, <string-name><surname>Cao</surname> <given-names>B</given-names></string-name>, <string-name><surname>Cao</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Lin</surname> <given-names>L</given-names></string-name>, <string-name><surname>Mitra</surname> <given-names>P</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>J</given-names></string-name></person-group>. <article-title>WordGame: efficient &#x0026; effective LLM jailbreak via simultaneous obfuscation in query and response</article-title>. <comment>arXiv:2405.14023. 2024</comment>.</mixed-citation></ref>
<ref id="ref-31"><label>[31]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zhang</surname> <given-names>R</given-names></string-name>, <string-name><surname>Sullivan</surname> <given-names>D</given-names></string-name>, <string-name><surname>Jackson</surname> <given-names>K</given-names></string-name>, <string-name><surname>Xie</surname> <given-names>P</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>M</given-names></string-name></person-group>. <article-title>Defense against prompt injection attacks via mixture of encodings</article-title>. <comment>arXiv:2504.07467. 2025</comment>.</mixed-citation></ref>
<ref id="ref-32"><label>[32]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Xian</surname> <given-names>X</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>T</given-names></string-name>, <string-name><surname>You</surname> <given-names>L</given-names></string-name>, <string-name><surname>Qi</surname> <given-names>Y</given-names></string-name></person-group>. <article-title>Understanding data poisoning attacks for RAG: insights and algorithms</article-title>. In: <conf-name>The Thirteenth International Conference on Learning Representations, ICLR 2025; 2025 Apr 24&#x2013;28</conf-name>; <publisher-loc>Singapore</publisher-loc>. p. <fpage>1</fpage>&#x2013;<lpage>13</lpage>.</mixed-citation></ref>
<ref id="ref-33"><label>[33]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Li</surname> <given-names>C</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Cheng</surname> <given-names>A</given-names></string-name>, <string-name><surname>Ma</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Li</surname> <given-names>X</given-names></string-name>, <string-name><surname>Ma</surname> <given-names>J</given-names></string-name></person-group>. <article-title>CPA-RAG: covert poisoning attacks on retrieval-augmented generation in large language models</article-title>. <comment>arXiv:2505.19864. 2025</comment>.</mixed-citation></ref>
<ref id="ref-34"><label>[34]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Alon</surname> <given-names>G</given-names></string-name>, <string-name><surname>Kamfonas</surname> <given-names>MJ</given-names></string-name></person-group>. <article-title>Detecting language model attacks with perplexity</article-title>. In: <conf-name>The Twelfth International Conference on Learning Representations, ICLR 2024; 2024 May 7&#x2013;11</conf-name>; <publisher-loc>Vienna Austria</publisher-loc>. p. <fpage>1</fpage>&#x2013;<lpage>21</lpage>.</mixed-citation></ref>
<ref id="ref-35"><label>[35]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Shi</surname> <given-names>T</given-names></string-name>, <string-name><surname>Zhu</surname> <given-names>K</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Jia</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Cai</surname> <given-names>W</given-names></string-name>, <string-name><surname>Liang</surname> <given-names>W</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Promptarmor: simple yet effective prompt injection defenses</article-title>. <comment>arXiv:2507.15219. 2025</comment>.</mixed-citation></ref>
<ref id="ref-36"><label>[36]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Liu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Deng</surname> <given-names>G</given-names></string-name>, <string-name><surname>Li</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>K</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>X</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Prompt injection attack against LLM-integrated applications</article-title>. <comment>arXiv:2306.05499. 2024</comment>.</mixed-citation></ref>
<ref id="ref-37"><label>[37]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Yan</surname> <given-names>J</given-names></string-name>, <string-name><surname>Yadav</surname> <given-names>V</given-names></string-name>, <string-name><surname>Li</surname> <given-names>S</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>L</given-names></string-name>, <string-name><surname>Tang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>H</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Backdooring instruction-tuned large language models with virtual prompt injection, arXiv</article-title>. <comment>arXiv:2307.16888. 2024</comment>.</mixed-citation></ref>
<ref id="ref-38"><label>[38]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Chen</surname> <given-names>S</given-names></string-name>, <string-name><surname>Piet</surname> <given-names>J</given-names></string-name>, <string-name><surname>Sitawarin</surname> <given-names>C</given-names></string-name>, <string-name><surname>Wagner</surname> <given-names>D</given-names></string-name></person-group>. <article-title>Struq: defending against prompt injection with structured queries</article-title>. <comment>arXiv:2402.06363. 2024</comment>.</mixed-citation></ref>
<ref id="ref-39"><label>[39]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Suo</surname> <given-names>X</given-names></string-name></person-group>. <article-title>Signed-prompt: a new approach to prevent prompt injection attacks against LLM-integrated applications</article-title>. <comment>arXiv:2401.07612. 2024</comment>.</mixed-citation></ref>
<ref id="ref-40"><label>[40]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zeng</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Lin</surname> <given-names>H</given-names></string-name>, <string-name><surname>Zhang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Yang</surname> <given-names>D</given-names></string-name>, <string-name><surname>Jia</surname> <given-names>R</given-names></string-name>, <string-name><surname>Shi</surname> <given-names>W</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>How johnny can persuade LLMs to jailbreak them: rethinking persuasion to challenge AI safety by humanizing LLMs</article-title>. <comment>arXiv:2401.06373. 2024</comment>.</mixed-citation></ref>
<ref id="ref-41"><label>[41]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Rai</surname> <given-names>P</given-names></string-name>, <string-name><surname>Sood</surname> <given-names>S</given-names></string-name>, <string-name><surname>Madisetti</surname> <given-names>VK</given-names></string-name>, <string-name><surname>Bahga</surname> <given-names>A</given-names></string-name></person-group>. <article-title>GUARDIAN: A multi-tiered defense architecture for thwarting prompt injection attacks on LLMs</article-title>. <source>J Softw Eng Appl</source>. <year>2024</year>;<volume>17</volume>(<issue>1</issue>):<fpage>43</fpage>&#x2013;<lpage>68</lpage>. doi:<pub-id pub-id-type="doi">10.4236/jsea.2024.171003</pub-id>.</mixed-citation></ref>
<ref id="ref-42"><label>[42]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zhu</surname> <given-names>K</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>J</given-names></string-name>, <string-name><surname>Zhou</surname> <given-names>J</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>H</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Y</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Promptbench: towards evaluating the robustness of large language models on adversarial prompts</article-title>. <comment>arXiv:2306.04528. 2023</comment>.</mixed-citation></ref>
<ref id="ref-43"><label>[43]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Papineni</surname> <given-names>K</given-names></string-name>, <string-name><surname>Roukos</surname> <given-names>S</given-names></string-name>, <string-name><surname>Ward</surname> <given-names>T</given-names></string-name>, <string-name><surname>Zhu</surname> <given-names>WJ</given-names></string-name></person-group>. <article-title>BLEU: a method for automatic evaluation of machine translation</article-title>. In: <conf-name>Proceedings of the 40th Annual Meeting on Association for Computational Linguistics&#x2014;ACL &#x0027;02; 2002 Jul 7&#x2013;12</conf-name>; <publisher-loc>Philadelphia, PA. USA</publisher-loc>. p. <fpage>311</fpage>&#x2013;<lpage>8</lpage>. doi:<pub-id pub-id-type="doi">10.3115/1073083.1073135</pub-id>.</mixed-citation></ref>
<ref id="ref-44"><label>[44]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Zhan</surname> <given-names>Q</given-names></string-name>, <string-name><surname>Liang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Ying</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Kang</surname> <given-names>D</given-names></string-name></person-group>. <article-title>Injecagent: benchmarking indirect prompt injections in tool-integrated large language model agents</article-title>. <comment>arXiv:2403.02691. 2024</comment>.</mixed-citation></ref>
<ref id="ref-45"><label>[45]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Yi</surname> <given-names>J</given-names></string-name>, <string-name><surname>Xie</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Zhu</surname> <given-names>B</given-names></string-name>, <string-name><surname>Kiciman</surname> <given-names>E</given-names></string-name>, <string-name><surname>Sun</surname> <given-names>G</given-names></string-name>, <string-name><surname>Xie</surname> <given-names>X</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>Benchmarking and defending against indirect prompt injection attacks on large language models</article-title>. <comment>arXiv:2312.14197. 2023</comment>.</mixed-citation></ref>
<ref id="ref-46"><label>[46]</label><mixed-citation publication-type="other"><person-group person-group-type="author"><string-name><surname>Huang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Gupta</surname> <given-names>S</given-names></string-name>, <string-name><surname>Xia</surname> <given-names>M</given-names></string-name>, <string-name><surname>Li</surname> <given-names>K</given-names></string-name>, <string-name><surname>Chen</surname> <given-names>D</given-names></string-name></person-group>. <article-title>Catastrophic jailbreak of open-source LLMs via exploiting generation</article-title>. <comment>arXiv:2310.06987. 2023</comment>.</mixed-citation></ref>
</ref-list>
</back></article>