Allomones are widely used by insects to impede predation. Frequently these chemical stimuli are released from specialized glands. The larvae of Chrysomelina leaf beetles produce allomones in gland reservoirs into which the required precursors and also the enzymes are secreted from attached gland cells. Hence, the reservoirs can be considered as closed bio-reactors for producing defensive secretions. We used RNA interference (RNAi) to analyse in vivo functions of proteins in biosynthetic pathways occurring in insect secretions. After a salicyl alcohol oxidase was silenced in juveniles of the poplar leaf beetles, Chrysomela populi, the precursor salicyl alcohol increased to 98 per cent, while salicyl aldehyde was reduced to 2 per cent within 5 days. By analogy, we have silenced a novel protein annotated as a member of the juvenile hormone-binding protein superfamily in the juvenile defensive glands of the related mustard leaf beetle, Phaedon cochleariae. The protein is associated with the cyclization of 8-oxogeranial to iridoids (methylcyclopentanoid monoterpenes) in the larval exudates made clear by the accumulation of the acylic precursor 5 days after RNAi triggering. A similar cyclization reaction produces the secologanin part of indole alkaloids in plants.