The accumulation of heavy metals like cadmium (Cd) and metalloids like arsenic (As) in plants can do harm to human health through the food chain, especially through the rice (Oryza sativa L.). To solve this problem, this study researched the application of magnesium slag (MS) and polyaspartic acid (PASP), which could accelerate rice growth and improve yield, increase soil pH and activate rice enzyme activity as well as reduce the bioavailability of Cd and As in the soil. After these two different treatments, rice yield increased by 17.0% and 18.9%, respectively. Meanwhile, the bioavailable As decreased by 49.1% and 42.5%, while the bioavailable Cd reduced by 72.6% and 44.3%. Besides, the Cd content in rice grains reduced by 77.7% and 17.3%, respectively, after two different treatments. In the MS treatment, the As content in rice grains was reduced by 21.8%, but showed no significant response to the other treatment. The contents of bioavailable Cd and As (determined by one‐step extraction) in soil were decreased by MS and PASP, which was favourable for the reduction of Cd and As accumulation in rice. The health risk assessment showed that the application of passivators can effectively reduce the risk of carcinogenesis, but it was still unacceptable. The application dose of MS and PASP still needs further exploration.