A study of an insect prenyltransferase demonstrates that the product specificity of this bifunctional enzyme can be regulated by the presence of different divalent metal cofactors, resulting, for example, in the production of the precursors for either insect defense compounds or developmental hormones.