## Introduction

Microbiologically influenced corrosion (MIC) refers to the degradation of metals that is usually promoted by the activities of microorganisms and their biofilms1. It is estimated that microorganisms account for 20% of all corrosion damages2. Despite the widespread MIC damages found in energy, construction and transportation industries and in virtually all types of natural environments, deeper investigations are still needed to elucidate complicated MIC mechanisms in detail3. Studies on typical bacterial species held responsible for such corrosion have proposed several principal MIC mechanisms, including the early cathodic depolarization theory for sulfate-reducing bacteria (SRB)4, the secretion of corrosive metabolites by sulfur-oxidizing bacteria and other acid-producing bacteria5,6, and the formation of differential aeration cells from inhomogeneous coverage/aeration of biofilms7. Furthermore, extracellular electron transfer (EET) between bacteria and a metal surface (acting as an electrode) has been studied as a fundamental mechanism of metal corrosion caused by bacteria especially within the last ten years1,8,9,10,11.

EET commonly manifests itself as a cascade of bioelectrochemical processes by which electrons are transferred in or out of the cell envelope between extracellular substrates and bacteria, and it is prevalent in both Gram-positive and Gram-negative bacteria12,13. EET mechanisms can be divided into two main types: direct electron transfer (DET) enabled by cell membrane-bound redox compounds (e.g., outer-membrane cytochromes) with and without conductive pili, and mediated electron transfer (MET) based on redox electron shuttles that relay electrons to external acceptors14. Electron shuttles can be endogenous (such as phenazines, flavins and quinones) or exogenous (such as humic acids, anthraquinone-2,6-disulfonate and neutral red), and EET is achieved over multiple redox cycles of electron shuttles15. Electron shuttles can reach to extracellular electrodes by passive diffusion and electron hopping where shuttles are bound in an extracellular matrix to transfer electrons via sequential redox reactions16. MET enhances the EET efficiency of a population of microbes, as MET allows microbes to conduct extracellular respiration without direct contact with extracellular electrodes15. The pathways of EET can be outward, that is, a flow of electron towards an electrode (from a “microbial bioanode”), or inward, that is, harvesting electrons from an electrode (to a “microbial biocathode”)14. Whereas outward EET has been extensively studied utilizing several model electrogenic strains, such as Geobacter spp. and Shewanella spp., reports on inward EET are much fewer14. Inward EET has been found useful in microbial electrosynthesis17 and bioremediation of heavy metals18. Bidirectional electron transfer can also appear in the same microorganism species. Recent studies on microbial fuel cells (MFCs) have identified bidirectional EET in S. oneidensis MR-1, which was able to oxidize or reduce extracellular electrodes if different redox potentials were applied to inert carbon-based electrodes19.

Recently, evidence has shown that inward EET can cause MIC on metallic ferrous materials20. For example, Venzlaff et al. suggested that SRB could corrode pure iron by direct electron uptake in addition to the biochemical corrosion by the microbial metabolite H2S. The authors speculated that the flow of electrons from the metal to SRB was mediated by the deposited semiconductor FeS, which acts as an electron transfer bridge11. Xu et al. found that pre-grown Desulfovibrio vulgaris biofilms became more corrosive under subsequent carbon source starvation because elemental iron can be used as an alternative electron source21. Starved nitrate-reducing Pseudomonas aeruginosa was observed to have the same behavior9,22. Philips et al. discovered that Shewanella strain 4t3-1-2LB was able to enhance iron corrosion by employing metallic iron as the electron source mainly by monitoring the variations of the concentration of organic and inorganic molecules involved in the microbial metabolism23. Such inward EET was also proposed to contribute to the MIC caused by acetogenic bacteria and even archaea24,25. However, to confirm the EET mechanism in MIC, these studies have relied on weight loss and electrochemical corrosion measurements on the metals, which cannot provide direct and in situ evidence on whether or how EET occurred between the bacteria and the metals during the MIC processes26.

Compared with the abundant evidence of inward EET studies in MIC, the association between outward EET and MIC is less clearly established in the existing studies. There are only several reports which mainly focused on the study of steel corrosion by iron-reducing bacteria (IRB). The review paper of Lee and Newman summarized the relationship between microbial iron respiration and corrosion under aerobic environments and revealed that previous conflicting reports that iron reducing bacteria could either inhibit or promote metal corrosion could be reconciled based on specific oxygen supply conditions27. For example, biofilm growing in relatively static environment which is inconvenient for oxygen supplement tends to inhibit corrosion while corrosion promotion is more likely to occur when fluid flow could deliver oxygen to the metal surface and remove Fe(II). Obuekwe et al. found that anodic depolarization occurred on mild steel in the Pseudomonas spp. inoculated medium28. According to this study, the addition of sodium lactate could sustain the anodic depolarization induced by the bacterial reduction of Fe(III) to Fe(II) corrosion products which were less protective than Fe(III)-containing rust layers. Recently, Chen et al. reported that iron respiration by Thalassospira sp. could result in local damage of the protective corrosion products and promoted corrosion of Q235 carbon steel in air-saturated seawater29. While these studies attributed the biocorrosion to the iron-reducing properties of IRB, the role of EET in the MIC process was not identified.

