A corrosion inhibitor, and metal workpiece and anti-corrosion treatment method thereof. The corrosion inhibitor comprises the following components in parts by weight: 20-40 parts of a disodium phosphate; 50-100 parts of an inositol hexaphosphate; 20-40 parts of a trisodium phosphate; 10-20 parts of a citric acid; and 30-50 parts of a triethanolamine. The corrosion inhibitor can form a compact and polarized protective coating, thereby fundamentally eliminating a phenomenon of crystallization caused by using a sodium nitrite solution. The corrosion inhibitor also provides resistance against mold and corrosion, is safer to use, and can be widely applied in an anti-corrosion treatment for precision machining work surfaces of various dies, instruments, and components. The inhibitor can also be used in anti-corrosion treatment for a pre-coating treatment step, and can preserve an original hue of a metal.