We have identified the biosynthetic gene cluster (hvm) for the sterol O-acyltransferase inhibitor helvamide (1) from the genome of Aspergillus rugulosus MST-FP2007. Heterologous expression of hvm in A. nidulans produced a previously unreported analog helvamide B (5). An α-ketoglutarate-dependent oxygenase Hvm1 was shown to catalyze intramolecular cyclization of 1 to yield 5. The biosynthetic branch to the related hancockiamides and helvamides was found to be controlled by the substrate selectivity of monomodular nonribosomal peptide synthetases.