Plants protect themselves against herbivory with a diverse array of repellent or toxic secondary metabolites. However, many herbivorous insects have developed counteradaptations that enable them to feed on chemically defended plants without apparent negative effects. Here, we present evidence that larvae of the specialist insect, Pieris rapae (cabbage white butterfly, Lepidoptera: Pieridae), are biochemically adapted to the glucosinolate-myrosinase system, the major chemical defense of their host plants. The defensive function of the glucosinolate-myrosinase system results from the toxic isothiocyanates that are released when glucosinolates are hydrolyzed by myrosinases on tissue disruption. We show that the hydrolysis reaction is redirected toward the formation of nitriles instead of isothiocyanates if plant material is ingested by P. rapae larvae, and that the nitriles are excreted with the feces. The ability to form nitriles is due to a larval gut protein, designated nitrile-specifier protein, that by itself has no hydrolytic activity on glucosinolates and that is unrelated to any functionally characterized protein. Nitrile-specifier protein appears to be the key biochemical counteradaptation that allows P. rapae to feed with impunity on plants containing glucosinolates and myrosinases. This finding sheds light on the ecology and evolution of plant-insect interactions and suggests novel highly selective pest management strategies.