A new fungal nonribosomal peptide-polyketide hybrid synthase, namely CogA, was discovered by genome mining from fungus Cordyceps gunnii. Its ability to synthesize 4-hydroxyl 2-pyrrolidinone alkaloid (1) via nonenzyme-catalyzed N-1-C-2 closure was confirmed by heterologous expression of it in Aspergillus nidulans. Further engineered biosynthesis of the fluoro-substituted 2-pyrrolidinone alkaloid analogues (4 and 5) has also been achieved in vivo. © 2022 Elsevier Ltd