A new composite film (named as PSPF) was prepared by depositing layers of plasma electrolysis oxidation (PEO) film, self-assembled nanoparticle containing phytic acid film and fluorocarbon paint on a Mg–Gd–Y alloy. The effect of phytic acid on the corrosion inhibition property of the PSPF film was investigated by various analytical instruments and methods. Based on the results, the PSPF film showed enhanced barrier properties and that could be used to provide good protection against corrosion. In addition, the strong adhesion properties of the PSPF film was another important attribute for promising long-term service performance in a corrosive neutral salt environment.