In the present work, we aimed to elucidate the EET processes in MIC by using an electroactive bacterium S. oneidensis MR-1. According to previous studies, S. oneidensis MR-1 predominantly conducts EET by secreting flavin-type electron shuttles, especially riboflavin30. Riboflavin can switch between an oxidized and a reduced state in a reversible redox reaction, and the redox state has important implications for its electron transfer activities31. Reduced riboflavin can donate electrons to reduce insoluble Fe(III) to Fe(II)32, whereas oxidized riboflavin can serve as an electron acceptor in EET33. Therefore, tracking the redox state of riboflavin is essential to understand the MET processes induced by S. oneidensis MR-1. Herein, the role of MET involving the riboflavin electron shuttle was investigated in the MIC caused by wild-type S. oneidensis MR-1 on 304 stainless steel, a widely applied stainless steel. Genetically-manipulated strain (ΔomcA) weakened in its EET ability by knocking out outer membrane c-type cytochrome (c-Cyt) OmcA was studied as a comparison34. Pit topography and statistics were analyzed on the stainless steels immersed in the bacterial culture supplemented with different amounts of riboflavin. The surface composition and the property of passive film were investigated by XPS and Mott-Schottky measurements, respectively. Electrochemical impedance spectroscopy (EIS) measurements were performed on the stainless steels in the bacterial culture containing different concentrations of lactate (as electron donor), fumarate (as electron acceptor) and riboflavin to study the relationship between EET and MIC. Scanning electrochemical microscopy (SECM) was employed to provide in situ mapping of riboflavin in different redox states during the MIC of stainless steels by wild-type S. oneidensis MR-1 and ΔomcA. Based on the SECM results, we have demonstrated that bidirectional MET is involved in the MIC of stainless steels and the direction of electron transfer adapts to the passive or active states of the steel surface.

## Results

### Corrosion morphology

Corrosion tests were conducted by immersing 304 stainless steel in the sterile medium and the media containing S. oneidensis MR-1 and supplemented with 0, 5 or 10 ppm (w/w) riboflavin. The amount of riboflavin added to the medium did not alter the bacterial growth or the pH of the culture medium which could influence the corrosion of the steels (Supplementary Fig. 1a–c). The concentration of lactate and succinate monitored during the incubation period also proved that the consumption of lactate and the production of succinate of S. oneidensis MR-1 was not inhibited or promoted with the addition of riboflavin (Supplementary Fig. 1d, e). After 14 days, the corrosion pits on the steel surface were profiled by confocal laser scanning microscopy (CLSM) after removing the biofilms and deposits (Supplementary Fig. 2). No obvious pit was found on the samples immersed in the sterile medium with or without riboflavin, which indicated that neither the medium nor the added riboflavin degraded the 304 stainless steel. In comparison, the maximum pit depths were 3.6, 4.8, and 6.4 μm for the specimens immersed in the bacterial culture containing no added riboflavin, and those containing 5 and 10 ppm riboflavin, respectively. Figure 1a summarizes the densities and average depths of the pits. Clearly, with a higher concentration of riboflavin in the inoculated culture medium, both pit density and average pit depth increased. The aggravated pitting by the bacteria with added riboflavin was also supported by the ionic leaching results from inductively coupled plasma mass spectrometry (ICP–MS) (Fig. 1b), which showed that in the presence of the bacteria, the medium containing a higher concentration of riboflavin caused a significantly higher metal (predominantly Fe) loss. The results in Supplementary Fig. 3 show that the corrosion capacity of ΔomcA was obviously lower than that of S. oneidensis MR-1 and was less sensitive to the addition of riboflavin.

### Surface composition, Mott–Schottky and EIS analyses

