Four kinds of bioprotective alkaloids-peramine, loline, ergot alkaloid, indole-diterpenes, produced by grass-fungal endophyte symbioses, are deterrents or toxic to vertebrate and invertebrate herbivores. Ergot alkaloids have pharmacological properties and widely are used clinically. The regulation of alkaloids biosynthesis is under intensive study to improve the yield for better agricultural and medicinal application. In this paper, we summarize the structure, related genes, regulation, and toxicity of alkaloids. We focus on the biosynthesis and the regulation network of alkaloids.