Smart coating with dual-pH sensitive, inhibitor-loaded nanofibers for corrosion protection

Smart coatings that provide corrosion protection on demand have received a lot of recent attention. In the present study, nanofibers containing a corrosion inhibitor were prepared by a coaxial electrospinning technique, which addresses the limitations of inhibitor-loaded microcapsules or nanocontainers. The as-prepared nanofibers have a core-shell structure with Ce(NO3)3 and the chitosan/polyacrylic acid polyelectrolyte coacervate as the core and shell materials, respectively. UV-vis spectroscopic analysis confirms that the nanofibers are pH-sensitive and able to release the enclosed Ce(NO3)3 at both low and high pH conditions, which are spontaneously generated during corrosion at local anodes and cathodes, respectively. A coating system consisting of such nanofibers within a polyvinyl butyral coating matrix exhibits improved corrosion protection of an AA2024-T3 substrate. Moreover, the embedded Ce(NO3)3-loaded nanofibers can persistently release Ce(NO3)3 to impede corrosion of AA2024-T3 when the artificially damaged coating sample is exposed to NaCl solution.


INTRODUCTION
Aluminum alloys, including AA2024-T3, are strong and light aerospace-grade materials but they suffer from localized corrosion mainly due to the microgalvanic coupling between the intermetallic particles and the aluminum matrix 1 . Coatings with corrosion inhibitors have been widely used to protect these alloys from corrosion 2,3 . For instance, inhibitive pigments such as strontium chromate, lithium carbonate, and cerium cinnamate are directly introduced into the coating matrix to obtain the desired protectiveness in harsh environments [4][5][6] . However, these active inhibitors may detrimentally affect the barrier property of the coating and be quickly depleted by uncontrolled leaching 7,8 . To address these issues, inhibitors can be confined within micro or nano capsules. A major benefit of using capsules is to isolate inhibitive species from the polymeric coating matrix, so the adverse interactions can be minimized 9,10 . Additionally, the shell of these capsules can serve as a diffusion barrier to prevent the uncontrolled release of corrosion inhibitors, avoiding the rapid depletion of inhibitors and ensuring corrosion protection performance for extended periods 11 . Despite their advantages, the capsules also have notable limitations such as undermining the integrity of the coating matrix 12 . When these capsules are impregnated within a coating, new interfaces between the capsules and the coating matrix are produced. This may lead to the generation of defects at the interfaces or induce local stress concentration, threatening the structural stability of the coating 12,13 . Moreover, the heterogeneous distribution of inhibitorloaded capsules within the coating evidently affects the supply of corrosion inhibitors in different locations 14,15 . This may result in low corrosion inhibition efficacy in the areas where fewer inhibitor-loaded capsules are present. Additionally, these capsules are discretely embedded within the coating 14,16 , so it is difficult to replenish the corrosion inhibitors after they are released. As a result, the continuous protection of metals against corrosion for extended periods is not guaranteed.
To overcome the issues mentioned above, an alternative approach based on manufacturing nanofibers has attracted increasing attention recently. Due to the presence of interfibrous pores, the intrusion of the coating matrix solution into the nanofiber network can be facilitated, thus interlocks between the nanofibers and the coating matrix can form to improve the mechanical properties of the coating systems containing nanofibers 17,18 . Also, the diameter of these fibers is usually on the submicron scale. Therefore, it is possible to incorporate these fibers within relatively thin coatings, e.g., those with a thickness of only several micrometers 15,19 . Most importantly, nanofibers are continuous and intertwined, so the embedded inhibitors can readily transport through the interconnected channels to a damaged area, replenishing released inhibitors to provide longterm healing performance 13,20 . As proven in a previous study 21 , nanofibers can repetitively suppress the recurrence of corrosion, whereas a single healing event was observed when microspheres were used. It should be noted that the release of healing agents from the nanofibers in that work was induced by an external mechanical force. However, other stimuli, such as water penetration and local pH changes, may also be generated during the corrosion process and can be used as triggers for releasing protective species. Among these stimuli, local pH alteration is preferable as spatially separated anodic and cathodic reactions occurring during corrosion of aluminum alloys drive the local environments to become acidic and basic, respectively 22,23 . Accordingly, pH-sensitive nanofibers can release entrapped corrosion inhibitors as the pH changes, while reserving the inhibitors once corrosion is retarded and the pH is restored to neutral or near neutral. Nevertheless, to the best of our knowledge, the majority of nanofibers developed to date are either not stimulus-responsive or only sensitive to water penetration 12,14,15,24 . A few earlier works attempted to develop inhibitor-loaded nanofibers using the change of pH as the release trigger, but most nanofibers could only respond to either acidic or alkaline pH conditions 25,26 . Although a previous study reported that the nano-scale fibers made from polyaniline could be dual-pH sensitive 27 , those fibers did not have continuous length and the nanofiber network was not observed. This may lead to difficulty in transporting the impregnated inhibitors to achieve repeated selfhealing performance. Hence, it is worthwhile to put more effort into fabricating inhibitor-loaded nanofibers that are responsive to both low and high pH conditions and capable of constantly releasing the entrapped inhibitors in the same defective regions.
To engineer nanofibers containing corrosion inhibitors, the electrospinning technique is one of the most promising methods due to its flexibility and easy operation. This one-step technique can produce long and continuous fibers with a diameter of nanometers or larger. The physical properties such as the morphology, porosity, and diameters of the fibers can be readily modified by tuning the electrospinning parameters, providing a possibility of manufacturing a variety of nanofibers with desired properties 18,24 . However, the electrospinning technique is not widely explored in the context of corrosion, especially for the fabrication of dual-pH-sensitive nanofibers for corrosion protection applications. Therefore, the aim of this study is to use the coaxial electrospinning technique to encapsulate corrosion inhibitors into nanofibers with the chitosan/PAA polyelectrolyte coacervate as the shell material. As described in a previous work 28 , the chitosan/PAA polyelectrolyte coacervate could be electrospun to form nanofibers. Although the swelling/deswelling behavior of as-spun nanofibers was only reported at the neutral and acidic pH conditions, these nanofibers might also respond to the pH shift towards alkaline regions. This is because both chitosan and PAA are weak polyelectrolytes and the charge density on their polymer chains is dependent on the pH of the surrounding medium, so the interactions between the polyelectrolytes can potentially be affected by both acidic and alkaline pH [29][30][31] . This assumption has also been validated in prior works where materials made from weak/weak polyelectrolyte pairs were damaged at both low and high pH conditions but remained stable at neutral pH 32,33 . Therefore, the chitosan/PAA polyelectrolyte coacervate can be an excellent candidate for the shell material of dual-pH-responsive nanofibers. To assess the applicability of generating corrosion inhibiting nanofibers, Ce(NO 3 ) 3 was loaded in the cores of the fibers via the coaxial electrospinning technique. Ce(NO 3 ) 3 is considered as a mixed inhibitor because Ce 3+ ions are highly efficient in retarding cathodic reactions of aluminum alloys, whereas NO 3 − ions inhibit anodic kinetics to some extent [34][35][36] . Furthermore, it raises less concerns about toxicity issues than hexavalent-chromium-based inhibitors 37,38 . Thus, Ce(NO 3 ) 3 -loaded nanofibers were created by electrospinning, and their core-shell structure, morphology, and composition were characterized by confocal spectroscopy, transmission electron microscopy (TEM), and scanning electron microscopy (SEM) with energy dispersive spectroscopy (EDS). The release behavior of the nanofibers in response to pH alterations was monitored by UV-vis spectroscopy. Afterwards, a pH-sensitive coating was developed by embedding Ce(NO 3 ) 3 -loaded nanofibers into a polyvinyl butyral (PVB) coating matrix and applied on a AA2024-T3 substrate. The corrosion resistance of the coated sample was studied comprehensively by electrochemical impedance spectroscopy (EIS). Furthermore, EIS was also conducted on a scratched coating sample to determine the self-healing capability over time.

