cs.AIAug 15, 2026

TwinGridShield: Consequence-Aware Runtime Authorization for LLM Grid-Agent Actions

Authors: Md Fazley Rafy

Organizations: Lane Department of Computer Science and Electrical Engineering, West Virginia University, Morgantown, WV, USA, 26505

Abstract

Large language model (LLM)-assisted energy-management tools can translate natural-language context into structured grid commands, but syntactic validity does not imply physical admissibility. This paper presents TwinGridShield, a model-independent runtime authorization layer that evaluates each proposed action in a deterministic network twin before release. The prototype checks connectivity, branch-flow, generator, and load-shedding invariants and records each decision in a hash-chained log. A controlled IEEE 14-bus study evaluates single-step switching, redispatch, and load-shedding actions using DC power flow and experimentally assigned branch ratings. In the matched-model experiment, a stochastic proposal source configured to select an unsafe action with probability p=0.84 produced 421 unsafe proposals in 500 attacked-condition trials, a realized rate of 84.2%. This value characterizes the configured surrogate and is not an empirical measurement of LLM prompt-injection susceptibility. TwinGridShield produced 0 unsafe releases in those 500 trials. Because action labeling and authorization used the same DC model, system state, branch ratings, and encoded constraints, this result verifies conformance of the implementation to its encoded authorization predicate rather than safety under model error. The principal robustness evaluation therefore introduces model mismatch. Unsafe acceptance reached 5.63% under bounded +20% and -20% per-bus load-measurement error and 30.09% when actual branch ratings were 20% below modeled ratings.

Figures & tables

Explore similar work

CardsList
  1. LLMs and Agentic AI Systems for Smart Grids: A Tutorial on Architectures and Applications

    Jul 20, 2026Daniela Rojas, Abdulwahab Albassam, Aidan G. Leung +11LLM Agent OrchestrationLLM Agent Evaluation

  2. Evaluating Jailbreaking Vulnerabilities in LLMs Deployed as Assistants for Smart Grid Operations: A Benchmark Against NERC Standards

    Apr 25, 2026Taha Hammadia, Lucas Rea, Ahmad Mohammad Saber +2LLM Jailbreak AttacksLLM Safety Evaluation