Thousands of putative biosynthetic genes in Arabidopsis thaliana have no known function, which suggests that there are numerous molecules contributing to plant fitness that have not yet been discovered. Prime among these uncharacterized genes are cytochromes P450 upregulated in response to pathogens. Here we start with a single pathogen-induced P450 (ref. 5), CYP82C2, and use a combination of untargeted metabolomics and coexpression analysis to uncover the complete biosynthetic pathway to 4-hydroxyindole-3-carbonyl nitrile (4-OH-ICN), a previously unknown Arabidopsis metabolite. This metabolite harbours cyanogenic functionality that is unprecedented in plants and exceedingly rare in nature; furthermore, the aryl cyanohydrin intermediate in the 4-OH-ICN pathway reveals a latent capacity for cyanogenic glucoside biosynthesis in Arabidopsis. By expressing 4-OH-ICN biosynthetic enzymes in Saccharomyces cerevisiae and Nicotiana benthamiana, we reconstitute the complete pathway in vitro and in vivo and validate the functions of its enzymes. Arabidopsis 4-OH-ICN pathway mutants show increased susceptibility to the bacterial pathogen Pseudomonas syringae, consistent with a role in inducible pathogen defence. Arabidopsis has been the pre-eminent model system for studying the role of small molecules in plant innate immunity; our results uncover a new branch of indole metabolism distinct from the canonical camalexin pathway, and support a role for this pathway in the Arabidopsis defence response. These results establish a more complete framework for understanding how the model plant Arabidopsis uses small molecules in pathogen defence.