Plants have evolved an extensive repertoire of specialized metabolites to adapt to complex environmental changes. Here, we identify two paralogous dirigent proteins (DPs) in cotton that serve as gatekeepers of extracellular terpenoid phytoalexin production in green organs, directing the transition of hemigossypol away from gossypol synthesis toward a hydroxylation pathway that leads to the biosynthesis of highly toxic hemigossypolone and heliocides. Under oxidative conditions, these proteins function synergistically with aldo-keto reductases to catalyze the hydroxylation of hemigossypol, followed by spontaneous oxidation that yields hemigossypolone, revealing a noncanonical role for aldo-keto reductases in extracellular terpenoid metabolism. Notably, mutants lacking these dirigent proteins produce gossypol but are devoid of hemigossypolone and heliocides in green organs exhibit heightened susceptibility to multiple biotic stresses, underscoring the enhanced protective role of these metabolites. This study describes a DPs-mediated mechanism of extracellular hydroxylation and highlights the potential ecological advantages of redirecting specialized metabolism extracellularly for enhanced defense against varying types of pathogens and herbivores.