حقن المحفز غير المباشر في نماذج اللغة الكبيرة Indirect prompt injection in large language models

شارك:
المجلة: Neural Computing and Applications، المجلد: 38، العدد: 13
DOI: https://doi.org/10.1007/s00521-026-12266-x
تاريخ النشر: 2026-06-23
المؤلف: Alfredo Milani وآخرون
الموضوع الرئيسي: الصلابة ضد الهجمات في تعلم الآلة

نظرة عامة

تستكشف هذه الورقة التهديد الناشئ لهجمات حقن الأوامر غير المباشرة على نماذج اللغة الكبيرة التوليدية (LLMs)، حيث يقوم الوكلاء الخبيثون بإدخال أوامر خادعة ضمن نصوص غير ضارة للتلاعب بمخرجات LLM. تسلط الدراسة الضوء على المخاطر الكبيرة التي تطرحها مثل هذه الهجمات، خاصة في سياقات مثل الموارد البشرية والتعليم، حيث يتم استخدام LLM بشكل متزايد في مهام مثل اختيار الموظفين ومراجعات المقالات الآلية. يمكن أن تؤدي الأوامر المخفية إلى تغيير سلوك LLM بشكل طفيف، مما يؤدي إلى مخرجات تنحرف عن نوايا المستخدم. يقوم المؤلفون بتحليل هيكل هذه الهجمات، وتقييم ضعف نماذج LLM الشهيرة، واقتراح تدابير مضادة محتملة.

تكشف النتائج أن جميع نماذج LLM المختبرة عرضة لحقن الأوامر غير المباشرة، مما يثير القلق بشأن موثوقيتها في دعم العمل الفكري. تختلف فعالية هذه الهجمات بناءً على بنية النموذج وخصائص الوثيقة، مثل الطول وكثافة الإنجاز (AD). من المهم أن تميز الدراسة بين الكشف والتخفيف، مشيرة إلى أن قدرة النموذج على تحديد الحقن لا تضمن قدرته على تحييدها. لمعالجة هذه التحديات، يقترح المؤلفون استراتيجية توسيع الأوامر التي تولد تنبيهات بشكل فعال للحقن عبر أنواع مختلفة من الوثائق، مما يمكّن مستخدمي LLM من تعزيز الأمان دون الاعتماد فقط على الحمايات على مستوى النظام. تؤكد الأبحاث على الحاجة إلى مصممي LLM لإنشاء هياكل تدير تدفقات المعلومات بشكل أفضل، مما يضمن فصلًا واضحًا بين الأوامر القابلة للتنفيذ والمعرفة المعالجة.

مقدمة

تسلط مقدمة هذه الورقة البحثية الضوء على التهديد الناشئ لهجمات حقن الأوامر على نماذج اللغة الكبيرة (LLMs)، التي حظيت باهتمام إعلامي كبير بسبب قدرتها على التلاعب وتشويه مخرجات الذكاء الاصطناعي التوليدي (GAI). تمثل هذه الهجمات فئة أوسع من الثغرات المرتبطة بعدم كفاية التحقق من المدخلات، وهي مشكلة موثقة جيدًا في أمان البرمجيات يمكن أن تؤدي إلى استغلال خبيث. يؤكد المؤلفون على الحاجة الملحة لآليات تحقق قوية من المدخلات للحماية من مثل هذه الثغرات، خاصة مع استخدام LLM بشكل متزايد عبر مجالات عالية المخاطر، بما في ذلك التعليم والرعاية الصحية.

مع التركيز على تقييم السيرة الذاتية (CV) كحالة استخدام رئيسية، تستكشف الورقة كيف يمكن أن تستغل حقن الأوامر الثغرات الهيكلية في الوثائق، مثل طول الوثيقة وكثافة المعلومات. تمتد تداعيات هذه النتائج إلى ما هو أبعد من سيناريوهات الموارد البشرية، مما يشير إلى أن مخاطر مماثلة قد تؤثر على الأنظمة الآلية في مجالات أخرى. يحدد المؤلفون نهجهم لفحص تقنيات الحقن والتعتيم المختلفة، ويقترحون تدابير مضادة، ويشرحون منهجيتهم التجريبية ونتائجهم. تهدف الورقة إلى المساهمة في فهم تأثير حقن الأوامر على LLM وإبلاغ اتجاهات البحث المستقبلية في هذا المجال الحرج.