Besides pitting morphology and statistics, the deterioration of the passive film on the stainless steel was also assessed by XPS after immersion in the sterile medium and the bacteria inoculated media with the addition of 0, 5, or 10 ppm riboflavin. Supplementary Fig. 4a–h presents the results from which the change in the composition of the steel surfaces after 14 days of immersion was estimated. In Supplementary Fig. 4a–d, the Fe 2p3/2 spectra obtained with different concentrations of riboflavin could be fitted to reveal three main components, including metallic Fe, Fe(III) oxide and Fe(III) hydroxide35,36. This result indicated that the MIC by S. oneidensis MR-1 did not change the overall surface composition of the steel but only altered the relative abundances. Supplementary Fig. 4e–h presents the core-level Cr 2p3/2 spectra obtained from the steel after 14 days of immersion. Each spectrum can be fitted with three components, namely metallic Cr, Cr(III) oxide and Cr(III) hydroxide35,36. The intensity of each peak was used to estimate the relative amount of each component on the surface. It is well known that surface oxide film is responsible for the maintenance of passivity on austenitic stainless steel and has a bilayer structure with an outer Fe-rich, and an inner Cr-rich oxide37. From the XPS analysis, the increased relative amounts of metallic Fe and Cr and the decreased abundance of Cr(III) and Fe(III) components (Fig. 1c) both suggested the thinning of the passive film and decreased passivity with increasing riboflavin availability for S. oneidensis MR-138.

To further evaluate the damage caused to the passive film by the bacteria, the semiconducting properties of the passive film were probed by Mott–Schottky analysis after the steel samples were immersed in the sterile medium and the S. oneidensis MR-1-containing media with different riboflavin concentrations for 14 days. Depending on the applied potentials (−0.25 to 0.55 V vs. SCE), two linear regions were apparent in all four curves with positive and negative slopes that reflected different capacitance behaviors (Fig. 1d). The region with a positive slope corresponds to the n-type semiconductor (iron oxides in the outer layer) of the passive film, whereas the potential region with a negative slope reflects the p-type semiconductor (chromium oxides in the inner layer)39. The acceptor (NA) and donor (ND) densities were estimated from the slopes of the fitted straight lines and are summarized in Supplementary Table 1. In media containing S. oneidensis MR-1, the slopes of both linear regions in the Mott–Schottky curve decreased with increasing riboflavin concentration, suggesting that the passive film became more defective40.

The results from the XPS and Mott-Schottky analyses further confirmed that riboflavin was able to promote steel corrosion in the presence of S. oneidensis MR-1. S. oneidensis has been previously noted for its potential uses in clean energy production and water purification due to its ability to metabolize insoluble metal oxides (e.g., Fe(III) oxide) and toxic metals12. In this study, the decreased amounts of Fe(III) components on the steel surface (Fig. 1c) implied that the iron oxides in the passive film were attacked by S. oneidensis MR-1, as promoted by the riboflavin. The less notable change in the amount of dissolved Cr (Fig. 1b) could be attributed to the ability of S. oneidensis MR-1 to reduce soluble Cr(VI) to insoluble Cr(III)41. Based on the fact that Cr(VI) did not exist in the passive film and that metallic Cr could directly react with water to form Cr(III) oxide and Cr(III) hydroxide at the oxide–solution interface38, it could be speculated that elemental Cr might not directly participate in the EET process between the steel and the bacteria. Only iron oxides in the passive film were involved in the redox reactions of the EET process by S. oneidensis MR-1. However, the nature of the EET, that is, whether it was bioanodic or biocathodic, remains unknown. Using a split chamber setup, the previous study by Miller et al. revealed that S. oneidensis MR-1 could use carbon steel electrode as an electron donor under anoxic nitrate-reducing environments, thereby accelerating corrosion via a biocathodic process42. They further showed that microbial lactate oxidation by aerobic S. oneidensis MR-1 biofilm could promote corrosion of electrically connected abiotic carbon steel surface43, implying that S. oneidensis MR-1 may act as a bioanode to impact on steel corrosion.