RESULTS AND DISCUSSION
Dual-pH-sensitive behavior of chitosan/PAA polyelectrolyte coacervate A previous study described how chitosan and PAA could form a homogenous coacervate solution without precipitates in an acidic environment 28 , but the dual-pH-sensitive behavior of the coacervate was not studied. Therefore, to have a quick demonstration of the dual-pH-sensitivity of the coacervate, bromophenol blue (BB), an organic dye-loaded coating, i.e., (BB) 3 /(chitosan/PAA) 5 was fabricated and the release of the entrapped BB at different pH conditions was studied. BB was impregnated into the polyelectrolyte coacervate coating because the released BB can be easily detected by the color change of the release medium without need of further characterization techniques. As shown in Fig. 1a, the media after 24 h of release appears to be yellow in color at both pH 2.5 and 10, whereas a less significant change is observed at pH 7. This proves the chitosan/PAA coacervate is dual-pH-responsive and can release BB at both low and high pH conditions at a faster rate than that at neutral pH. Another set of coating samples Fig. 1 Dual-pH-responsive behavior of the chitosan/PAA coacervate and characterization of Ce(NO 3 ) 3 -loaded nanofibers. a The release of BB in DI water with varied pH for 24 h. b The surface morphology of Ce(NO 3 ) 3 -loaded nanofibers examined by SEM. Scale bar is 20 µm. c Ce (NO 3 ) 3 -loaded nanofibers observed by confocal spectroscopy. Scale bar is 20 µm. d The core-shell structure of an individual Ce(NO 3 ) 3 -loaded nanofiber confirmed by TEM. Scale bar is 100 nm.
without BB was used to detect the alteration of surface morphology caused by immersion for 24 h. From optical microscopy images ( Supplementary Fig. 1), most of the coating dissolved at pH 2.5, and several large pores were created at pH 10. At pH 7, the surface morphology became rougher relative to that before immersion, but this change is less obvious compared to that at pH 2.5 and 10. This finding again verifies that the chitosan/PAA coacervate is sensitive to both the acidic and basic pH conditions. The mechanism behind this pH-responsive behavior is associated with the strength of electrostatic interactions between the two oppositely charged polyelectrolytes 28,39 . As well-documented in earlier works, the pK a values of chitosan are 6.22, 6.11, and 6.09, whereas PAA has a pK a of 6.5 29,40 . Although these pK a values may shift when the polyelectrolyte is incorporated within the coacervate 41 , it is safe to conclude that chitosan and PAA have moderate interactions between their functional groups at pH 7 as both polyelectrolytes are partially charged. However, such interactions can be compromised by altering the pH to 2.5 or 10, owing to the deionization of PAA or chitosan, respectively. As a result, the presence of hydrogen bonds between water and uncharged functional groups within polyelectrolytes (i.e., carboxylic acid groups in PAA and amine groups in chitosan) enables water to penetrate through the polymer networks, a process accompanied by the swelling/dissolution of the polyelectrolyte coacervate 28 . Moreover, in both the acidic and alkaline environments, one of the polyelectrolytes is prone to be fully charged and the stronger repulsive force within the polyelectrolytes can also cause the polyelectrolyte coacervate to swell or dissolve in the solution. Consequently, the impregnated organic dye can rapidly release from the unstable polyelectrolyte coacervate at pH 2.5 and 10.

Characterization of Ce(NO 3 ) 3 -loaded nanofibers
Ce(NO 3 ) 3 -loaded nanofibers were fabricated by the electrospinning technique. A coaxial nozzle was utilized to prevent the undesired mixing between the polyelectrolyte coacervate solution and the inhibitor solution prior to the formation of nanofibers. During the electrospinning process, chitosan may have limited electrospinnablity due to the intermolecular interactions 42,43 , but the presence of PAA in the polyelectrolyte coacervate can hinder the undesired interactions between the chitosan chains allowing electrospinning to be successful 44 . The SEM in Fig. 1b shows that the resulting nanofibers are free of defects and beads. The diameter of the electrospun nanofibers is less than 200 nm ( Supplementary Fig. 2).
To verify the core-shell structure of the nanofibers, confocal spectroscopy was employed at first. Hoechst 33258 pentahydrate was added into the shell solution while rhodamine B was mixed with the core solution, Due to the excitation by the laser in the confocal microscope, these two fluorescence dyes made the shell and the core blue and red in color, respectively. However, due to the limited resolution of confocal microscopy, the shell of the nanofibers appears to be solid instead of hollow (Fig. 1c). The image of the core stained by rhodamine B base is continuous, indicating Ce(NO 3 ) 3 is filled within the nanofibers. Upon combining the images of the shell and the core, the red and blue colors overlap, and no red color is observed outside the nanofibers, suggesting the successful incorporation of Ce(NO 3 ) 3 (Fig. 1c). To further confirm Ce(NO 3 ) 3 was incorporated within the nanofibers, EDS was carried out by analyzing the Ce spectral Mα line located at 0.88 keV 45 . No other spectral lines of Ce at high energy levels were examined to prevent the signal of Ce from being overwhelmed by background signals from the substrate. Besides, the Mα line of Ce did not overlap with spectral lines of other elements contained in the samples, such as O, C, and N. Therefore, it is feasible to only use the Mα line to investigate the existence of Ce inside the nanofibers. Three locations along one nanofiber were randomly selected and examined. The content of Ce was independent of location ( Supplementary Fig. 3a), indicating the uniform dispersion of Ce(NO 3 ) 3 in the nanofibers. Additionally, the possible existence of Ce in an area without nanofibers was probed, but the characteristic peak of Ce did not appear in the EDS spectrum ( Supplementary Fig. 3b). This validates the successful encapsulation of Ce(NO 3 ) 3 , consistent with the confocal spectroscopy result (Fig. 1c). Since the confocal spectroscopy was not able to reveal the core-shell structure of the nanofibers, TEM analysis was conducted. The detailed morphology of the nanofibers is presented in Fig. 1d. A sharp boundary between relatively dark and bright regions is identified, corresponding to the core and shell of the nanofibers, respectively. This is in line with previous studies showing that the element with a higher atomic number is more likely to scatter electrons relative to that with a low atomic number, rendering a darker region in the resulted bright-field TEM image 46,47 . Therefore, the core enriched with Ce(NO 3 ) 3 was darker compared to the shell made from the polyelectrolyte coacervate. The overall diameter of the nanofiber is about 120 nm, while the diameter of the core region is around 85 nm. Moreover, the core is concentrically located in the nanofibers, suggesting a stable electrospinning process 48,49 . The use of the coaxial electrospinning technique minimizes the contact between the core and shell solutions 50 , avoiding the adverse effect of the electrostatic interaction between Ce(NO 3 ) 3 and the polyelectrolyte coacervate and contributing to the successful fabrication of Ce(NO 3 ) 3 -loaded nanofibers.

