Host plant specialization is a major force driving ecological niche partitioning and diversification in insect herbivores. The cyanogenic defences of
Passiflora
plants keep most herbivores at bay, but not the larvae of
Heliconiu
s butterflies, which can both sequester and biosynthesize cyanogenic compounds. Here, we demonstrate that both
Heliconius cydno chioneus
and
H. melpomene rosina
have remarkable plasticity in their chemical defences. When feeding on
Passiflora
species with cyanogenic compounds that they can readily sequester, both species downregulate the biosynthesis of these compounds. By contrast, when fed on
Passiflora
plants that do not contain cyanogenic glucosides that can be sequestered, both species increase biosynthesis. This biochemical plasticity comes at a fitness cost for the more specialist
H. m. rosina
, as adult size and weight for this species negatively correlate with biosynthesis levels, but not for the more generalist
H. c. chioneus
. By contrast,
H. m rosina
has increased performance when sequestration is possible on its specialized host plant. In summary, phenotypic plasticity in biochemical responses to different host plants offers these butterflies the ability to widen their range of potential hosts within the
Passiflora
genus, while maintaining their chemical defences.