Severe space weather could be forecast with greater accuracy and reliability than ever before, according to a new study, which presents a physics-based method for predicting imminent large solar flares. Solar flares - massive explosions of electromagnetic radiation, plasma and charged particles in the Sun's outer atmosphere - are triggered by the sudden release of energy stored in the twisted magnetic fields that occur around visible sunspots. The X-ray light emitted by a flare, and the ejection of material from the Sun that often accompanies them, can produce powerful space weather effects on Earth. These can pose hazards to astronauts, spacecraft, and technological systems on the ground, such as electric power grids and radio communications. As global society becomes more dependent on these technologies, there is increasing need for reliable methods to predict imminent solar events and improve warning times when they occur. Despite decades of study and near-continuous monitoring of the Sun's magnetic activity, the specific conditions and mechanisms that produce flares remain unknown, making them particularly difficult to forecast. Kanya Kusano and colleagues present the "κ-scheme" (kappa-scheme), a predictive model that can forecast large solar flares more reliably than previous methods. Using a physics-based scheme to derive critical thresholds of a magnetohydrodynamic instability, Kusano et al.'s approach predicts when a large solar flare is imminent using routine magnetic observations of the Sun. It also identifies where the flare will occur, and how much energy could be released. To test their model, the authors analyzed data from NASA's Solar Dynamics Observatory from 2008 to 2019, finding that the κ-scheme was able to identify the occurrence, location and size of most large flares, up to 20 hours in advance. In a related Perspective, Astrid Veronig discusses how the method improves our understanding of how and why solar flares occur.