Release of Ce(III) from Ce(NO 3 ) 3 -loaded nanofibers
The dual-pH-responsive behavior of the chitosan/PAA polyelectrolyte coacervate was corroborated by the fast release of an organic dye upon a pH change ( Fig. 1a and Supplementary Fig. 1). However, it is essential to investigate whether this behavior can be affected by the electrospinning process. Moreover, the presence of Ce(NO 3 ) 3 in the core of the nanofibers may also result in different release kinetics due to the undesired electrostatic attraction between the negatively charged PAA and positively charged cerium ions. Therefore, the release of Ce(NO 3 ) 3 from the nanofibers was studied by immersing the nanofiber-coated samples in DI water with pH 2.5, 7, or 10. The exposed area was 7.5 cm 2 . It should be noted that although both cerium ions and nitrate ions can be released from the nanofibers, it is difficult to detect the released nitrate ions by UV-vis spectroscopy. Thus, only the released amounts of Ce(III) were measured, and the cumulative release profile of Ce(III) is shown in Fig. 2a. There are two stages in the release curves including a rapid release of Ce(III) at the beginning and a sustained release thereafter. The initial burst release of Ce(III) may be associated with unleashing the inhibitors close to the shell, which is commonly reported in the literature 32,51 . As time proceeds, the corrosion inhibitors in the inner core are released, contributing to the sustained release at a slower rate in the second stage. Notably, the release rate in the first stage was higher at pH 2.5 and 10, as indicated by the steeper slope of the release curve, compared to that at pH 7. This can be elaborated by the pH-triggering release process at both low and high pH conditions. After 2 h of exposure, the final values of the cumulative concentration of Ce(III) were 0.16 mM at pH 2.5 and 0.14 mM at pH 10. The enhanced solubility of Ce(III) at low pH conditions may account for a faster release of Ce(III) at pH 2.5 compared to at pH 10 34,52 . Although Ce(III) ions tend to precipitate at pH 10, which is thermodynamically favorable, it is likely a kinetically slow process. It should be noted that the released amounts of Ce(III) at both acidic and alkaline pH were more than twice that at the neutral pH, verifying that the Ce(NO 3 ) 3 -loaded nanofibers are dual-pH-sensitive, and neither the electrospinning process nor the enclosed Ce(NO 3 ) 3 substantially interfere with the pH-sensitive release behavior of the nanofibers. Moreover, the release profile of Ce(III) displayed curves with a positive slope at the end of the release study, especially at both low and high pH conditions, indicating the enclosed Ce(NO 3 ) 3 was not depleted and was capable of sustainably releasing for extended periods. This enduring release process may have provided a sufficient amount of corrosion inhibitors for corrosion protection of AA2024-T3. It is possible that higher contents of Ce(NO 3 ) 3 in the fibers could be achieved by adjusting the electrospinning parameters, but this was not investigated. The surface morphology of the nanofibers after the release study was also examined by SEM. As shown in Fig. 2b, the nanofibers strongly dissolve after being exposed to an acidic condition for 2 h. In an alkaline environment, a large number of nanofibers swell, and numerous pores are generated inside the nanofiber networks ( Fig. 2b and Supplementary Fig. 4). In contrast, the change in the surface morphology of the nanofibers at pH 7 is negligible (Fig. 2b). It is also worth noting that the nanofibers seems to exhibit a higher degree of swelling under acidic condition compared to that of the alkaline condition, which may explain the higher amount of Ce(III) released at pH 2.5 than pH 10 (Fig. 2a). The distinct morphologies of the nanofibers shown in Fig. 2b suggest that the shell material can be in an either open or close state depending on the environmental pH. Under acidic and alkaline conditions, the shell of the nanofibers can open to release the encapsulated corrosion inhibitors, whereas remains closed at neutral pH to retard the leakage of the inhibitors from the core of the nanofibers.
Surface morphology of coated AA2024-T3 samples Two coated AA2024-T3 samples, i,e., Fiber-PVB and Ce-Fiber-PVB were prepared using the dip-coating method. The coating made by the bar-coating technique might have unfilled interfibrous pores/voids inside the coating, which can serve as pathways for the aggressive solution to reach the AA2024-T3 substrate to trigger corrosion. Additionally, the electrospun nanofibers formed a mat that was thick enough to be readily peeled off from the substrate during the bar-coating process, even though PVB was precoated on AA2024-T3 to enhance the adhesion between the nanofiber mat and the metal substrate. As a result, visible defects were inevitably created in the resulting coated samples (Supplementary Fig. 5a). As the nanofiber mat was found to not dissolve in ethanol, a dip-coating method was used as an alternative to prepare coated AA2024-T3 samples. The surface morphology of dip-coated samples was explored by SEM. Compared to PVB (Fig.  3a), the inclusion of nanofibers with/without Ce(NO 3 ) 3 did not significantly alter the surface morphology, and the nanofibers seemed to be fully covered by PVB (Fig. 3b, c). Moreover, the thickness of Fiber-PVB and Ce-Fiber-PVB was 17 and 16 µm, respectively, which did not evidently increase compared to that of PVB. This is possibly because PVB intercalated into the nanofiber mat and reached the underlying metal substrate. Hence, by dipcoating, PVB can seal the interfibrous pores and act as a binder for the nanofiber mat to attach to the metal substrate. During the coating preparation, the nanofiber mat formed on the substrate was white in color but gradually became transparent with the deposition of PVB layers, indicating the infiltration of PVB to replace the air in the interfibrous pores, in line with studies  reported elsewhere 15,53 . Unlike the bar-coated samples, the dipcoated samples had a smooth and uniform surface without noticeable defects (Supplementary Fig. 5a). The advantage of the dip-coating method over the bar-coating technique was further demonstrated by the surface morphology of coated samples observed by SEM. As shown in Supplementary Fig. 5b, nanofibers partially protrude from the bar-coated samples, which is not the case for the dip-coated samples (Fig. 3). These uncovered parts of nanofibers may jeopardize the integrity of the coating and be vulnerable sites for corrosion attack. Therefore, the dip-coating method was utilized to fabricate coated AA2024-T3 samples for the following electrochemical tests.
EIS tests at various pH conditions EIS measurements were carried out at both pH 2.5 and pH 10 to examine the corresponding corrosion resistance of two coated samples, i.e. Fiber-PVB and Ce-Fiber-PVB, both on AA2024-T3, as a function of immersion time. The solution pH was adjusted to be acidic and basic to mimic the situation that occurred in anodic and cathodic sites in the metal substrate during corrosion, because the local pH conditions may decrease or increase due to the hydrolysis of metal ions and the oxygen reduction reaction (ORR), respectively 54,55 . As a comparison, EIS tests at pH 7 were also conducted. The addition of 5 mM Na 2 SO 4 ensures enough conductivity of the electrolyte. Meanwhile, such a small amount of Na 2 SO 4 is not likely to adversely affect the stability of the nanofibers or trigger corrosion of AA2024-T3. For reproducibility, the EIS tests were repeated twice. The representative EIS spectra are shown in Fig. 4, and the impedance values at 0.01 Hz (|Z | 0.01Hz ) for different immersion times is recorded in Supplementary Fig. S6 to better illustrate the corrosion protection performance of coated samples, as a higher value of lowfrequency impedance generally indicates better corrosion resistance 56 .
For Fiber-PVB immersed at pH 2.5 ( Fig. 4a and Supplementary  Fig. 6a), the impedance values at both low and middle frequency abruptly decreased by over one order of magnitude after the coating was soaked in the solution for 24 h. This indicates that the coating began to degrade, and water was absorbed by the coating at a rapid rate. Then, a slight decrease in the impedance values was observed as the immersion time increased from 24 to 48 h, which is possibly associated with the water saturation in the coating. With a prolonged soaking time, the impedance value at low frequency further showed a downward trend, perhaps because the corrosive electrolyte arrived at the metal substrate to initiate corrosion. Meanwhile, the nanofibers inside the coating were destroyed, which accelerated the rupture of the coating. In the Bode phase plots, two time constants are clearly present with one at high frequency and the other at low frequency, related to the coating property and the charge transfer process at the metal/ coating interface, respectively 57,58 . The maximum phase angle at the high frequency was low and the magnitude decreased over time. No plateau in the high frequency range in the Bode phase plot is observed. These results suggest that the barrier property of the coating sample was severely affected by exposure to an aggressive environment. In contrast, at pH 2.5 the impedance values for Ce-Fiber-PVB with Ce(NO 3 ) 3 encapsulated within the nanofibers displayed a constant increase at low frequencies along with a moderate increased in the mid frequency range (Fig. 4b and Supplementary Fig. 6a). Additionally, the phase angle at high frequencies is nearly −90°and seems to be constant at all immersion times. Besides, the plateau region in the high frequency range tends to broaden towards the lower frequency, indicating the barrier property of the coating is promoted rather than being undermined. All these observations suggest Ce-Fiber-PVB has better corrosion resistance than Fiber-PVB, possibly originated from the corrosion inhibition effect of Ce(NO 3 ) 3 . As previously reported, Ce(NO 3 ) 3 is highly efficient in retarding corrosion of AA2024-T3 through the preferential deposition at cathodic sites to form insoluble cerium oxide/hydroxide films 59,60 . Moreover, the charge transfer process between the anodes and cathodes can also be impeded due to the lower conductivity of precipitated cerium compounds, thus reducing the corrosion rate of AA2024-T3 61,62 . Some works also suggested that Ce(IV) species can be generated by the oxidation of Ce(III) during the corrosion of AA2024-T3, and these species can also form insoluble Ce(IV) oxides/hydroxides to slow down the corrosion process 63,64 . In contrast to cerium ions, which are cathodic inhibitors, nitrate ions can impede anodic reactions to some extent at low pH conditions. This is possibly due to the oxidizing capability of nitrate ions, which can promote the formation of a protective oxide layer to passivate the metal surface 34 . As shown in Supplementary Fig. 7, the anodic current density of AA2024-T3 decreased when the metal was polarized in the acidic solutions containing Ce(NO 3 ) 3 , which may be associated with the existence of nitrate ions. Therefore, for Ce-Fiber-PVB, Ce(NO 3 ) 3 was released from the nanofibers and can potentially retard both anodic and cathodic kinetics, leading to the improved corrosion protection performance. However, the formation of an insoluble cerium film can be delayed by the limited local pH raise under an acidic bulk environment, and a stable film is more difficult to be maintained at low pH conditions, leading to a modest drop in |Z | 0.01Hz after 72 h immersion ( Supplementary Fig. 6a).
The behavior at pH 10 was similar. For Fiber-PVB ( Fig. 4c and Supplementary Fig. 6b), after 1 h of immersion, the impedance modulus declined with decreasing frequency due to the drastic alteration of the metal surface caused by corrosion. The addition of the empty nanofibers did not provide corrosion protection to the metal substrate, evidenced by a continuous drop in |Z | 0.01Hz (Supplementary Fig. 6b). The impedance at the middle frequency decreased with increasing immersion time, and the plateau at the middle frequency was more distinctly shown in the extended immersion periods, indicating the degradation of the coating and the ingress of corrosive electrolyte (Fig. 4c). On the other hand, |Z | 0.01Hz of Ce-Fiber-PVB increased over time and was nearly two orders of magnitude higher than that of Fiber-PVB by the end of immersion, suggesting superior corrosion resistance (Supplementary Fig. 6b). It should be noted that in the Bode phase plot (Fig.  4d), the time constant at high frequency is dominant. Although a small bump appears at low frequency after 1 h of immersion, it diminishes with immersion time. This implies the released Ce (NO 3 ) 3 slowly suppresses corrosion of AA2024-T3. This inhibition effect is better than that at pH 2.5, as indicated by no decrease in | Z | 0.01Hz of Ce-Fiber-PVB after 72 h of immersion. This is likely account of the easier formation of insoluble cerium oxides/ hydroxides in the alkaline environment 56,65 .
At pH 7 the behavior was different. For Fiber-PVB (Fig. 4e), the impedance values at both low frequency and middle frequency declined by an approximately full decade. However, they did not keep decreasing after 24 h, and |Z | 0.01Hz even recovered to some extent in the repeated EIS experiment (Supplementary Fig. 6c), which is not the case at pH 2.5 and pH 10. It is well-known that both PAA and chitosan are hydrophilic and chitosan has multiple sites on the polymer chains for water adsorption, such as hydroxyl groups and amine groups 40,66 . The introduction of the nanofibers into the coating may render the coating system to be hydrophilic, which can speed up the water infiltration. As a result, a decrease in the impedance values was shown even though the coating was not severely deteriorated. Since the environment is less aggressive at pH 7, the corrosion rate of AA2024-T3 is low, which can explain why the impedance remained unchanged with extended immersion time. For Ce-Fiber-PVB ( Fig. 4f and Supplementary Fig. 6c), the released Ce(NO 3 ) 3 may have precipitated to form an insoluble film to retard water penetration, so the impedance values of Ce-Fiber-PVB did not decrease. Nevertheless, since the chitosan/PAA coacervate is stable at pH 7, a limited amount of entrapped Ce (NO 3 ) 3 can be released out from the nanofibers. Thus, unlike at pH 2.5 and 10, the impedance did not significantly increase with increasing immersion time at pH 7.
To quantitatively estimate the protectiveness of the coating in Na 2 SO 4 solutions with various pH, EIS experimental data were fitted using a classical equivalent circuit model with two time constants, presented in Supplementary Fig. 8a, and the fitted lines are exhibited along with the experimental data in Fig. 4. The selection of this model considers the following characteristics: R s is the solution resistance. R pore and CPE coat correspond to the pore resistance and the coating capacitance indicated by a constant phase element, respectively. R p refers to the polarization resistance whereas CPE dl represents the double layer capacitance, arising from the faradic process at the coating/metal interface. Due to the heterogeneity and roughness of the coating surface 25 , the maximum phase angle deviated from -90° (Fig. 4). As a result, constant phase elements (CPEs) were applied instead of perfect capacitors for a more accurate fit, which can take into account the non-ideal capacitive behavior of coated samples. To demonstrate differences in the corrosion resistance of Fiber-PVB and Ce-Fiber-PVB, the evolution of R pore and R p versus immersion time are compared and shown in Figs. 5 and 6, while the actual coating capacitance (C coat ) and double layer capacitance (C dl ) were extracted from the fitting results using a well-established method 67 , and provided in Supplementary Figs. 9 and 10.
Generally speaking, R pore represents the barrier property of a coating system, and a larger R pore reflects stronger protective capability of the coating. As displayed in Fig. 5a, R pore decreased by nearly a full decade within 24 h of immersion when Fiber-PVB was placed in Na 2 SO 4 solution with pH 2.5 because of rapid water saturation in the coating. This is also consistent with a sudden increase in C coat at the initial stage of immersion ( Supplementary  Fig. 9a). Afterwards, R pore continued diminishing from 2.0 × 10 4 ohm cm 2 to 1.6 × 10 4 ohm cm 2 , possibly due to the destabilization of the embedded nanofibers. As mentioned above, under acidic pH conditions, the electrostatic interactions between chitosan and PAA are more likely to be disrupted, inducing the swelling/ dissolution of the nanofibers. Therefore, more defects can form in the coating to adversely affect the protection properties of the coating system. Due to the same reason, a similar declining tendency in R pore of Fiber-PVB with immersion time was observed at pH 10 (Fig. 5b). Concerning pH 7 (Fig. 5c), the average R pore value of Fiber-PVB also declined from 5.5 × 10 4 ohm cm 2 to 7.9 × 10 3 ohm cm 2 during the early immersion period, but then slightly recovered to around 1.0 × 10 4 ohm·cm 2 for the remaining exposure time. At the end of the EIS measurement, the decrease in R pore was less significant compared to that displayed at pH 2.5 and 10. This is because the coating has a slower degradation rate and nanofibers are primarily intact under a less corrosive environment. It should be noted that despite the mild environment (i.e., pH 7), an abrupt decrease in R pore during the first 24 h immersion was again observed. This is possibly due to the fast water infusion into the coating with an intrinsic hydrophilic property, which can be a factor of concern and needs to be addressed in future work. For Ce-Fiber-PVB in pH 2.5, R pore either barely changed or had a modest rise in the replicated EIS tests (Fig. 5a). This is significantly different from what was observed for Fiber-PVB at the same pH condition. The higher corrosion resistance of Ce-Fiber-PVB may be attributed to the additional protection from the released cerium species and the subsequent formation of insoluble cerium films. Nevertheless, these insoluble films are prone to be redissolved upon contacting with the acidic electrolyte, resulting in a limited improvement in the barrier property of the coating. However, at alkaline pH condition redissolution of the oxide/hydroxide does not occur. At pH 10, R pore exhibited a value of 2.0 × 10 6 ohm cm 2 at the end of the EIS  measurement, which was over one order of magnitude higher than the initial value (Fig. 5b). Meanwhile, C coat decreased over time ( Supplementary Fig. 9b). These results suggest a greatly enhanced protective ability of the coating due to the favorable pH condition for the formation of a robust cerium hydroxide/oxide film. At pH 7 (Fig. 5c), R pore stayed unchanged throughout the exposure, which is similar to what was observed at pH 2.5, but the mechanism is different. At neutral pH, a fast release of loaded Ce(NO 3 ) 3 is hampered by the undamaged shell of the nanofibers, so the protective ability of the coating cannot be dramatically boosted due to the inadequate released corrosion inhibitors. Nevertheless, a small amount of corrosion inhibitors can still be released by diffusion and provide protection to some degree. As a result, no decrease in R pore was shown.
It is noteworthy that for the two coating samples under study, the variation of R pore versus immersion time was not obvious, possibly because water quickly saturated inside the coating. Therefore, the evolution of R p over time was also assessed to characterize corrosion protection performance of the coated samples, as R p is inversely correlated with the rate of corrosion and can describe the corrosion resistance of the coated samples in an aggressive environment. For Fiber-PVB corroded at pH 2.5, R p decreased over time while C dl increased ( Fig. 6a and Supplementary Fig. 10a). For instance, R p diminished from 2.1 × 10 6 ohm cm 2 to 1.8 × 10 5 ohm cm 2 when the coating was immersed in the solution for 24 h, then continuously decreased at a slower rate for the remaining immersion period. In the meantime, C dl notably increased from 1.0×10 −8 F cm −2 to 3.0×10 −6 F cm −2 throughout the immersion. These results indicate coating degradation and the fast ingress of the aggressive electrolyte towards the metal surface to trigger corrosion. A similar trend was also found for R p and C dl of Fiber-PVB at pH 10 ( Fig. 6b and Supplementary Fig. 10b). Like pH 2.5, the coating sample experienced a severe deterioration due to the swelling of the nanofibers. As a result, more pathways were generated for the aggressive electrolyte to arrive at the AA2024-T3 substrate, causing a sudden change in R p and C dl within a short immersion period. Due to the amphoteric nature of Al, AA2024-T3 is also highly vulnerable to corrosion at alkaline conditions, leading to the decrease and increase of R p and C dl , respectively. However, at pH 7, despite a drop in R p during the first 24 h immersion, Fiber-PVB seemed to have constant R p values up to 72 h (Fig. 6c), which is associated with the higher stability of the passive film on the substrate at neutral pH. Even though water diffuses to the metal/coating interface and leads to the reduction of R p at the beginning of immersion, intense corrosion of AA2024-T3 was impeded by the passive film, resulting in the unchanged R p of Fiber-PVB between 24 and 72 h. For Ce-Fiber-PVB corroded at pH 2.5, R p increased and reached a plateau above 1.0 × 10 6 ohm cm 2 until the exposure time extended to 48 h, then slightly reduced between 48 and 72 h (Fig. 6a). Nevertheless, compared to that of Fiber-PVB, the final R p of Ce-Fiber-PVB was more than one order of magnitude higher, suggesting a lower corrosion activity when AA2024-T3 was coated with Ce-Fiber-PVB. The detailed mechanism has been discussed above. To recap, the encapsulated Ce(NO 3 ) 3 was stored within the nanofibers, and released when the nanofibers were open at pH 2.5, followed by precipitating insoluble cerium oxides/hydroxides to passivate the metal surface. Since this insoluble film has a lower dielectric constant, C dl of Ce-Fiber-PVB decreased and became lower than that of Fiber-PVB ( Supplementary Fig. 10a). It should be noted that under the acidic pH condition, the local pH raise is buffered by the bulk acidic solution, so the formation of the cerium oxide/hydroxide film is restrained. This may lead to partial coverage of the film on the metal surface, limiting the corrosion inhibition effect of released Ce(NO 3 ) 3 . Similarly, at pH 10, the addition of Ce(NO 3 ) 3 -loaded nanofibers empowered the coating sample with greater corrosion protection. R p climbed from 5.0 × 10 4 ohm cm 2 to 2.1 × 10 6 ohm cm 2 , whereas C dl markedly decreased over time (Fig. 6b and Supplementary Fig. 10b). The alkaline pH condition facilitates the generation of a more robust cerium film on the AA2024-T3 surface, so R p did not suffer a decrease with longer immersion. Considering pH 7, the nanofiber was in a closed state owing to the moderate electrostatic interactions between the chitosan and PAA, so a low amount of Ce(NO 3 ) 3 could be released, resulting in less visible changes in R p and C dl (Fig. 6c and Supplementary Fig.  10c). In general, incorporating Ce(NO 3 ) 3 -loaded nanofibers into the PVB coating matrix can improve the corrosion inhibition efficacy, while enclosing empty polyelectrolyte coacervate nanofibers does not significantly increase the corrosion resistance of AA2024-T3.

