Medicinal plants are a prolific source of natural products with remarkable chemical and biological properties, many of which have considerable remedial benefits. Numerous medicinal plants are suffering from wildcrafting, and thus biotechnological production processes of their natural products are urgently needed. The plant Aster tataricus is widely used in traditional Chinese medicine and contains unique active ingredients named astins. These are macrocyclic peptides showing promising antitumor activities and usually containing the highly unusual moiety 3,4-dichloroproline. The biosynthetic origins of astins are unknown despite being studied for decades. Here we show that astins are produced by the recently discovered fungal endophyte Cyanodermella asteris. We were able to produce astins in reasonable and reproducible amounts using axenic cultures of the endophyte. We identified the biosynthetic gene cluster responsible for astin biosynthesis in the genome of C. asteris and propose a production pathway that is based on a nonribosomal peptide synthetase. Striking differences in the production profiles of endophyte and host plant imply a symbiotic cross-species biosynthesis pathway for astin C derivatives, in which plant enzymes or plant signals are required to trigger the synthesis of plant-exclusive variants such as astin A. Our findings lay the foundation for the sustainable biotechnological production of astins independent from aster plants.