Selection pressure exerted by insects and microorganisms shapes the diversity of plant secondary metabolites. We identified a metabolic pathway for glucosinolates, known insect deterrents, that differs from the pathway activated by chewing insects. This pathway is active in living plant cells, may contribute to glucosinolate turnover, and has been recruited for broad-spectrum antifungal defense responses. The Arabidopsis CYP81F2 gene encodes a P450 monooxygenase that is essential for the pathogen-induced accumulation of 4-methoxyindol-3-ylmethylglucosinolate, which in turn is activated by the atypical PEN2 myrosinase (a type of beta-thioglucoside glucohydrolase) for antifungal defense. We propose that reiterated enzymatic cycles, controlling the generation of toxic molecules and their detoxification, enable the recruitment of glucosinolates in defense responses.