EIS measurements in NaCl solutions
To further evaluate the resistance of Fiber-PVB and Ce-Fiber-PVB against corrosion, EIS spectra were also recorded in 100 mM NaCl at different immersion times, and the results are displayed in Fig.  7. As a reference, PVB samples were also prepared by sequentially dip-coating four individual layers of PVB on the AA2024-T3 substrate. The resulting coatings were tested by EIS under the same condition. As shown in Fig. 7a, the introduction of nanofibers into the coating matrix did not negatively affect the barrier property, which is evident by the fact that the lowfrequency impedance was similar to that of PVB at the beginning of EIS measurements (Fig. 7c). This is not the case when the coated samples were prepared by a bar-coating method ( Supplementary  Fig. 11). During the dip-coating process, a dilute PVB solution was used, which is more likely to diffuse into the nanofiber mat and seal the interfibrous pores. Moreover, the dilute PVB solution can lower the risk of generating artifacts that are often found by using the sticky and concentrated PVB solution during the bar-coating process. Accordingly, the resulting coated sample had fewer defects, and the embedded nanofibers did not substantially affect the barrier property of the coating matrix. However, the deterioration of the coating seems to be accelerated by the embedded nanofibers, which is supported by the larger decrease in |Z | 0.01Hz of Fiber-PVB over time compared to that of the PVB sample ( Supplementary Fig. 12). This is due to the destruction of the nanofibers with the presence of aggressive salt ions and local pH alteration during the immersion. Also, the nanofibers undesirably enhance the hydrophilicity of the coating, so the water ingress is speeded up. Since the electrolyte is easier to breach the coating, corrosion occurs more readily on the metal substrate. Unlike Fiber-PVB, Ce-Fiber-PVB showed promising corrosion resistance. In the Bode phase plot, only one time constant is observed, which is related to the coating property. The capacitive region extends towards the lower frequency over time, indicating high corrosion resistance of Ce-Fiber-PVB sample throughout the immersion (Fig. 7b). The EIS spectra acquired from Fiber-PVB and Ce-Fiber-PVB were also fitted by using the equivalent circuits with two time constants and one time constant, respectively ( Supplementary Fig. 8). Only R pore and C coat of these two coating samples were investigated as Ce-Fiber-PVB had just one time constant characterizing the coating property, and the results are illuminated in Fig. 8 and Supplementary Fig. 13. For Fiber-PVB, R pore steadily reduced from 3.4 × 10 5 ohm cm 2 to 2.0 × 10 3 ohm cm 2 , on account of the solution absorption and the rupture of nanofibers. In the replicate EIS test, R pore slightly increased when the immersion time was longer than 25 h (Fig. 8), which was possibly related to the poor protection from corrosion products. Nonetheless, it is safe to conclude that Fiber-PVB coating did not provide a sufficient degree of protection toward the AA2024-T3 substrate. On the other hand, an increase in R pore of Ce-Fiber-PVB was shown because of additional corrosion protection of Ce(NO 3 ) 3 stored in the nanofibers. Additionally, C coat of Ce-Fiber-PVB remained at around 1 × 10 −9 F cm −2 and was always lower than that of Fiber-PVB during the immersion period ( Supplementary Fig. 13). This again proves that the addition of Ce (NO 3 ) 3 -loaded nanofibers can accomplish satisfying corrosion protection performance. Although changes in the coating thickness or structure inner part of the coating after EIS tests were not inspected, based on the SEM images of the surface morphology of the nanofibers after a release study (Fig. 2b), it does appear that the nanofibers were destoyed to some extent and released the entrapped Ce(NO 3 ) 3 during corrosion of AA2024-T3. Hence, the released Ce(NO 3 ) 3 enhanced the corrosion resistance of the metal substrate.
Scribe protection by Ce(NO 3 ) 3 -loaded nanofibers EIS measurements were conducted and the variation of |Z | 0.01Hz with time was documented to inspect the scribe protection of the sample with Ce(NO 3 ) 3 -loaded nanofibers. In comparison, the coating system containing Ce(NO 3 ) 3 -loaded microspheres was also fabricated and tested under the same condition. To assure that a similar amount of corrosion inhibitors was encapsulated within the microspheres or the nanofibers, the time for the electrospray or electrospinning process was the same. The nanofibers or microspheres were then introduced into an epoxy coating rather than a PVB coating because the epoxy coating has a superior physical barrier property and long durability. Therefore, it is assumed that the resulting coating will prevent the penetration of electrolyte and fully isolate the underlying metal substrate from the corrosive environment during 2 days of immersion if no damage is made in the coating on purpose. When an artificial scratch was made in the coating to expose the shiny metal substrate underneath, corrosion is presumed to happen in that damaged area with no corrosion in areas where the coating is not scratched. As shown in Fig. 9a, a relatively high |Z | 0.01Hz value of approximately 8.0 × 10 5 ohm was measured on the freshly scribed sample with Ce(NO 3 ) 3 -loaded microspheres, probably due to the accumulation of coating debris or corrosion products on the metal surface. The |Z | 0.01Hz value remarkably declined to 1.3 × 10 5 ohm after 1.5 h, indicating corrosion of AA2024-T3. Then, the bare metal substrate was protected by the released Ce(NO 3 ) 3 from the microspheres located in this defect area, so |Z | 0.01Hz recovered to 6.0 × 10 5 ohm. However, Ce(NO 3 ) 3 in this area was not abundant to offer the substrate protection against the continuous corrosion attack, thus the |Z | 0.01Hz decreased after 3.5 h. Subsequently, a fresh scratch was made again at the same defective region to expose the underlying metal substrate after 18 h of immersion. After the second scribe was made, the corrosion resistance of the coated sample reduced and never covered again. This is likely because Ce(NO 3 ) 3 is quickly consumed during the first corrosion process, and corrosion inhibitors preserved in other locations of the coating cannot migrate fast enough to heal the defective zone when corrosion recurs. The same issue has been reported by numerous studies, which is generally described as limited chemical throwing power of corrosion inhibitors 68,69 A similar result was seen in the replicate test ( Supplementary Fig. 14a), where the corrosion protection could only last for a few hours. On the other hand, |Z | 0.01Hz progressively increased from 5.0 × 10 5 ohm to 2.4 × 10 6 ohm during the first 18 h immersion for the coating sample with Ce (NO 3 ) 3 -loaded nanofibers. Although |Z | 0.01Hz exhibited a sudden drop to 4.0×10 4 ohm at around 12 h immersion due to the reoccurrence of corrosion, it went back to a value above 2.1 × 10 6 ohm after this stage. When the coating was scratched again to uncover the metal substrate, |Z | 0.01Hz continued to increase and   (Fig. 9b). This repeatedly healing phenomenon is also observed in the replicated EIS test (Supplementary Fig. 14b). All these results suggest that the substrate could be continuously healed by the released corrosion inhibitors from the nanofibers. Unlike the inhibitor-loaded microspheres, the nanofibers can serve as a pathway for the inhibitors to be transported from other locations to the corrosion-active region, therefore, adequate corrosion inhibitors can form a stable film to prevent the re-occurrence of corrosion. This difference shown in Fig. 9a, b clearly demonstrates the effectiveness and benefit of using a fibrous delivery system to attain a repeated healing ability for long-term corrosion protection of AA2024-T3.