To further elucidate the role of EET in the MIC, the corrosion behaviors of the stainless steel were studied by EIS measurements under varied concentrations of lactate (electron donor), fumarate (electron acceptor) and riboflavin, as summarized in Supplementary Table 2. The experimental group with 100% depletion of lactate was not included since the growth of bacteria was greatly inhibited without enough organic carbon sources, which was in agreement with findings of previous studies9,22,44. The cell growth rates and pH variation were presented in Supplementary Fig. 5, and the corresponding EIS results in Supplementary Fig. 6. The impedance modulus at 0.01 Hz (|Z|0.01Hz) of the EIS diagram is often used as a semi-quantitative indicator for the corrosion status. A higher |Z|0.01Hz value generally reflects a lower corrosion rate. The results suggest that the degree of involvement of Fe in the metabolism of S. oneidensis MR-1 depends on whether cells need EET process to support their metabolism. Supplementary Fig. 6a, b showed that when soluble electron acceptor and electron donor are deficient in the media S. oneidensis MR-1 biofilm become more corrosive due to the enhanced bioanodic and biocathodic process, respectively, even though the number of planktonic and sessile cells of the group deficient in electron donor or acceptor are not the highest. Supplementary Fig. 6c, d reveal that the simultaneous reduction in electron donor and acceptor leads to the highest corrosion rate. Furthermore, the addition of riboflavin accelerated the utilization efficiency of iron by S. oneidensis MR-1 without leading to the significant variation of the number of planktonic and sessile cells, and pH values. The coupons in the medium with complete removal of fumarate (Supplementary Fig. 6e) presented the lowest corrosion rate. Under this condition, fermentation instead of anaerobic respiration is the dominant process for bacteria to gain energy, which could be reflected from the slightly lower pH caused by the production of organic acids compared with the other conditions10,20. However, the slightly changed pH could not create a highly acidic environment to promote corrosion. Besides, it was reported that the addition of fumarate is favorable for the enhancement of anodic current generation of S. oneidensis MR-1 biofilm45. Therefore, the absence of fumarate may inhibit the electron transfer efficiency and lead to a decreased corrosion rate.

### In situ SECM

The results above demonstrated that EET is involved in the corrosion of stainless steel by S. oneidensis MR-1 via both bioanodic and biocathodic processes. Further clarification of the redox states of the electron mediator riboflavin is helpful to understand how these two processes interact with the steel during MIC. As an in situ electrochemical method, SECM has a unique capability of measuring the local concentration of redox-active small molecules46,47. In this study, riboflavin was expected to interact with the steel surface in the EET-MIC process and alter its redox states, causing the local variation of the concentration of oxidized or reduced riboflavin. Thus, SECM was performed by applying riboflavin -reducing (−0.6 V vs. Ag/AgCl) or riboflavin -oxidizing (−0.2 V vs. Ag/AgCl) potentials30 to the ultramicroelectrode (UME) scanning just above the bacterium-inoculated steel surface in the supernatant. S. oneidensis MR-1 biofilm was grown on two different substrates—a 304 stainless steel with a native oxide passive film and a 304 stainless steel that had been thoroughly abraded to remove the passive film to expose an active surface (Supplementary Fig. 7). The coverage and thickness of the biofilm on each steel surface are shown in Supplementary Figs. 8 and 9 and discussed in Supplementary Note 1. Figure 2a, b shows the SECM current mapped above the wild-type S. oneidensis MR-1 biofilm on the stainless steel with an intact passive film. Based on a substrate generation/tip collection (SG/TC) operation mode, the UME was biased to −0.2 V (oxidizing the riboflavin) or −0.6 V (reducing the riboflavin) to image the distribution of the reduced or oxidized riboflavin over the inoculated steel surface, respectively. As such, the interaction between the riboflavin and the steel could be monitored in real time. At −0.2 V (Fig. 2a), a highly spatially heterogeneous current distribution was observed with numerous active regions where the current values were much lower. A lower current indicates a decreased amount of the reduced riboflavin, which was consumed by its interaction with the oxide passive film and converted into its oxidized form. Thus, locally high current regions could be detected when the UME was polarized at −0.6 V to measure the oxidized riboflavin level (Fig. 2b). To confirm that the current fluctuations were attributed to bacterial redox activities rather than the biofilm morphology, repeated scans in the same region were conducted after the bacterial cells were killed using 2.5% v/v glutaraldehyde. A homogeneous current distribution was evident after scanning at either −0.2 V or −0.6 V within a same or even smaller current range compared with those of live bacteria (Fig. 2c, d), indicating that the local redox activities shown in Fig. 2a, b were indeed biotic.

As demonstrated in Fig. 1 and Supplementary Fig. 2, passivity breakdown induced by the bacteria might reveal an active metallic substrate that served as an electron donor through anodic dissolution. Therefore, SECM measurements were also taken on an inoculated stainless steel surface that was thoroughly abraded to remove the native passive film prior to bacterial inoculation. The results (Fig. 2e, f) demonstrate the reverse trend of that seen in Fig. 2a, b. The current map obtained at −0.2 V shows localized regions with increased current values (Fig. 2e), which indicates that the concentration of the reduced riboflavin was increased as electrons were donated from the actively corroding steel surface. As a result, the concentration of the oxidized riboflavin was locally decreased, as evidenced by the regions showing much lower current values when measured at -0.6 V (Fig. 2f). Similar to Fig. 2c, d, the current heterogeneities disappeared after the bacterial cells were killed (Fig. 2g, h). The schematic of the current variation is shown in Fig. 2i.

