# PIA: Agentic Physics-Informed Runtime Anomaly Detection

A language model agent writes physics-based detectors that catch stealthy water-plant attacks

Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis Karimipour · arXiv · 2026-11-7

- **Problem** Learned anomaly detectors miss stealthy attacks that keep every signal inside its normal range, and hand-built physics detectors need expert effort for each plant. Those detectors also give no link from an alarm to the equipment behind it.
- **Method** PIA has a language model agent write physical residuals, such as pump characteristics and tank mass balances, instead of a learned black box. Each candidate is tested against normal operating data before deployment.
- **Results** On the BATADAL 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 baselines.

![Figure 1: Overview of PIA](https://refivu.com/papers/9759ea5e-4edd-4749-bb03-45759285d767/figures/figure-7e5b91926f779d0738bdd10457dfd59d.png?thumb=512)

**Figure 1** : Overview of PIA.

[Original paper](https://arxiv.org/abs/2611.11009v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis Karimipour · PIA: Agentic Physics-Informed Runtime Anomaly Detection · Original paper figure · Extracted the figure area from page 3 of the original PDF.

## Why learned detectors miss concealed attacks

Autoencoders and recurrent forecasters are the examples the authors give of such learned detectors. The detector has no link between a flagged signal and the equipment it belongs to, so the operator gets no location.

Physics-based residual detectors avoid both issues by checking relations that must hold in any normal operation. The cost is that an engineer must derive, parameterize, and tune every residual for the specific plant. PIA moves this engineering work to a language model agent that already knows hydraulics, machines, and control logic. Each relation the agent proposes is tested against normal operating data before it enters the detector.

The authors say the result has the sensitivity and interpretability of physical residuals, after a few minutes of automated design.

It proposes residuals in a small expression language and checks how each candidate fits. It also measures how often a residual fires on normal data it wasn't fitted on.

## The key idea: the agent proposes, the normal data judges

The key idea is that a language model writes the detector as physical residuals and keeps only those that survive tests on normal data. A model with broad knowledge of hydraulics, pumps, and control logic can propose relations that a generic learner would never consider. The normal data supplies the check the model lacks, since a relation it proposed is rejected when it doesn't hold in the normal segment.

The design goal is to maximize sensitivity under a bound on the false alarm rate, with every fit done on normal data only. \\\[ \\phi^\\star = \\arg\\max\_{\\phi\\in\\Phi}\\ \\mathrm{Sens}(\\phi,\\theta\_\\phi)\\ \\ \\text{s.t.}\\ \\ \\mathrm{FAR}(\\phi,\\theta\_\\phi)\\le\\alpha \\\]

Each raw residual is the target expression g\_k minus a fitted linear combination of the input expressions h\_k and a constant. \\\[ r\_{k,t} = g\_k(x\_{\\le t}) - \\theta\_k^{\\top}\\,\[\\,h\_k(x\_{\\le t});\\,1\\,\] \\\] The coefficients θ\_k are fitted by least squares on normal data, so the regression absorbs constants the agent can't know, such as tank cross sections or pump gains.

The agent supplies the structure of the relation, which signals it couples and in what form, and the fit supplies the numbers.

Because every residual shares this scale, a value of 1 marks the edge of normal behaviour. The detector score is the maximum over the residuals, and an alarm fires when that score exceeds a threshold τ set as an upper quantile of the score on normal data. \\\[ s\_t = \\max\_k u\_{k,t}, \\qquad a\_t = \\mathbb{1}\[s\_t \> \\tau\] \\\]

## How the design session checks each candidate

The agent's system prompt covers the residual form and the expression language, plus the expectation that residuals stay almost flat during normal running. Next, the agent reads the plant description, which gives signal meanings and units, pump and tank topology, tank dimensions, and controller switching rules. The agent doesn't see anomalous data at any point during design.

A signal summary comes first, and a correlation tool follows, letting the agent test any expression against all signals. The third tool fits a candidate residual on one part of the normal data and evaluates it on another. It also applies a synthetic manipulation, offsetting each involved signal by half a standard deviation or inverting a binary actuator.

The tool returns the fraction of that manipulation the residual detects.

The session ends once the agent submits between 4 and 24 residuals. Each session was capped at 40 turns in the experiments. The workbench supplies falsification, rejecting relations that hold in textbooks but not in the data.

A least squares step on normal data supplies the coefficients, which absorb unknown constants such as tank cross-sections. Residuals whose noise would raise the common threshold are exposed by the workbench and dropped from the set.

## Test-period scores against six baselines

The authors compare PIA with six baselines: PCA monitoring, isolation forest, a dense autoencoder, an LSTM forecaster, an LSTM autoencoder, and USAD. All methods are trained on the normal dataset only and share the score smoothing and the threshold rule. On the test attacks, PIA with Claude Opus 5.5 (Opus) raised F1 from 0.504 for PCA, the strongest baseline, to 0.878.

Average precision rose from 0.713 to 0.899 over the same comparison. Table 1 reports the means and standard deviations over five runs.

![Table 1: BATADAL results, mean and standard deviation over five runs](https://refivu.com/papers/9759ea5e-4edd-4749-bb03-45759285d767/figures/figure-202199ccd14a6992cfa17872f86dd91c.png?thumb=512)

**Table 1** : BATADAL results, mean and standard deviation over five runs.

[Original paper](https://arxiv.org/abs/2611.11009v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Most of the gain comes from recall, which rose from 0.349 for PCA to 0.874 for Opus on the test attacks. The authors read this as baselines catching the onset of an attack and then losing it once concealment takes effect, while the residuals keep firing for the full duration.

Across five independent Opus sessions, all seven test attacks were detected in four sessions and six in the fifth. Each PIA model and configuration ran five sessions capped at 40 turns, while the stochastic baselines were averaged over five seeds.

## Which concealed attacks the residual sets catch

The Opus residual sets share a common layout across sessions. Every session wrote pump characteristics that link each pump's flow to its status and to its suction-to-discharge pressure rise. A reserve-pump check states that idle pumps carry neither flow nor status.

Figures 2 and 3 show how these relations turn into detections. Figure 3 lists the fraction of each test attack under alarm for every method.

![Figure 2: Normalized scores on the BATADAL test period; shaded spans are attacks](https://refivu.com/papers/9759ea5e-4edd-4749-bb03-45759285d767/figures/figure-0a2487095aea25dc360160cd75e446cc.png?thumb=512)

**Figure 2** : Normalized scores on the BATADAL test period; shaded spans are attacks.

[Original paper](https://arxiv.org/abs/2611.11009v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

In attack 13, the alarm comes from the relation between the suction heads of two neighbouring stations.

A physical residual isolates a relation with small normal variation, so the same manipulation stands out against it. Because the agent covers each component with several overlapping relations, an attacker would need forgeries that reach well beyond the attacked component.

## What the workbench and the plant description add

PIA's ablations split the agent's inputs into two sources, the plant description and the workbench. In the blind configuration, the plant description shrinks to one sentence and every signal gets an anonymous identifier. The no-tools configuration keeps the full plant description, yet the agent writes its residuals without ever looking at the signals.

The same removal also lowers F1 on Dataset 2, so the loss isn't confined to the test attacks. The abstract calls testing hypotheses against data decisive, and this drop is the strongest support for that claim in the ablations.

Blind agents reach 0.858 and 0.842 F1 on the test attacks. The paper doesn't assign these two values to Opus or Sonnet, so the pairing stays open. The agent then matches pumps to junctions through correlations and writes head and tank residuals for the anonymous signals. The authors read this as the search over relational structure being the decisive contribution, not a closed-form model of the plant.

For Opus, the plant description raises localization accuracy on the test attacks from 0.714 to 1.0. Named components let the agent tie each residual to the equipment it monitors, so the description adds a semantic layer on top of the search. The Dataset 2 effect of removing the workbench is stated only as a direction, without a number.

## Design cost and deployed detector speed

The authors treat design as a cost paid once per plant, and the session numbers show what that cost looks like. Each design session ends when the agent submits between 4 and 24 residuals. Each session is limited to 40 turns, and five independent sessions run per model and configuration.

The deployed detector holds about twenty fitted expressions. Fitting it takes 0.13 seconds. Scoring the three-month test period takes 33 milliseconds on a CPU. That scoring needs neither a GPU nor any call to the model.

Because the language model takes part only in design, it doesn't run when alarms are raised. The outputs stay fixed and auditable at run time, so each alarm points to the residual that carries it. The paper's summary of contributions states that the detector runs in milliseconds.

These timings describe the deployed detector, not the design sessions that produced the F1 results.

## Why residuals see what reconstruction misses

Learned detectors summarize normal behaviour by its dominant modes of variation. Its reconstruction or forecast error therefore stays small, so the learner gets little signal to act on.

A physical residual works differently, because it isolates one relation whose normal variation is small.

To stay hidden, the attacker must forge every reading that takes part in a violated relation. Because the agent covers each component with several overlapping relations, a consistent forgery must reach well beyond the attacked component.

## Limitations

The evidence rests on one benchmark, BATADAL, and two design models, Opus and Sonnet, both from Claude 5.5. Each of the two evaluation datasets holds seven attacks, so the attack-level results rest on small counts. Dataset 2 and the test dataset are used only for evaluation, so no attack shapes the design. Stochastic baselines use five seeds, and PIA runs five independent sessions per model and configuration.

The component attribution is reported only for attacks that each session detected. Every detector, PIA included, flags it only around a single transient.

The authors didn't evaluate updating the residual set after changes to the plant configuration, operating conditions, or sensor reliability. They say such revision would need newly proposed relations validated against normal operating data, and that check isn't in the paper. The authors list design sessions that consult engineering documentation or network models as a next step.

## Paper info

- **Authors**: Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis Karimipour
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-7
- **Added**: 2026-11-10
- **Updated**: 2026-11-7
- **Version**: v1
- **arXiv**: 2611.11009
- **Category**: cs.LG · cs.AI
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.11009v1) · [PDF ↗](https://arxiv.org/pdf/2611.11009v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## 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.

## Quote from the paper

Ali Mohammadi Ruzbahani, Abbas Yazdinejad, Hadis Karimipour (2026). PIA: Agentic Physics-Informed Runtime Anomaly Detection. arXiv:2611.11009v1. https://arxiv.org/abs/2611.11009v1

**BibTeX**

```
@misc{ruzbahani2026agentic,
  title = {{PIA: Agentic Physics-Informed Runtime Anomaly Detection}},
  author = {Ali Mohammadi Ruzbahani and Abbas Yazdinejad and Hadis Karimipour},
  year = {2026},
  eprint = {2611.11009},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.11009v1}
}
```

## Other paper commentary

- [Advancements in Cloud-Native Systems: A Systematic Mapping Study of Reliability and Scalability across Cloud-Native, Edge-Native and AI-Enabled Systems](https://refivu.com/en/papers/dcc9a55c-1402-4ca3-b4fb-5c370442536e-advancements-in-cloud-native-systems-a-systematic-mapping.md)
- [Think or Remember: The Exchange Rate of Agentic Inference](https://refivu.com/en/papers/430e6cf8-4d25-4ea8-8672-86be1d22daf9-think-or-remember-the-exchange-rate-of-agentic.md)
- [How to "train" a surgeon? Benchmarking generalist agents in surgical scene understanding](https://refivu.com/en/papers/c14fcb0f-7658-4cdb-aab2-a512b0b5e61c-how-to-train-a-surgeon-benchmarking-generalist-agents.md)
- [Firepool: Brokering Warm GPU Capacity for Agentic and RL Workloads at LinkedIn](https://refivu.com/en/papers/0e017dee-ff2c-4a1f-9e6d-de71d910b214-firepool-brokering-warm-gpu-capacity-for-agentic-and.md)
- [Reflexion: Language Agents with Verbal Reinforcement Learning](https://refivu.com/en/papers/a572f458-b121-4d38-bfc9-7a77309a3aba-reflexion-language-agents-with-verbal-reinforcement-learning.md)
- [A Generalist Agent](https://refivu.com/en/papers/890475cb-e797-43df-8de3-0d0eb9ed882e-a-generalist-agent.md)
- [LongCap: Hour-Scale Timestamped Audio Captioning via Chunk-wise Processing](https://refivu.com/en/papers/3d29785b-d68d-4ba4-8ec6-d0cb9c1d3076-longcap-hour-scale-timestamped-audio-captioning-via-chunk.md)
- [Uncertainty-Guided Reward Labeling for Reinforcement Learning under Limited Feedback](https://refivu.com/en/papers/16259af5-2139-4a6b-a517-f5d12bc434bf-uncertainty-guided-reward-labeling-for-reinforcement.md)
- [When Safety Becomes An Outlier: Understanding the Retention of LLM Safety Behaviors](https://refivu.com/en/papers/c80b7b08-3909-41c2-8f34-04547cb431aa-when-safety-becomes-an-outlier-understanding-the-retention.md)
- [Improving Analytic Constants via Interpretable AI-Guided Lean Proof Refinement](https://refivu.com/en/papers/a19c3267-630e-4a04-bea7-d13ab044849e-improving-analytic-constants-via-interpretable-ai-guided.md)
- [Lightfoot: Graph Retrieval-Augmented Generation with Exact, Model-Free Document Deletion](https://refivu.com/en/papers/ca2f413f-5381-4976-85c5-107ed66a4512-lightfoot-graph-retrieval-augmented-generation-with-exact.md)
- [HARP-Bench: Benchmarking Robot Manipulation Around Active Humans](https://refivu.com/en/papers/6f4f13ac-5bd1-40a1-8bee-4fe82071c389-harp-bench-benchmarking-robot-manipulation-around-active.md)

## Terms in this paper

- [LSTM](https://refivu.com/en/terms/ba10547646d9-lstm)
- [Claude Opus 5.5](https://refivu.com/en/terms/5a529ff69f21-claude-opus-5-5)
- [AE](https://refivu.com/en/terms/8c4a1b962673-ae)
- [localization accuracy](https://refivu.com/en/terms/c41f283671f3-localization-accuracy)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/9759ea5e-4edd-4749-bb03-45759285d767-pia-agentic-physics-informed-runtime-anomaly-detection)