METHODS Materials
Chitosan (with a medium molecular weight and deacetylation degree of 75-85%), PAA (M v = 450,000 g mol −1 ), and rhodamine B base were purchased from Sigma-Aldrich. Formic acid, Hoechst 33258 pentahydrate, and cerium(III) nitrate hexahydrate were obtained from Fisher Scientific. PVB was ordered from Pfaltz & Bauer, and acetic acid glacial was purchased from Mallinkrodt AR. All aqueous solutions were made using deionized (DI) water with a resistivity of 18.2 MΩ • cm from a Milli-Q filtration system. Aluminum alloy 2024-T3 substrates were abraded using SiC papers from 240 up to 1200 grit with ethanol as a lubricant.
Preparation of organic dye-loaded coatings Chitosan 1.5 wt% and 12 wt% PAA solutions were prepared in 60% aqueous formic acid and 90% aqueous acetic acid, respectively, following approaches described in the literature 28 . Both chitosan and PAA solutions were continuously stirred overnight at 50°C, and then the chitosan/PAA coacervate was prepared by adding the PAA solution into the chitosan solution dropwise while stirring until achieving a chitosan:PAA volume ratio of 2:1. To prepare organic dye-loaded coating samples, a glass slide was first dip-coated with one layer of chitosan/PAA polyelectrolyte coacervate, followed by immersion in BB solution three times with ethanol as the solvent. The subsequent deposition of five layers of the chitosan/ PAA coacervate was performed by immersing the glass slide into the coacervate solution five times for a complete enclosure of organic dye ( Supplementary Fig. 15a). The duration for each immersion step was 10 s. The resulting organic dye-loaded coated sample was denoted as (BB) 3 / (chitosan/PAA) 5 .

