Halloysite particles are aluminum-silicate hollow cylinders with a length of 0.5–1 µm, an outer diameter of ca. 50 nm and a lumen of 15 nm. These nanotubes are used for loading and sustained release of corrosion inhibitors. The inhibitor is kept inside the particles infinitely long under dry conditions. Here, halloysite nanotubes filled with anticorrosive agents are embedded into a SiOx–ZrOx hybrid film. An aluminum plate is dip-coated and immersed into 0.1 M sodium chloride aqueous solution for corrosion tests. A defect in the sol–gel coating induces pitting corrosion on the metal accompanied by a strong anodic activity. The inhibitor is released within one hour from halloysite nanotubes at corrosion spots and suppresses the corrosion process. The anodic activity is successfully restrained and the protection remains for a long time period of immersion in NaCl water solution. The self-healing effect of the sol–gel coating doped with inhibitor-loaded halloysite nanotubes is demonstrated in situ via scanning vibrating electrode technique measurements.