DOI: 10.3390/electronics15163640 ISSN: 2079-9292

DT-GenShield: A Digital Twin-Driven Runtime Security Architecture for Protecting Large Language Models Against Indirect Prompt Injection

Alaa Alnemari, Mashael M. Alsulami

Large Language Models (LLMs) are increasingly deployed in security-critical applications but remain vulnerable to indirect prompt injection attacks that cannot be fully addressed by conventional prompt detection techniques. This paper proposes DT-GenShield, a Digital Twin-driven runtime security architecture that integrates semantic threat detection, operational state representation, policy-guided mediation, and runtime logging to protect LLM-based systems before model inference. The proposed architecture was evaluated using the LLMail-Inject, BIPIA, and LLM-PIEval benchmarks under matched baseline and DT-mediated execution. Experimental results across the LLMail-Inject, BIPIA, and LLM-PIEval benchmarks demonstrate consistent improvements in runtime protection under the evaluated experimental settings. On the LLMail-Inject benchmark, DT-GenShield reduced the Attack Success Rate (ASR) from 9.50% to 5.50%, corresponding to a relative reduction of 42.11%, while additional validation on the BIPIA benchmark confirmed effective suppression of malicious prompt propagation with minimal impact on legitimate requests. These findings demonstrate that Digital Twin-driven runtime mediation extends prompt injection defense beyond standalone detection and provides an effective architecture for securing LLM-based systems against emerging semantic attacks.

More from our Archive