Ramulus Mori alkaloids, also known as SangZhi alkaloids (SZ-A), is a natural medicine used for the treatment of type 2 diabetes mellitus in China. SZ-A is extracted from Morus alba L., which grows in the natural environment and may be contaminated by heavy metals and harmful elements. These contaminants can enter SZ-A products during the extraction of M. alba, thereby posing a threat to patient health. Therefore, it is necessary to formulate scientific and reasonable limits to ensure patient safety. For this purpose, in this study, we used the extraction process of SZ-A as the object of investigation and determined the content of five harmful elements: Cd, Pb, As, Hg, and Cu in the herb raw material, SZ-A product, and its intermediates obtained in different extraction steps. Next, the transfer rate of harmful elements in the extraction process was used as an indicator to evaluate the ability of different operations to remove harmful elements. Subsequently, the health risks of heavy metals and harmful elements in SZ-A were assessed. Our results demonstrated that M. alba has little risk of contamination by Hg. The cation and anion resin refining processes are the best effective method to remove Cd, Pb, and Cu from the products. However, As is not easily eliminated during the water extraction. There is as much as 87% of As transferred from the herb raw material to the water-extracted intermediate, while Cd, Pb, and Cu are rarely transferred (6% to 17%) under the same conditions. Overall, the results indicate that the regulatory standard limits for Cd, Pb, As, Hg, and Cu contained in natural medicine Ramulus Mori alkaloids are set to 1, 5, 2, 0.2, and 20 μg/g, respectively, which is the most scientific and it can guarantee the safety of patients.