PIA: Agentic Physics-Informed Runtime Anomaly Detection

Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis KarimipourarXiv 2026 · arXiv

TL;DR

PIA (Physics-Informed Agents) uses Large Language Model (LLM) agents to automatically synthesize and refine physics-based anomaly detectors for industrial systems. By bridging the gap between manual expert modeling and "black-box" machine learning, PIA achieves a massive jump in detection performance (0.878 F1 vs. 0.504 for the best baseline) while remaining fully interpretable and fast enough to run on a standard CPU in milliseconds.

What Problem Does This Paper Address?

Cyber-physical systems (CPS)—like water treatment plants, power grids, and factories—are critical infrastructure. Detecting attacks on these systems is notoriously difficult. Currently, engineers have two main choices:

  1. Black-box Machine Learning: These models learn "normal" behavior from data. While easy to deploy, they often miss "stealthy" attacks where an attacker keeps signals within normal ranges but violates the underlying physics. They also can't explain why an alarm is firing.
  2. Manual Physics Models: Experts derive equations (residuals) for every pump and tank. These are highly effective and interpretable but require weeks of expensive manual engineering for every single plant.

The authors address this bottleneck by delegating the engineering work to an LLM agent that understands both physics and control logic.

Methods

The researchers introduce PIA, a framework that separates the "design time" from the "run time."

Design Time (Agentic Synthesis): An LLM agent (like Claude 3.5 Opus) is given a natural language description of the plant and access to a "workbench" containing normal operating data. The agent doesn't just guess; it acts as a scientist:

  • Hypothesize: It proposes physical residuals (e.g., "The flow out of Tank A should equal the change in its level").
  • Test & Refine: It uses workbench tools to inspect signals, correlate variables, and test how well its proposed equations fit the real-world data.
  • Submit: Once it has a set of residuals that are "quiet" on normal data but cover all components, it submits the final detector.
Figure 1: Overview of PIA.

Run Time (Deterministic Execution): The final detector is just a set of simple arithmetic expressions. It does not require an LLM to run. This makes it incredibly fast, auditable, and cheap to deploy on edge hardware.

Datasets

The authors evaluated PIA on the BATADAL (Battle of the Attack Detection Algorithms) benchmark. This dataset represents the "C-Town" water distribution network and includes:

  • 43 signals (tank levels, pump flows, pressures, and actuator statuses).
  • A one-year "normal" dataset for training.
  • Two test datasets containing 14 different attacks, many of which use sophisticated concealment techniques like replaying old sensor data.

Key Insights and Ideas

  • LLMs as Zero-Shot Domain Experts: LLMs already possess broad knowledge of hydraulics and control logic. PIA provides the "grounding" necessary to apply that general knowledge to a specific, noisy dataset.
  • Falsification over Correlation: Unlike standard ML that looks for any correlation, the PIA agent looks for physical laws. If a textbook equation doesn't hold up in the data (perhaps due to sensor noise or unmodeled friction), the workbench rejects it, forcing the agent to find a more robust relationship.
  • Stealthy Attack Resistance: Black-box models are easily fooled by "offset" or "replay" attacks. However, because PIA checks the relationship between sensors (e.g., if a pump is ON, the pressure must rise), it is much harder for an attacker to remain hidden without forging every single related sensor reading perfectly.
  • Inherent Interpretability: Because each residual is tied to specific components (like "Pump 1" or "Tank 2"), the system provides "component-level localization." When an alarm fires, the operator knows exactly which piece of equipment is implicated.

Key Results

PIA significantly outperformed six established statistical and deep learning baselines (including LSTMs and Autoencoders).

  • Detection Accuracy: On test attacks, PIA (using Claude Opus) reached an F1 score of 0.878, compared to just 0.504 for the strongest baseline (PCA).
  • Stealthy Attack Coverage: As shown in Figure 3, PIA maintained high detection rates even during attacks that completely fooled the baselines.
  • Localization: For the Opus-based agent, every single detected attack was correctly attributed to the attacked component (100% localization accuracy).
  • Efficiency: The resulting detector is lightweight. It was fitted in 0.13 seconds and scored a three-month test period in just 33 milliseconds on a standard CPU.
Figure 3: Fraction of each test attack under alarm.

Limitations and Future Work

  • Plant Descriptions: PIA relies on a reasonably accurate natural language description of the plant. If the documentation is missing or wrong, the agent's hypotheses may suffer.
  • Benchmark Scope: While successful on water systems, the approach needs testing on other types of CPS, like power grids or chemical processes.
  • Future Directions: The authors suggest future versions could allow the agent to consult engineering manuals directly or automatically update the detector when the plant's physical configuration changes (e.g., adding a new pump).

Summary updated

Abstract

Runtime anomaly detectors for cyber-physical systems are either learned as black boxes from normal data, which miss stealthy manipulations that keep every signal inside its normal range, or derived by hand from physical models, which requires expert effort for every plant. We introduce physicsinformed agents (PIA), in which a large language model agent writes the detector itself as a set of physical residuals, such as pump characteristics, tank mass balances, and controller logic, and refines every candidate against normal operating data through an evaluation workbench before deployment. The result is a compact, human-readable detector that runs in milliseconds and names the component behind each alarm. On the BATADAL water distribution attack benchmark, PIA with Claude Opus 5.5 reaches an F1 of 0.878 on the test attacks against 0.504 for the strongest of six statistical and deep baselines, keeps detecting attacks concealed by replayed and offset sensor readings, and attributes every detected test attack to the attacked component. Ablations show that testing hypotheses against data is decisive: agents that write residuals from the plant description alone lose up to 0.28 F1, whereas agents that see only anonymized signals recover most of the physical structure.
BibTeX
@misc{ruzbahani2026pia,
  author = {Ali Mohammadi Ruzbahani and Abbas Yazdinejad and Hadis Karimipour},
  title = {{PIA: Agentic Physics-Informed Runtime Anomaly Detection}},
  year = {2026},
  eprint = {2611.11009},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.11009},
}
Figure