Genetically engineered electroactive bacteria have been widely used to enhance production of electron shuttles and value-added biofuels by biosynthesis and power generations by MFCs, or to study electron transfer pathways and the functions of specific outer membrane c-Cyts48,49,50. To further verify that the heterogeneous current distribution on the SECM maps originated from the riboflavin -mediated EET processes, we knocked out the redox-active protein OmcA from the cell membrane and thus weakened the EET ability of S. oneidensis MR-1. Figure 3a shows that unlike the wild-type bacteria, the ΔomcA was unable to reduce the oxidized riboflavin added in the culture medium (Supplementary Note 2). Figure 3b–e presents the SECM maps of the reduced and oxidized riboflavin on passive and abraded steel surfaces inoculated with the live ΔomcA strain after 18 h of inoculation. Under any set of conditions, the current values remained homogeneous over the entire mapped area within the same current range with those of dead S. oneidensis MR-1, indicating that the concentration of oxidized/reduced riboflavin was unvaried. These results further verified that the current increase/decrease (Fig. 2a, b, e, f) was directly attributed to the bidirectional MET process by wild-type S. oneidensis MR-1.

## Discussion

The past decade has seen extensive efforts in elucidating the fundamental molecular mechanisms of electron transfer pathways in bacteria, with S. oneidensis as a highly interesting model14. In outward EET processes, electrons are transferred from the interior of cells to the outer membrane and then to extracellular anodes through a metal-reducing conduit (Mtr pathway), where electrons (from NADH, the intracellular electron carrier) flow through the menaquinol pool, CymA (an inner membrane tetraheme c-Cyt), MtrA (a periplasmic decaheme c-Cyt), MtrB (a β-barrel trans-outer membrane protein) and finally to MtrC and OmcA (outer membrane decaheme c-Cyts); this is known as the OmcA–MtrCAB conductive conduit51,52. In addition, S. oneidensis MR-1 is capable of transferring electrons in both outward and inward directions via a single OmcA–MtrCAB respiratory pathway48. However, in situ observation of electron transfer between the outer membrane of S. oneidensis and extracellular electrodes remains challenging. In this study, we report the application of SECM to reveal the bidirectional EET process, as mediated by an electron shuttle, and how this process influences the MIC of a typical stainless steel.

As a redox mediator, riboflavin has been reported to enable bidirectional EET by carrying electrons to cells in its reduced form or serving as an extracellular electron acceptor to facilitate biocathodic processes in its oxidized form48. Based on the SECM results (Figs. 2, 3), we schematically explain the origins of the heterogeneities in current and their relevance to the MIC of stainless steels having either passive or active surfaces (Fig. 4). Figure 4a shows the how electrons flow from cells to the metal surface via intracellular and extracellular election transfer pathways. Electrons donated by the oxidation of lactate are transported through intracellular menaquinol pools and the Mtr pathway to reach the outer membrane, where electrons convert the adsorbed oxidized riboflavin to reduced riboflavin, which is then released into the extracellular environment53. If the reduced riboflavin makes contact with iron oxides on the passive stainless steel surface, which is the electron acceptor (Supplementary Fig. 10a and Note 3), ferric ions are reduced to ferrous ions, and riboflavin returns to the oxidized state. Using SECM, the consumption of the reduced riboflavin and the production of the oxidized riboflavin were captured by UMEs that were biased at −0.2 and −0.6 V (vs. SCE), respectively. It is worth mentioning that S. oneidensis MR-1 may use flavins not only as electron shuttles, but also as redox cofactors bound to outer-membrane (OM) c-type cytochromes such as OmcA to enhance its EET kinetics53. The riboflavin bounded with OM c-type cytochromes works as a direct EET mode, and cannot be detected by SECM tip.

For energy generation, S. oneidensis MR-1 couples the oxidation of organic lactate (CH3CHOHCOO-) and the reduction of Fe(III) components, and the following redox reactions (1)–(3) take place during outward EET:

Bioanodic reaction:

$${{\rm{CH}}}_{3}{{\rm{CHOHCOO}}}^{-}+{{\rm{H}}}_{2}{\rm{O}}\to {{\rm{CH}}}_{3}{{\rm{COO}}}^{-}+{{\rm{CO}}}_{2}+4{{\rm{H}}}^{+}+4{{\rm{e}}}^{-}$$
(1)

