The invention discloses an environment-friendly, long-acting, high-performance antirust cleaning agent for metals, which comprises the following raw materials in parts by weight: 8-12 parts of phosphate, 7-9 parts of borate, 1-2 parts of modified diatomite, 0.5-1.5 parts of triethanolamine, 1-3 parts of sodium salt, 0.5-0.9 parts of surfactant, 2-3 parts of polyvinyl alcohol, 1-3 parts of liquefied paraffin, 1-2 parts of silicone oil, diethylene glycol monobutyl 3‑5 parts of ether, 2‑4 parts of sorbitan monooleate, 9‑13 parts of vegetable oil, 10‑14 parts of propylene glycol, and 90‑110 parts of water. The invention has excellent contact anti-rust performance and good gas-phase anti-rust effect, and is suitable for salt spray environment, hot and humid environment or occasions requiring long-term anti-rust, and can be used for carbon steel, cast iron, alloy steel, galvanized sheet, copper and aluminum Long-term and ultra-long-term rust prevention of various metals such as low-corrosion-resistant stainless steel, as well as storage and rust prevention in harsh environments such as ocean transportation and humid heat.