Release study of BB and surface morphology of coatings
To investigate the release behavior of BB from the chitosan/PAA coacervate, (BB) 3 /(chitosan/PAA) 5 coated glass slides (40 × 25 mm) were immersed in 10 mL of DI water for 24 h. The pH of DI water was adjusted by 0.1 M H 2 SO 4 or NaOH to pH 2.5, 7, or 10. After 24 h of immersion, the released media were collected, and the color of the released media was recorded by optical photography. To study the surface morphology of coatings, only five layers of the chitosan/PAA coacervate were dip-coated on silicon wafers that were then immersed in DI water with various pH (i.e. pH 2.5, 7, and 10) for 24 h. The morphology of the coatings before and after immersion was examined by optical microscopy.

Fabrication of Ce(NO 3 ) 3 -loaded nanofibers
The Ce(NO 3 ) 3 -loaded nanofibers were obtained by a coaxial electrospinning technique ( Supplementary Fig. 15b). The chitosan/PAA coacervate solution and 0.5 M Ce(NO 3 ) 3 dissolved in acetone were used as the shell and core liquids, respectively. The solutions were fed through a coaxial nozzle consisting of two concentrically arranged needles. A potential of 15 kV was applied on the tip of the nozzle. The nozzle-to-collector distance was 20 cm. The diameters of the inner and outer needles were 0.64 and 1.02 mm, respectively. The injection rates of the core and shell solutions were 0.2 and 1.0 mL/h, respectively. The Ce(NO 3 ) 3 -loaded nanofibers were collected on a grounded plate and then dried in an oven at 100°C for 1 h to eliminate the residual solvents. As reported previously, the change of electrospinning parameters, e.g., the applied potential, the injection rate, and humidity, may determine the properties of as-spun nanofibers [70][71][72] . However, optimization of the properties of nanofibers by adjusting the operating parameters was not performed in this study