(intracellular)

Cathodic dissolution of Fe(III) components:

$${\rm{Fe}}{({\rm{OH}})}_{3}+3{{\rm{H}}}^{+}+{{\rm{e}}}^{-}\to {{\rm{Fe}}}^{2+}+3{{\rm{H}}}_{2}{\rm{O}}$$
(2)
$${{\rm{Fe}}}_{2}{{\rm{O}}}_{3}+6{{\rm{H}}}^{+}+2{{\rm{e}}}^{-}\to 2{{\rm{Fe}}}^{2+}+3{{\rm{H}}}_{2}{\rm{O}}$$
(3)

(extracellular)

The equilibrium potentials at neutral pH (Eo′) for lactate oxidation, Fe(OH)3 reduction and Fe2O3 reduction is −430 mV (vs. standard hydrogen electrode, i.e. SHE), − 236 mV (vs. SHE) and −287 mV (vs. SHE), respectively54,55,56. Accordingly, the cell potential (ΔEo′) values of the redox reaction coupling lactate oxidation with Fe(OH)3 reduction and Fe2O3 reduction are +194 mV, +143 mV. Positive ΔEo′ values indicate that the redox reactions with the outward EET are thermodynamically favorable.

Figure 4b shows an inward EET model in which electrons transfer from an active steel surface to the bacterial interior. As it is difficult for anodic dissolution to take place through an intact passive film, this inward EET process is more likely to occur after the passive film of the stainless steel is broken (e.g., by pitting corrosion). The active steel surface, acting as the electron donor (Supplementary Fig. 10b and Note 3), releases electrons and increases the amount of the reduced riboflavin. Electrons carried by the reduced riboflavin are transferred to the interior of cells through the periplasmic protein FccA and are consumed in the reduction of fumarate to succinate54. This inward EET process is expected to provide energy for the survival of the bacteria9, and ensures that the reduction of the oxidized riboflavin is continuous when bacteria is present in the medium. riboflavin alone in the sterile medium cannot catalyze this process (Supplementary Fig. 11). In the present study, the final electron acceptor was fumarate in an anaerobic environment. Thus, the following redox reactions (4) and (5) take place with inward EET:

Anodic metal dissolution:

$${\rm{Fe}}\to {{\rm{Fe}}}^{2+}+2{{\rm{e}}}^{-}$$
(4)

(extracellular)

Bio-cathodic reaction:

$${\rm{fumarate}}+2{{\rm{H}}}^{+}+2{{\rm{e}}}^{-}\to {\rm{succinate}}$$
(5)

(intracellular)

The equilibrium potentials at neutral pH (Eo′) for Fe2+ oxidation and fumarate reduction are −447 mV (vs. SHE) and +33 mV (vs. SHE), respectively54. Accordingly, the cell potential (ΔEo′) of the redox reaction coupling iron oxidation with fumarate reduction is +480 mV. This positive ΔEo′ indicates that the redox reaction with the inward EET is also thermodynamically favorable. Similar SECM imaging performed on the ΔomcA biofilm further confirms that the aforementioned bidirectional EET between S. oneidensis MR-1 and stainless steel is responsible for the decreased/increased current on SECM maps. Knocking out the cell-membrane-bound protein OmcA impedes both the outward and inward EET. Thus, the ability of the bacteria to reduce or oxidize riboflavin mediators is considerably weakened.

The results of this study reveal that the corrosion of metals in the presence of bacteria may be accelerated by both microbial oxidation and microbial reduction, the latter of which has been largely omitted. For passive metals (e.g., stainless steels) that are generally corrosion-resistant in abiotic environment, bioreductive dissolution of protective surface oxides can accelerate the deterioration of passive films. For active metals, this effect is also likely to be involved the delayed formation of protective rusts under seawater immersion or soil burial environments. As such, the development of MIC-resistant alloys calls for new micro-alloying strategies which could tune the composition, crystallinity or ratio of surface species to decrease their electrical conductivity and electrochemical reducibility. For example, it was recently reported by Zhang et al. that a Fe-based amorphous coating could prevent SRB induced corrosion and reduce cell settlement due to its poor electrical conductivity57. A more general approach for the protection of EET-related MIC can be achieved by surface modification such as micro/nanopatterning and hydrophobization which resist bacterial settlement, thus efficiently impeding short-range electron transfer between bacteria and metal substrates.

## Conclusion

