SCD-Net: A Deep Semantic Contrastive Defense Network Against Prompt Injection in Power Grid LLMs
Abstract
The integration of Large Language Models (LLMs) into power grid Supervisory Control and Data Acquisition (SCADA) systems introduces unprecedented operational efficiencies but exposes critical infrastructure to stealthy prompt injection attacks. Conventional defenses, such as statistical gateways and general-domain perplexity filters, suffer from severe domain mismatches when applied to specialized industrial contexts, resulting in an irreconcilable trade-off between system usability and security. To address this fundamental limitation, we propose the Deep Semantic Contrastive Defense Network (SCD-Net). By projecting unstructured instructions into a normalized contrastive space, SCD-Net's fail-safe prototype mechanism accurately measures cosine disparities to intercept out-of-distribution (OOD) semantic camouflage attacks. Furthermore, we introduce PowerAdv, a large-scale, high-fidelity SCADA LLM security benchmark featuring zero-shot deceptive payloads. Extensive empirical evaluations demonstrate that SCD-Net effectively compresses the OOD Gateway Attack Success Rate (GASR) to a highly robust 16.42% while maintaining a near-zero In-Distribution False Positive Rate (ID FPR) of 0.39% and an exceptional OOD FPR of 11.97%, drastically outperforming existing baselines. Our framework provides a highly reliable zero-shot anomaly routing paradigm for securing intelligent middleware in critical infrastructure.