Characterization of Ce(NO 3 ) 3 -loaded nanofibers
The morphology and composition of the Ce(NO 3 ) 3 -loaded nanofibers were examined by a ThermoFisher Apreo Field Emission SEM equipped with an EDAX Octane Elect Plus EDS detector under an acceleration voltage of 5 kV. SEM was performed in Mode 2 (Optiplan) using the standard Everhart Thornley Detector (ETD), whereas EDS was conducted in a point analysis mode. To reveal the core-shell structure of the nanofibers, confocal spectroscopy (Olympus FV1000 Filter Confocal System) and TEM (FEI Tecnai G2 Biotwin System) were utilized. To achieve fluorescent signals for confocal spectroscopic analysis, the shell solution with Hoechst 33258 pentahydrate and the core solution with rhodamine B base were simultaneously electrospun during the electrospinning process, and the as-spun nanofibers were collected on a glass slide. Subsequently, the coreshell structure was inspected by confocal spectroscopy with a laser excitation wavelength of 544 nm for rhodamine B base and 355 nm for Hoechst 33258 pentahydrate, respectively. For TEM observation, the asspun nanofibers were directly deposited onto a 200-mesh carbon-coated Cu grid and then examined by TEM to discriminate the core and shell regions of the nanofibers.

Release study of Ce(III) from Ce(NO 3 ) 3 -loaded nanofibers
The release of Ce(III) from Ce(NO 3 ) 3 -loaded nanofibers was assessed by measuring the amount of released Ce(III) at specific time intervals with UVvis spectroscopy at λ max = 250 nm 9,73,74 . Typically, Ce(NO 3 ) 3 -loaded nanofibers were electrospun on glass slides for 1 h. The nanofibers coated glass slides were then immersed in 10 mL of DI water with pH 2.5, 7, or 10, adjusted by 0.1 M H 2 SO 4 or NaOH solutions. At each sampling time, a 4 mL aliquot was extracted from the release medium for UV-vis analysis and replaced with an equivalent volume of fresh DI water with the same pH. The amount of released Ce(III) in the withdrawn solution was extrapolated from a calibration curve and the cumulative concentration of released Ce (III) was plotted as a function of time. For the release study at each pH condition, three independent measurements were performed to ensure reproducibility. The effect of nanofibers on the integrity of coatings Two coating formulas derived from embedding Ce(NO 3 ) 3 -loaded nanofibers or Ce(NO 3 ) 3 -loaded microspheres in a PVB coating matrix were used to evaluate the influence of the additive on the protective property of the coating matrix. The fabrication procedure of electrospun Ce(NO 3 ) 3 -loaded nanofibers is presented above, while the fabrication of Ce(NO 3 ) 3 -loaded microspheres by a coaxial electrospray method is documented in our previous publication. The size of the resulting microspheres was within 10 μm. To introduce Ce(NO 3 ) 3 -loaded nanofibers or microspheres into the PVB coating matrix, the nanofibers or microspheres were directly deposited onto PVB bar-coated AA2024-T3 substrates during the electrospinning or the electrospraying process. Then another 3 layers of PVB were bar-coated to fully cover the nanofibers or the microspheres. The coated samples with a sandwich structure were obtained and subjected to EIS measurements in 100 mM NaCl with a neutral pH. The EIS tests were carried out using a Gamry TM Reference 600 potentiostat with a frequency range of 10 5 Hz to 0.01 Hz. A three-electrode cell was used, consisting of a saturated calomel reference electrode (SCE), a platinum mesh counter electrode, and the coated substrate as a working electrode with an exposed area of 1 cm 2 . After allowing the open circuit potential (OCP) to stabilize for 1 h, EIS spectra were recorded at the OCP with a 10 mV sinusoidal perturbation. However, most coating samples in this work were prepared by a dip-coating method, which is described in the following section. To conserve space, the resulting EIS data ( Supplementary Fig. 11) and the corresponding discussion (see Supplementary Discussion) are provided in the Supplementary Materials.

