AbstractRiboflavin is a common marker of microbial corrosion and can act as an electron shuttle in the solvated state to enhance electron transfer efficiency. In this paper, an in‐situ label‐free fiber‐optic biosensor modified by Ti3C2‐MXene@Square Gold nanoparticles (SGNps) composites and riboflavin kinase is developed, which behaved with high sensitivity for measuring riboflavin. The sensing interface of the sensor is constructed by stepwise assembly of SGNps and riboflavin kinase using Ti3C2‐MXene nanosheets as the supporting substrate. Riboflavin kinase catalyzed the phosphorylation of riboflavin to form flavin mononucleotides in the presence of adenine nucleoside triphosphate and Mg2+. Experimental results showed that the sensitivity of riboflavin measurement is 5.61 nm µm−1 and the limit of detection (LOD) is 115 nmol L−1 (nm) in the concentration range of 0–2.656 µm. In situ label‐free monitoring of riboflavin in Shewanella, the sensitivity of the sensor in bacterial fragmentation fluid is 53.90 nm/OD within the optical density (OD) of 0–0.175, and the LOD is OD = 0.017. The above results verified the feasibility of the sensor for in situ monitoring of riboflavin in microbial corrosive environments, with ultra‐low detection limit and good selectivity, which undoubtedly provided great research value for the application of optical fiber sensors in microbial corrosion monitoring.