A team of researchers has taught an AI forecasting model to check its own predictions against formal safety rules before acting on them.
The system, called LogiC-Diff, is a two-stage diffusion model built for cyber-physical systems like power grids and water networks. It takes Signal Temporal Logic specifications, essentially machine-readable safety contracts, and uses them to guide two steps: first repairing suspect sensor inputs, then refining the output forecast so it still obeys those contracts. The researchers tested it on two real-world multivariate datasets against sensor faults, gradient-based attacks, and adaptive attacks of varying strength. Across all of those, the model held up better than reconstruction-only baselines, degraded more gracefully as attacks got stronger, and generalized to attack types it had not seen during training.
Most security for these systems today sits outside the prediction model: a filter checks the inputs, a rule engine flags anomalies, and the forecasting model itself has no idea any of that happened. If an attack slips past the filter, the model has no backup plan. Embedding the safety specification into the model's own inference loop means the system is built to refuse bad outputs on its own terms, not just rely on something upstream catching the problem first.
That said, this is a preprint tested on two datasets under simulated attacks, not a system running an actual grid. Whether the extra inference cost and the overhead of writing good temporal-logic specs for a real plant pencil out is still an open question.