In summary, this study provides new experimental insights into the relationship between the EET process in S. oneidensis MR-1 and the MIC of stainless steels. We have demonstrated that bacteria could corrode steels via bioanodic or biocathodic EET in adaptation to the passive or active state of the steel surface. The MIC of stainless steels by S. oneidensis MR-1 is directly related to the riboflavin-mediated EET process. Using SECM as an in situ method, we have shown direct evidence that this process is bidirectional in nature and that the direction is influenced by the passive or active states of the stainless steel surface. In future work, we aim to verify whether the EET direction could adapt to the evolving surface state (from passive to active or vice versa) in the corrosion process. Besides in MIC, SECM may find general applications by tracking redox active electron shuttles in a wide range of EET processes involved in MFCs, bioleaching of metals, biosynthesis and biodegradation.

## Methods

### Materials

Riboflavin, casamino acid and HEPES were purchased from Sigma–Aldrich. Ferrocenylmethanol (FcMeOH) was purchased from Yuanye Biotechnology Co., Ltd. Sodium fumarate was obtained from Shanghai Macklin Biochemical Co., Ltd. Na2SeO4 was purchased from Shandong Xiya Chemical Industry Co., Ltd. All other chemical reagents were purchased from Sinopharm Chemical Reagent Co., Ltd. All chemicals were used as purchased without further purification. Deionized water was used to prepare all solutions. 304 stainless steel square (10 mm × 10 mm × 2 mm) and cylindrical (10 mm in diameter, 5 mm in height) coupons were prepared for MIC and SECM tests, respectively. The electrode surface of the steel coupon for MIC was sequentially abraded with 400, 600 and 800 grit abrasive papers, cleaned with anhydrous ethanol under ultrasonication, and dried in air for 2 days. After drying, the coupons were sterilized under UV light for 30 min before use.

### Bacterial mutant and culture condition

All plasmid constructions were performed in Escherichia coli Trans T1. E. coli strains were cultured in the LB medium at 37 °C with 200 rpm. Whenever needed, 50 μg mL−1 kanamycin was added in the culture medium for plasmid maintenance. For inhibiting the expression of outer membrane cytochrome (OmcA), a transcriptional regulation technology, i.e., clustered regularly interspaced short palindromic repeats interference (CRISPRi) was adopted as previously described58. Briefly, the dCas9 or hfq sequences were first incorporated into the pYYDT plasmid, which contained a PlacIq-lacIq-Ptac fragment. The synthesized sgRNA, PlacIq-lacIq-Ptac-dCas9, sRNA, and PlacIq-lacIq-Ptac-hfq BioBricks were then incorporated into pHG11 selectively and formed the resulting expression plasmids pHG11-sgRNA-dCas9-OmcA. Donor cells (E.coli WM3064) were transformed of all constructed plasmids, 0.3 mM DAP was needed for the growth of donor cells. Then constructed plasmids were transferred into S. oneidensis MR-1 by conjugation.

Before testing, bacterial cells were aerobically pre-grown overnight at 30 °C in LB medium (containing 10 g L−1 NaCl, 5 g L−1 yeast extract, and 10 g L−1 tryptone) with shaking at 150 rpm. All tests were conducted in Shewanella basal medium (SBM). One milliliter of wild-type S. oneidensis MR-1 or ΔomcA seed culture was inoculated into 100 mL sterile medium with the supplement of 0, 5, or 10 ppm riboflavin, and seed culture extracted from LB medium was centrifuged at 6000 rpm for 5 min and then washed twice with fresh SBM to remove residues from LB medium before the experiments. For the experiments in Fig. 1 and Supplementary Figs. 1, 2, 46, S. oneidensis MR-1 (after washing with SBM) was cultured in deaerated SBM (Supplementary Note 4) at an initial planktonic cell count of 106 mL−1 and then sealed with a rubber stopper and kept at 30 °C. Lactate and fumarate served as electron donor and electron acceptor in SBM, respectively. Each flask contained two coupons at the bottom with the exposed surfaces facing upward. A test temperature of 30 °C was selected to guarantee good growth of S. oneidensis MR-1 throughout this work. Due to the different natural growth rates between S. oneidensis MR-1 and ΔomcA, comparison of the corrosion performance between wild-type S. oneidensis MR-1and ΔomcA (Supplementary Fig. 3) was performed using a different incubation procedure. 304 stainless steel coupons were immersed in the pre-grown SBM medium (shaking at 150 rpm and 30 °C for 10 h and then leaving the medium in the anaerobic chamber for 3 h statically to consume any dissolved oxygen) to minimize the possible influence from the difference in the growth rates of these two strains. Planktonic and sessile cells were counted using a hemocytometer under a light microscope at 400× magnification (Zeiss, Axio Lab.A1). The pH values of the culture media were measured by using a pH meter (Mettler Toledo, S220-B). Fluorescence confocal laser scanning microscopy (Leica, TCS SP8) and field-emission scanning electron microscopy (FE-SEM, FEI Quanta 250) were used for biofilm imaging, respectively. The concentration of succinate and lactate was monitored using a high-performance liquid chromatography system (Shimadzu LC-20AD) on a reverse-phase column (5 μm Ultimate AQ-C18, 250 mm by 4.6 mm). The mobile phase included 50 mM Na2HPO4 at a flow rate of 0.7 mL min−1 and a column temperature at 30 °C.

