Plant diseases caused by bacteria have become one of the serious problems that threaten human food security, which led to the remarkable reduction of agricultural yields and economic loss. Nitroreductase (NTR), as an important biomarker, is highly expressed in bacteria, and the level of NTR is closely related to the progression of pathogen infection. Therefore, the design of smallmolecule fluorescent sensors targeting NTR is of great significance for the detection and diagnosis of plant pathogenic bacteria. In this study, a new fluorescent sensor targeting NTR was discovered and then successfully applied to the imaging of zebraf ish and pathogenic bacteria. Most importantly, the developed sensor achieved the real-time diagnosis of Brassica napus L. infected with bacteria, which provides a promising tool for examining the temporal and spatial infection of plant pathogens in precision agriculture.