Sviluppo Software
Engineering Antifragility: How Resilient Systems Triumph Over AI Failure
Published on 07 December 2025
I was writing these notes a few months ago, in August 2025, during a strategic reflection on predictive systems for energy efficiency. Rereading them today confirms a fundamental truth: the intelligent use of AI is not about trusting it blindly, but about building an architecture that knows what to do when the AI inevitably makes a mistake.
The Fundamental Limit: The Extrapolation Nightmare
An Artificial Intelligence model, however powerful, is essentially a master of the interpolation: it learns to recognize complex patterns within the data it has already seen. Its intrinsic weakness is extrapolation, which is the ability to make predictions about situations completely outside its past experience.
In engineering terms: AI cannot reliably predict events that are not part of its training set domain.
The "Out-of-Sample" Problem: Black Swans and Volcanoes 🦢🌋
Imagine training a predictive photovoltaic system with perfect historical data. The system will become incredibly skilled at predicting common scenarios. But it will be blind to so-called "Black Swans," rare and unpredictable events:
- The Icelandic Volcano 🌋: An eruption darkens the skies over Northern Italy for a week in July. Irradiance data drops to winter values in the middle of summer. For the AI, this is an incomprehensible anomaly.
- The New Electrical Load: The sudden installation of an energy-intensive machine (e.g., a ceramic kiln) completely alters historical consumption patterns.
- Sensor Failure: A sensor starts sending corrupted but plausible telemetry data.
Strategic Note
In these cases, the AI prediction is not just wrong: it is dangerous. An intelligent system is not one that never makes mistakes, but one that knows that it does not know and acts accordingly.
Our Strategy: Engineering Resilience
To mitigate these risks, in our systems (such as the BROFER VMC Simulator or the Home Brain architectures) we implement three levels of safety:
1. Quantifying Uncertainty
A well-designed AI model should not only provide a number ("you will produce 15 kWh"), but also an estimate of its confidence. If the system detects anomalous conditions, the confidence interval widens (e.g., "between 5 and 25 kWh"). This widening is the signal for the control system: "Caution, I am guessing".
2. The Anomaly Guardian
We insert a "Guardian" module (often based on deterministic logic or simple statistics) that checks the input data before it reaches the AI. If the weather forecast or instantaneous consumption is physically impossible or statistically absurd, they are discarded at the source.
3. Graceful Degradation
This is the final safety net. Control scripts are designed to "degrade gracefully." The logic is simple:
- I ask the AI for a prediction.
- Is the prediction reliable (low uncertainty, valid inputs)?
- YES: I use the proactive strategy optimized by the AI.
- NO: I ignore the AI and apply the baseline rules (fallback), which are reactive and safe.
In this way, the system never crashes (it is not fragile). It simply reverts to simpler, robust, and conservative behavior when faced with the unknown. This is true antifragility applied to software engineering.