### Surface, Mott–Schottky and EIS analyses

The numbers and depths of corrosion pits were measured based on 5 largest pit depths of each group on the steel surfaces using CLSM (Keyence VK-X) after the biofilm and corrosion products were removed from the coupon surface using rust cleaning solution (HNO3:HF = 5:1). The chemical compositions of the surfaces were analyzed by XPS (ThermoFisher ESCALAB 250). Before XPS and Mott–Schottky analysis, the biofilm formed on the sample surface was gently removed with soft cotton saturated with 100% ethanol in an anaerobic chamber (Supplementary Note 5). The EIS results of samples on the sixth day in the S. oneidensis MR-1 inoculated medium with varied concentration of lactate, fumarate and riboflavin were presented in this study. The EIS measurements were conducted at the open circuit potential with the frequency ranging from 100 kHz to 10 mHz, with the voltage amplitude of the sinusoidal perturbation at 10 mV. All electrochemical tests were performed using a Gamry Reference 600 Plus. A traditional three-electrode system was used, a 304 stainless steel coupon was used as the working electrode, a saturated calomel electrode (SCE) was used as the reference electrode, and a platinum plate was used as the counter electrode. All tests were performed at least twice for reliability.

### SECM sample preparation

For SECM tests, first, S. oneidensis MR-1 or ΔomcA was grown in SBM with shaking at 150 rpm and 30 °C to allow bacterial cells to replicate aerobically for 10 h. Subsequently, riboflavin was added at a concentration of 10 ppm to the medium, which was then kept under static conditions in an anaerobic chamber under a N2 atmosphere for 3 h, which allowed bacterial cells to fully consume any dissolved oxygen in the solution. Cylindrical 304 stainless steel samples were sealed with PTFE and the exposed surface (10 mm in diameter) were sequentially abraded with 400, 800, 1500 and 2000 grit abrasive papers to make a smooth surface, which was helpful to avoid the effects of surface morphology on SECM tip signals. To prepare a passive surface, the abraded steel electrode was cleaned with ethanol under ultrasonication and stored in dry air for 2 days to grow a stable passive film. To prepare an active surface, the electrode was sequentially abraded with 400, 800, 1500 grit abrasive papers and then abraded to 2000 grit abrasive paper in an anaerobic chamber under a N2 atmosphere to slow down the oxidization of the sample surface. The steel samples were cleaned with 100% ethanol and immediately immersed in the prepared S. oneidensis MR-1 or ΔomcA inoculated SBM for 18 h before SECM imaging.

### In situ SECM imaging

SECM measurements were made using a CHI 920D instrument (CH Instruments). A homemade carbon fiber electrode (diameter = 7 μm) was used as the UME. A 2 mm platinum disk electrode was used as the counter electrode, and Ag/AgCl (3.0 M KCl) was used as the reference electrode. The SECM setup and the detailed apparatus are shown in Supplementary Fig. 12 and described in Supplementary Note 6. The CV measurement was also conducted to verify the anaerobic condition of the medium (Supplementary Fig. 13). Before SECM measurement, the microscope stage was leveled by measuring a negative feedback approach curve using FcMeOH as the redox mediator. The inoculated steel specimen was gently washed twice with deaerated phosphate-buffered saline (PBS) and then transferred to the SECM apparatus. The tip–substrate distance was fixed at ~20 μm with the aid of 1 mM FcMeOH dissolved in deaerated PBS. The inoculated steel specimen was washed twice with the supernatant to remove FcMeOH after the height of the SECM tip was fixed. Finally, SECM imaging was conducted in 3 mL supernatant maintained at 30 °C in a water bath. The UME was biased at −0.2 V (vs. SCE; oxidizing riboflavin) and −0.6 V (vs. SCE; reducing riboflavin) to image the same region above the inoculated specimen. Square-wave voltammetry was used to verify that only riboflavin could react at the UME at its redox potentials during the SECM imaging process (Supplementary Fig. 14 and Supplementary Note 7).