The transcription factor bHLH25 acts as a H2O2 sensor in rice. Oxidized bHLH25 boosts lignin production to strengthen cell walls against pathogens, while non-oxidized bHLH25 activates phytoalexins to inhibit pathogen growth. This dual role balances defense and growth, offering a potential strategy for engineering disease-resistant crops without yield loss.