Cordyceps javanica has been registered as a fungal insecticide in several countries. However, little is known about whether metabolic toxins are involved in the insecticidal process. In this research, we assessed the insecticidal activity of the fermentation broth of C. javanica. Myzus persicae mortality differed when exposed to the metabolized C. javanica broths at 3 days post fermentation (DPF) and 5 DPF. Comparison of the metabolic fluid at 3 DPF and 5 DPF revealed a key alkaloid, heteratisine, which was found to have insecticidal activity and acetylcholinesterase (AChE) inhibitory activity. Heteratisine has high insecticidal activity against adult M. persicae, the absolute 50% lethal concentration (LC50) was only 0.2272 mg/L. Heteratisine showed high inhibitory activity on AChE with the 50% maximal inhibitory concentration (IC50) of 76.69 μM. Molecular docking and dynamic simulations showed that heteratisine conjugation occurs at the peripheral anionic site (PAS) of the AChE of M. persicae, leading to suppression of enzyme activity. Heteratisine was rarely found in fungal metabolites, which helps us to understand the complex and elaborate insecticidal mechanism of C. javanica.