الطرق

في هذا القسم، يقدم المؤلفون تحليلًا شاملاً لحملتهم التجريبية التي تشمل 27 وكيل محادثة متنوع و6 نماذج لغة كبيرة متقدمة (LLMs). يستخدمون مقاييس محددة—معدل نجاح الهجوم (ASR)، وكفاءة التخفيف (ME)، ومعدل تنبيه الكشف (DAR)—لتقييم ضعف هذه النماذج أمام هجمات حقن الأوامر غير المباشرة وتقييم فعالية آلية الدفاع المقترحة، وهي توسيع الأوامر الخارجية (OPE).

تشير النتائج إلى أن جميع الأنظمة المختبرة تظهر قابلية للإصابة بالهجمات التي تم تحليلها، والتي تشمل سيناريوهات حقن وثيقة واحدة وحقن متعددة الوثائق. يبرز هذا قلقًا أمنيًا كبيرًا ضمن المشهد الحالي للذكاء الاصطناعي المحادثاتي ويؤكد الحاجة إلى استراتيجيات دفاع قوية للتخفيف من مثل هذه الثغرات.

المناقشة

تسلط قسم المناقشة في الورقة البحثية الضوء على القضية الحرجة لثغرات حقن الأوامر في نماذج اللغة الكبيرة (LLMs)، كما اعترفت بها المنظمات الرائدة مثل CWE وOWASP وNIST. تم تحديد حقن الأوامر، الذي ينطوي على قيام الخصوم بصياغة مدخلات خبيثة للتلاعب بمخرجات LLM، كأحد أعلى مخاطر الأمان في تطبيقات البرمجيات لعام 2024. تؤكد الورقة على الطبيعة المزدوجة لهجمات حقن الأوامر—المباشرة وغير المباشرة—حيث يمكن أن تحدث الأخيرة عندما يتم تضمين أوامر خبيثة في الوثائق المعالجة بواسطة LLM. يقدم المؤلفون سيناريو يتضمن مدير موارد بشرية يستخدم LLM لتقييم المرشحين، موضحين كيف يمكن للمهاجم استغلال حقن الأوامر غير المباشرة لتشويه تقييم السير الذاتية، مما يؤثر على قرارات التوظيف دون وعي المستخدم.

لمعالجة هذه الثغرات، يقترح المؤلفون تدبيرًا مضادًا جديدًا يسمى توسيع الأوامر الخارجية (OPE)، والذي يعمل كغلاف أمني حول مدخلات المستخدم. تتكون هذه الآلية من ثلاث طبقات وظيفية مصممة لإعطاء الأولوية لتوجيهات الأمان على التعليمات الضارة المحتملة المضمنة في بيانات المدخلات. تقدم الورقة عدة مقاييس كمية، مثل معدل نجاح الهجوم (ASR) ومعدل تنبيه الكشف (DAR)، لتقييم فعالية OPE المقترحة في التخفيف من هجمات حقن الأوامر. يجادل المؤلفون بأن نهجهم لا يعزز فقط أمان تطبيقات LLM ولكن أيضًا يوفر حلاً عمليًا للمستخدمين النهائيين، خاصة في السيناريوهات عالية المخاطر مثل تقييمات الموارد البشرية. بشكل عام، تساهم الأبحاث في النقاش المستمر حول تأمين أنظمة الذكاء الاصطناعي ضد التهديدات الناشئة، مما يؤكد الحاجة إلى دفاعات قوية ضد ثغرات حقن الأوامر.

Journal: Neural Computing and Applications, Volume: 38, Issue: 13
DOI: https://doi.org/10.1007/s00521-026-12266-x
Publication Date: 2026-06-23
Author(s): Alfredo Milani et al.
Primary Topic: Adversarial Robustness in Machine Learning

Overview

