Aluminum and magnesium are prone to surface corrosion (dark stains) when exposed to alkaline conditions. Surface active phosphorus and other chemistries have been employed in the industry to passivate these surfaces and prevent staining. Phosphonate and phosphate chemistries have been shown to be effective to control surface corrosion. The current work explores alkyl phosphates and how structure impacts the efficacy of the corrosion inhibition. Corrosion inhibition is related not only to the ability of the phosphate to interact with the nonferrous surface but also to the solubility of the additive in the formulation. Magnesium machining processes are further complicated by hydrogen evolution from the reaction of magnesium and high alkalinity water. The prevention of hydrogen evolution was also investigated. Performance was measured relative to industry phosphate and phosphonate controls.