Surface morphology of pH-sensitive coatings and EIS tests
pH-sensitive coatings were prepared using a manually dip-coating method and the substrate was vertically withdrawn from the coating solution at a speed of around 40 mm/s. Briefly, an AA2024-T3 substrate was firstly immersed in 1.25 wt% PVB ethanol solution for 10 s and then used as a collector to gather Ce(NO 3 ) 3 -loaded nanofibers during the electrospinning process for 1 h. After drying the nanofibers in the oven at 100°C for 1 h, the sample was immersed in PVB for 10 s three times to deposit three layers of PVB on top of the nanofibers. The resulted coating was denoted as Ce-Fiber-PVB. As a reference, nanofibers without Ce(NO 3 ) 3 were prepared by electrospinning the chitosan/PAA coacervate solution and acetone as the shell and core liquids, respectively. Then the inhibitor-free nanofibers were incorporated into the PVB coating with the same procedure, and the coating was named Fiber-PVB. The surface morphology of both coating samples was explored by SEM. Moreover, four individual layers of PVB were sequentially dip-coated on AA2024-T3 and the surface morphology was recorded by SEM as a control. The thickness of Ce-Fiber-PVB, Fiber-PVB, and PVB was measured by a micrometer. To inspect the protectiveness of Ce-Fiber-PVB and Fiber-PVB, EIS measurements were conducted on these coated samples after acquiring the OCP for 1 h in two sets of electrolyte solutions: 100 mM NaCl with neutral pH and 5 mM Na 2 SO 4 with pH 2.5, 7, or 10 adjusted by 0.1 M H 2 SO 4 or NaOH. 100 mM NaCl solution was used to investigate the corrosion protection performance of coated samples in a corrosive environment, whereas Na 2 SO 4 with various pH was chosen to evaluate the protective ability of coating samples under environments undergoing anodic and cathodic reactions during metal corrosion.

Scribe protection of coating with nanofibers
To investigate if the Ce(NO 3 ) 3 -loaded nanofibers can protect the metal substrate against corrosion repeatedly, the electrospun nanofibers were deposited on an AA2024-T3 substrate bar-coated with a single layer of PVB, followed by being fully dried in an oven at 100°C for 1 h. Epoxy resin (EpoThin TM 2 No. 20-3440) and hardener (EpoThin TM 2 No. 20-3442) with a mass ratio of 100:45 were mixed, and the mixture was applied on top of the nanofibers with a brush. After being cured overnight at room temperature, a typical coating sample was obtained. An artificial scratch with a length of 1 cm was created on the coating by a diamond scriber and thus the underlying metal substrate was exposed. The diameter of the diamond tip is approximately 0.5 mm. Subsequently, the sample was immersed in 100 mM NaCl with a neutral pH, and the impedance was repeatedly measured for 18 h. The volume of NaCl solution was approximately 70 mL. Before each EIS measurement, the OCP was stabilized for 30 min. After 18 h of immersion, the coating samples were removed from the solution, and the same location was re-scribed to re-expose the bare metal. Then the scratched coating samples were immersed in 100 mM NaCl solution again for the following EIS tests. In comparison, another coated sample based on the encapsulation of Ce(NO 3 ) 3 -loaded microspheres was prepared and tested in the same way to assess its repeated self-healing performance. The fabrication of Ce(NO 3 ) 3 -loaded microspheres was described in the previous work 75 .