This paper investigates the emerging threat of indirect prompt injection attacks on Generative Large Language Models (LLMs), where malicious agents embed deceptive prompts within benign text to manipulate LLM outputs. The study highlights the significant risks posed by such attacks, particularly in contexts like human resources and education, where LLMs are increasingly utilized for tasks such as personnel selection and automated essay reviews. The hidden prompts can subtly alter the behavior of LLMs, leading to outputs that deviate from user intentions. The authors analyze the structure of these attacks, assess the vulnerability of popular LLMs, and propose potential countermeasures.

The findings reveal that all tested LLMs are vulnerable to indirect prompt injection, raising concerns about their reliability in supporting intellectual work. The effectiveness of these attacks varies based on model architecture and document characteristics, such as length and Achievement Density (AD). Importantly, the study distinguishes between detection and mitigation, noting that a model’s ability to identify an injection does not guarantee its capacity to neutralize it. To address these challenges, the authors propose a prompt extension strategy that effectively generates alerts for injections across various document types, empowering LLM users to enhance security without relying solely on system-level protections. The research underscores the need for LLM designers to create architectures that better manage information flows, ensuring a clear separation between executable prompts and processed knowledge.

Introduction

The introduction of this research paper highlights the emerging threat of prompt injection attacks on Large Language Models (LLMs), which have garnered significant media attention due to their potential to manipulate and distort the outputs of Generative Artificial Intelligence (GAI). These attacks exemplify a broader category of vulnerabilities associated with insufficient input validation, a well-documented issue in software security that can lead to malicious exploitation. The authors emphasize the critical need for robust input validation mechanisms to safeguard against such vulnerabilities, particularly as LLMs are increasingly utilized across various high-stakes domains, including Education and Healthcare.

Focusing on the evaluation of Curriculum Vitae (CV) as a primary use case, the paper investigates how prompt injection can exploit structural document vulnerabilities, such as document length and information density. The implications of these findings extend beyond HR scenarios, suggesting that similar risks may affect automated systems in other fields. The authors outline their approach to examining various injection and obfuscation techniques, propose countermeasures, and detail their experimental methodology and results. The paper aims to contribute to the understanding of prompt injection’s impact on LLMs and to inform future research directions in this critical area.

Methods

In this section, the authors present a comprehensive analysis of their experimental campaign involving 27 heterogeneous conversational agents (CVs) and six advanced Large Language Models (LLMs). They utilize specific metrics—Attack Success Rate (ASR), Mitigation Efficiency (ME), and Detection Alert Rate (DAR)—to assess the vulnerability of these models to indirect prompt injection attacks and to evaluate the effectiveness of their proposed defense mechanism, the Outer Prompt Extension (OPE).

The findings indicate that all systems tested exhibit susceptibility to the attacks analyzed, which encompass both single-document and multi-document injection scenarios. This highlights a significant security concern within the current landscape of conversational AI and underscores the need for robust defense strategies to mitigate such vulnerabilities.

Discussion

The discussion section of the research paper highlights the critical issue of prompt injection vulnerabilities in Large Language Models (LLMs), as recognized by leading organizations such as CWE, OWASP, and NIST. Prompt injection, which involves adversaries crafting malicious inputs to manipulate LLM outputs, has been identified as a top security risk in software applications for 2024. The paper emphasizes the dual nature of prompt injection attacks—direct and indirect—where the latter can occur when malicious prompts are embedded in documents processed by the LLM. The authors present a scenario involving an HR manager using LLMs for candidate evaluation, illustrating how an attacker could exploit indirect prompt injection to skew the evaluation of CVs, thereby influencing hiring decisions without the user’s awareness.

To address these vulnerabilities, the authors propose a novel countermeasure called Outer Prompt Extension (OPE), which acts as a security wrapper around user inputs. This mechanism consists of three functional layers designed to prioritize security directives over potentially harmful instructions embedded within the input data. The paper introduces several quantitative metrics, such as Attack Success Rate (ASR) and Detection Alert Rate (DAR), to assess the effectiveness of the proposed OPE in mitigating prompt injection attacks. The authors argue that their approach not only enhances the security of LLM applications but also provides a practical solution for end-users, particularly in high-stakes scenarios like HR evaluations. Overall, the research contributes to the ongoing discourse on securing AI systems against emerging threats, emphasizing the need for robust defenses against prompt injection vulnerabilities.