Introduction

The larvae and adults of the Colorado potato beetle Leptinotarsa decemlineata depend on aposematic coloration, as an orange larva with black spots around the spiracles, and as a yellow-orange adult with ten black stripes on a pair of elytra1, to advertise antipredator defenses2,3. Although a number of efforts have been made to identify the defending toxic substances in L. decemlineata larval and adult secretions4,5,6,7, the chemical components of the aposematic volatile repelling predator2,3 remain unknown. L. decemlineata larvae can actively release benzaldehyde8, a breakdown product of mandelonitrile9 which is a metabolite of aromatic cyanoglucosides prunasin and amygdalin10. Similarly, several Coleopteran species employ aromatic cyanoglucoside defenders against natural enemies11,12,13,14. Accordingly, we intended to test a hypothesis here that the aposematic antipredator defender was mandelonitrile in L. decemlineata.

Results

The beetle can actively release HCN by degradation of nitriles

To mimic bird attacks, a vortex mixer was used to shake a vial-confined larva or adult. We observed that the larvae and adults ejected sticky secretions when shaken, in contrast to the pupae living in underground pupation chambers15. When the shaken larvae and adults were disturbed again an hour later, little sticky secretions were emitted. The secretion eluents from shaken larvae and adults, but not pupae, contained abundant cyano-compounds, indicating by considerable amounts of hydrogen cyanide (HCN) extracted by NaOH solution (Fig. 1a). Moreover, a greater quantity of NaOH-extracted HCN was determined from the pupation chamber-built soil, but not from adjacent soil (Fig. 1a).

Fig. 1: Leptinotarsa decemlineata larvae and adults actively emit hydrogen cyanide mainly from mandelonitrile.
figure 1

a Amounts of hydrogen cyanide (HCN) in NaOH solution (NaOH), and NaOH solution used to wash the larval (Larva), pupal (Pupa) and adult (Adult) surfaces, or to immerse pupation chambers (PC) and adjacent soil (AS) (n = 3). b, c HCN contents in the volatiles collected via static solid-phase microextraction (SPME) (n = 5). Con, a glass jar without beetles; Motionless, motionless beetles; Shaken, disturbed samples. d-g HCN quantities in the NaOH solution extracted from whole bodies (n = 3) or different tissues from larvae (cuticle, CU; gut, GU; fat body, FB; hemolymph, HL; muscle, MU), adults (cuticle, CU; elytrum, EL; hind wing, HW; gut, GU; fat body, FB; hemolymph, HL; muscle, MU), cuticles of larvae (LC), pupae (PC) and adults (AC), and exuviae of final instar larvae (EX) (ne,f = 3, ng = 9LC, 9PC, 8AC, 6EX). h, i Content of amygdalin from homogenates of larvae, pupae or adults; or of pupal cuticle and other tissues (n = 3). For a-i, data are mean ± SD. Statistical analysis in Fig.1 through Fig. 4 was performed using one-way analysis of variance with the Tukey-Kramer test, or an unpaired Student’s t-test. *P < 0.05, **P < 0.01 and ***P < 0.001 indicate significant difference; NS indicates no significant. F(a-NaOH/larva/pupa/adult) = 44.822, P(a-NaOH/larva/pupa/adult) = 2.39 × 10−5. F(a-AS/PC) =  145.074, P(a-AS/PC) =  2.72 × 10−4. F(b) = 533.856, P(b) = 1.88 × 10−12. F(c)  =  104.451, P(c) = 2.57 × 10−8. F(d) = 21.878, P(d) = 1.75 × 10−3. F(e) = 222.13, P(e) = 1.02 × 10−9. F(f) = 150.972, P(f) = 6.63 × 10−12. F(g) = 128.887, P(g) = 1.72 × 10−16. F(h)= 77.138, P(h) = 5.25 × 10−5. F(i) = 23135.483, P(i)= 1.12 × 10−8. Source data are provided as a Source Data file.

HCN, a breakdown product of mandelonitrile9, was measured in the headspace volatiles emitted by L. decemlineata confined in a glass jar16. Motionless larvae and adults actively released HCN. Much more HCN amounts were liberated by the shaken larvae and adults (Fig. 1b, c).

Consistently, more NaOH-extracted HCN was present in whole body homogenate of larvae than those in pupal and adult samples (Fig. 1d). Within the larvae, the highest content was detected in the cuticle homogenate, followed by those in gut and hemolymph specimens (Fig. 1e). Within the adults, high amounts were determined in cuticle and elytrum homogenates (Fig. 1f). Comparing cuticle samples demonstrated that larval cuticle contained more cyano-compounds than pupal and adult specimens. Moreover, the exuviae from final instar larvae also contained cyanochemicals (Fig. 1g).

The amounts of amygdalin were tested in the larval, pupal, and adult specimens. Amygdalin was only detectable in the pupal sample (Fig. 1h). It was distributed in pupal internal organs, rather than cuticle (Fig. 1i).

Bacterial symbionts produce cyano-compounds in their host beetles

It is known that cyanochemicals in several insect species are sequestered from food plants or biosynthesized by insects11,17. However, Solanaceae plants cannot produce cyanoglucosides11,18,19. In fact, the presence of HCN suppresses the growth of potato plant20,21. Moreover, insect biosynthesis enzymes for cyano compounds, CYP405A2, CYP332A3, and a glucosyl transferase UDP-glycosyltransferase17,22,23, were not found in L. decemlineata genome24.

In contrast, removal of bacteria (Fig. S1) significantly reduced the quantities of NaOH-extracted HCN in larval, pupal and adult samples (Fig. 2a-c). Moreover, the levels of NaOH-extracted HCN in the headspace collections (Fig. S2) were significantly higher in the culturable bacteria originating from L. decemlineata larvae and adults, compared with that in blank Luria-Bertani (LB) medium. Conversely, NaOH-extracted HCN contents were comparable in the supernatants of larva- and adult-originated bacteria to those in LB (Fig. 2d).

Fig. 2: Bacterial symbionts produce cyano-compounds in their host beetles.
figure 2

a-c NaOH solution-extracted HCN amounts from whole body homogenates of controls and their corresponding bacteria removal (Aposymbiot) samples (n = 6). d HCN content of culturable bacteria (n = 4Headspace from LB, 6Headspace from Adult, 4Headspace from Larva, 3Supernatant from LB, 3Supernatant from Adult, 3Supernatant from Larva). e, f Contents of amygdalin and/or prunasin in the minimum medium (MM1) with amygdalin as carbon source, adult (Bacterium A) and larval (Bacterium L) culturable bacteria (n = 3). Amygdalin quantities in adult (g) (n = 3LB, TE, KA, ST, GE, MN, 4AM))- and larva (h) (n = 3LB, TE, KA, ST, GE, MN, 4AM))-originated bacteria in LB medium containing ampicillin (AM), tetracycline (TE), kanamycin (KA), streptomycin (ST), gentamicin (GE) or metronidazole (MN) respectively, and in isolated Adult1 and Larva1 cultured in LB medium (i) (n = 3LB, Larva1, n = 5Adult1) or from supernatant and precipitate bacteria solution (j) (n = 3). k, l HCN concentrations of single colonies (Adult1 and Larva1) cultured with LB medium (n = 3). m Benzaldehyde contents of single colonies (Adult1 and Larva1) cultured with LB medium (n = 3). For am, data are mean ± SD. F(a) = 950.674, P(a)= 3.02 × 10−11. F(b) = 560.165, P(b)= 4.11 × 10−10. F(c) = 2025.180, P(c) = 7.06 × 10−13. F(d-Headspace) = 64.894, P(d-Headspace) = 8.14 × 10−7. F(e-amygdalin) = 628.340, P(e-amygdalin) =1.07 × 10−7. F(e-prunasin) = 143.149, P(e-prunasin) = 8.65 × 10−6. F(f) = 48.432, P(f) =  1.98 × 10−4. F(g) = 36.062, P(g)= 4.40 × 10−8. F(h) = 43.739, P(h)= 1.15 × 10−8. F(i) = 83.854, P(i) = 4.30 × 10-6. F(j) = 61.444, P(j) = 5.30 × 10-7. F(k) = 323.593, P(k) = 7.75 × 10-7. F(l) = 330.558, P(l) = 1.42 × 10-10. F(m) =  174.789, P(m) = 4.80 × 10-6. Source data are provided as a Source Data file.

Degradation of amygdalin by microorganisms has widely been documented in mammal microflora25, Lactobacillus paraplantarum and Lactobacillus plantarum26. Likewise, the larva-originated bacteria cultured using a minimum medium with amygdalin as a unique carbon source (MM) could efficiently degrade the cyanoglucoside, accompanied by an increase in prunasin. Notably, the adult-originated bacteria were able to catabolize both amygdalin and prunasin (Fig. 2e).

Moreover, both the adult- and larva-originated bacteria could produce amygdalin when cultured with LB medium (Fig. 2f).

To isolate amygdalin-producing bacteria, the adult- and larva-originated bacteria were cultured with LB medium containing ampicillin, tetracycline, kanamycin, streptomycin, gentamicin or metronidazole respectively. After culture, only those in ampicillin-added medium could vigorously biosynthesize amygdalin (Fig. 2g, h).

The adult- and larva-originated ampicillin-resistant bacteria were further isolated with LB plate plus ampicillin. Finally, two monoclonal bacteria were obtained. When cultured with LB medium containing ampicillin, the two monoclonal bacteria could generate the largest quantities of amygdalin, and were named as Adult1 and Larva1 respectively (Fig. 2i). Moreover, huge amounts of amygdalin were detected in the supernatant, rather than the precipitates (Fig. 2j).

Degradation of amygdalin can produce mandelonitrile, which is further broken down to generate volatile HCN and benzaldehyde. Adult1 and Larva1 bacteria could produce HCN. Large amounts of HCN were collected in the headspace air, rather than supernatant (Fig. 2k, l). Moreover, Adult1 and Larva1 also enabled to produce benzaldehyde (Fig. 2m).

Identification of Proteus vulgaris strain Ld01

Whole-genome sequencing of Adult1 and Larva1 bacteria was performed. Adult1 circular chromosome had a length of 4387544 bp, and was 100% identical to Larval1’s (accession number CP090064, BioSample number SAMN24291426), demonstrating that Adult1 and Larva1 belonged to the same bacterium species.

Given that the cutoff of average nucleotide identity (ANI) was 95% for delineating Proteus species27, ANI data established that Adult1/Larva1 was a strain of P. vulgaris (Table S2). A phylogenetic tree of 16S rRNA also demonstrated that Adult1/Larva1 was clustered together with Proteus species (Fig. 3a). Therefore, Adult1/Larva1 was designated as P. vulgaris strain Ld01.

Fig. 3: Identification of Proteus vulgaris strain Ld01.
figure 3

a A phylogenetic tree of 16S rRNA. bd Genes and pathways involved in the metabolism of cyanochemicals. e Knockout of HcnB obtaining ∆HcnB1 and ∆HcnB2 mutants (n = 8). f HCN concentrations in headspace volatiles of LB medium (LB), Ld01, ∆HcnB1 and ∆HcnB2 cultured with LB medium (n = 3). g-i Abundance of P. vulgaris Ld01 among developing stages and various tissues in the host L. decemlineata. DNA templates were derived from eggs (day 3), the larvae from the first through the fourth instars, prepupae, pupae and adults (D0 indicated newly ecdysed larvae, or newly emerged adults) (g) (n = 3), or from larval leg (L), head (H), hemolymph (HE), tracheae (T), muscle (M), fat body (FB), gut (G), Malpighian tubules (MT) and epidermis (EP) of 2-day-old fourth-instar larvae (h) (n = 3), or adult leg (L), head (H), elytrum (EL), membranous wing (MW), hemolymph (HE), muscle (M), fat body (FB), Malpighian tubules (MT), gut (G), epidermis (EP), ovary (OV), lateral oviduct (LO) and median oviduct (MO) of 10-day-old sexually-mature adults (i) (n = 3). For f-i, data are mean ± SD. F(f) = 117.717, P(f) = 5.87 × 10-7. Source data are provided as a Source Data file.

The genome mining of P. vulgaris Ld01 and 2021EL-00131 identified an HcnABC operon including hydrogen cyanide synthases HcnA, B and C (Figs. S35), two L-amino acid deaminase (L-AAD) (Fig. S6, 7) and an α-hydroxynitrile lyase (HNL) (Fig. S8) genes (Fig. 3b). Consequently, HCN is generated from glycine and benzaldehyde is produced from phenylalanine; the condensation of benzaldehyde and HCN produces mandelonitrile (Fig. 3c). Therefore, P. vulgaris is able to generate mandelonitrile through a route completely different from insects17,22,23. In addition, a β-cyanoalanine synthase (CAS) gene was also found from P. vulgaris genomes (Fig. 3b, Fig. S9). The corresponding CAS enzyme is proposed to detoxify HCN by condensation it and cysteine to form cyanoalanine and hydrogen sulfide (Fig. 3d).

To confirm the mandelonitrile biosynthesis way, we knocked out HcnB in P. vulgaris Ld01 and produced two mutants: ∆HcnB1 and ∆HcnB2 (Fig. 3e). The two mutants produced lower content of HCN compared with Ld01 strain (Fig. 3f).

After introducing L. decemlineata eggs on sterile potato foliage, P. vulgaris Ld01 abundance was evaluated throughout the developmental stages by qPCR. The high densities of P. vulgaris Ld01 were detected in L. decemlineata embryo, first, second, third and fourth-instar larvae, and sexual mature female adults (Fig. 3g). Moreover, P. vulgaris Ld01 was mainly located in larval and adult guts, and female ovaries (Fig. 3h, i).

P. vulgaris Ld01 produces mandelonitrile

Complementation of Ld01 strain, ∆HcnB1 or ∆HcnB2 mutants for aposymbiotic larvae completely reestablished P. vulgaris populations in larval bodies (Fig. 4a) but not affected the larval fresh weight (Fig. 4b). Recolonization of aposymbiotic larvae by the Ld01 entirely rescued HCN contents in larval secretions (Fig. 4c), HCN (Fig. 4d) and mandelonitrile contents (Fig. 4e) in larval bodies. Conversely, addition of ∆HcnB1 or ∆HcnB2 to aposymbiotic larvae could not restore contents of HCN in secretions (Fig. 4c) and bodies (Fig. 4d), and mandelonitrile titers in bodies (Fig. 4e). This demonstrates that P. vulgaris Ld01 can generate mandelonitrile in L. decemlineata larvae under catalyzation of hydrogen cyanide synthases HcnA, B and C.

Fig. 4: P. vulgaris Ld01 is responsible for cyanoglucoside generation.
figure 4

Abundance of P. vulgaris Ld01 (a) (n = 3) and weight of 2-day-old fourth-instar larvae (b) (n = 6Con, 10Aposymbiot, 10Ld01, 11∆HcnB1, 10∆HcnB2) in control (Con), aposymbiotic (Aposymbiot), aposymbiont+P. vulgaris Ld01 (Ld01), aposymbiont + ∆HcnB1 (∆HcnB1) and aposymbiont + ∆HcnB2 (∆HcnB2) larvae (10 individuals). cg Contents of HCN, mandelonitrile or benzaldehyde in the resultant beetles (nc = 3) (nd = 3) (ne = 3) (nf = 5) (ng = 5). h, i Amounts of HCN and benzaldehyde in the control (Con), aposymbiotic (Aposymbiot), and aposymbiotic+mandelonitrile (Mandelonitrile) beetles (n = 5). For a-i, data are mean ± SD. F(a) = 122.706, P(a) = 1.87 × 10-8. F(b) = 2.411, P(b) = 0.064. F(c) = 97.962, P(c) = 5.61 × 10-8. F(d) = 29.4, P(d) = 1.66 × 10-5. F(e) = 43.623, P(e) = 2.68 × 10-6. F(f) = 126.5, P(f) = 6.71 × 10-14. F(g) = 252.995, P(g) = 8.08 × 10-17. F(h) = 60.434, P(h) = 5.43 × 10-7. F(i) = 163.776, P(i) = 1.95 × 10-9. Source data are provided as a Source Data file.

To determine whether a causal link exists between mandelonitrile and HCN production in beetles, the HCN emissions were measured using SPME-GC-MS. Notably, shaken aposymbiotic, ∆HcnB1- or ∆HcnB2-recolonized larvae released lower amounts of HCN than disturbed control and P. vulgaris Ld01-recolonized specimens (Fig. 4f). When aposymbiotic larvae had subjected to an injection of mandelonitrile before shaking, the resultant beetles also emitted significantly higher amounts of HCN than aposymbiotic ones, comparable to the contents produced by corresponding controls (Fig. 4h).

Moreover, shaken aposymbiotic, ∆HcnB1- or ∆HcnB2-recolonized specimens released lower contents of benzaldehyde than disturbed control and P. vulgaris Ld01-recolonized samples (Fig. 4g), while an injection of mandelonitrile into the aposymbiotic specimens can partially restore the emission (Fig. 4i). Similarly, some strains in P. mirabilis are capable of liberating HCN28,29, benzaldehyde30 and phenylacetaldehyde31.

Mandelonitrile confers protection against predation

Birds have likely evolved an innate aversion to HCN, benzaldehyde2,3 and cyanoglucosides10,32 to avoid poisoning by HCN. Similarly, when a Chinese native domestic chick was given a choice between an L. decemlineata larva and a pupa, or an adult and a pupa, it significantly preferred a pupa (Fig. 5a, b). When a pupa was injected with mandelonitrile or water, a chick refused to attack and consume a mandelonitrile-supplemented pupa (Fig. 5c).

Fig. 5: Mandelonitrile in L. decemlineata facilitates an antipredator defense.
figure 5

ag The first choice (fc), injury rate (ir), and consumption rate (cr) of the beetles by the chicks in a dual-choice bioassay conducted with paired beetles (n = 7, 8). Paired data were compared using two-sided Mann-Whitney U test. *P < 0.05, **P < 0.01 and ***P < 0.001 indicate significant difference; NS indicates not significant. Z(a-fc) = -3.249, P(a-fc) = 1.16 × 10-3; Z(a-ir) = -3.398, P(a-ir) = 6.78 × 10-4; Z(a-cr) = -3.403, P(a-cr) = 6.65 × 10-4. Z(b-fc) = -3.398, P(b-fc) = 6.78 × 10-4; Z(b-ir) = -3.419, P(b-ir) = 6.29 × 10-4; Z(b-cr) = -3.252, P(b-cr) = 1.15 × 10-3. Z(c-fc) = -3.373, P(c-fc) = 7.43 × 10-4; Z(c-ir) = -3.508, P(c-ir) = 4.51 × 10-4; Z(c-cr) = -3.376, P(c-cr) = 7.37 × 10-4. Z(d-fc) = -3.373, P(d-fc) = 7.43 × 10-4; Z(d-ir) = -3.378, P(d-ir) = 7.30 × 10-4; Z(d-cr) = -3.391, P(d-cr) = 6.97 × 10-4. Z(e-fc) = -3.456, P(e-fc) = 5.48 × 10-4; Z(e-ir) = -3.366, P(e-ir) = 7.64 × 10-4; Z(e-cr) = -3.363, P(e-cr) = 7.71 × 10-4. Z(f-fc) = -3.378, P(f-fc) = 7.30 × 10-4; Z(f-ir) = -3.376, P(f-ir) = 7.37 × 10-4; Z(f-cr) = -3.249, P(f-cr) = 1.16 × 10-3. Z(g-fc) = -3.412, P(g-fc) = 6.44 × 10−4; Z(g-ir) = −2.229, P(g-ir) = 0.26; Z(g-cr) = −0.159, P(g-cr) = 0.874. h A summary of the roles of P. vulgaris Ld01 in L. decemlineata. For a-g, data are mean ± SD. Source data are provided as a Source Data file.

Aposymbiont reduces the antipredator defense against a chick. If given a choice between a control and an aposymbiotic larva, a chick significantly favored the latter (Fig. 5d).

Recolonization by P. vulgaris Ld01 or supplementation with mandelonitrile increases the anti-predatorial effects. When simultaneously provided a pair of aposymbiotic and P. vulgaris Ld01-recolonized larvae, a chick preferentially picked the former (Fig. 5e). Similarly, a water-injected aposymbiotic larva was frequently attacked and consumed by a chick when paired with a mandelonitrile-injected aposymbiotic larva (Fig. 5f). While a chick was synchronously confronted with a control and a P. vulgaris Ld01-recolonized larva, it indiscriminately fed on both (Fig. 5g).

Discussion

The larvae and adults of a Coleopteran L. decemlineata can actively eject sticky secretions to make them unpalatable to predators2,3. Here we uncover that HCN in the secretions acts as an antipredator repellant. HCN is a breakdown product of mandelonitrile, which is originated from amygdalin biosynthesized by a bacterial symbiont P. vulgaris Ld01 living in the host guts (Fig. 5h, i). P. vulgaris Ld01 relies on HcnABC enzymes to generate HCN, knockout of HcnB impairs HCN production.

Obviously, a high risk of predation by insectivorous animals on host plants drives L. decemlineata larvae and adults to deploy HCN weapon, in contrast to the pupae in underground chambers. Along with the evolutionary adaptation, we discovered that higher HCN titer was present in L. decemlineata larvae than that in adults (Fig. 1a, d, g). Among several possible explanations for this observation, the most convincing reason is that the larvae possess soft bodies and are less protected against predators, whereas the adult beetles partially depend on the hard elytra and cuticle to defend them from predation33. In this context, high density of P. vulgaris Ld01 was noted in the late stages of the first, second, and fourth-instar larvae (Fig. 3g). Since the beetles are usually sited on the upper surface of the potato foliage3,15, they were very vulnerable throughout the molting process, especially before the cuticle hardening. During ecdysis, high levels of P. vulgaris Ld01 can generate more mandelonitrile to repel the predators. The second reason for abundant cyanochemicals in larvae than that in adults (Fig. 1a, d, g) is that the larvae are group-living whereas the adults are often solitary15. Aggregation places individuals at a high risk of exposure to predators34,35. As a result, warning coloration evolves frequently at group-living stages36. Consequently, HCN titer is higher in grouping L. decemlineata larvae than that in solitary adults (Fig. 1a, d, g), just as that in the gregarious desert locust nymphs36.

After eclosion, the highest density of P. vulgaris Ld01 (Fig. 3g), and consequently large quantity of cyano metabolites, were in the sexually mature adults. In L. decemlineata adults, compounds from either defensive glands2,37 or hemolymph5 are repellent to ants37. When disturbed, an old adult usually ejects a drop of secretion from its defensive glands, while a younger has to release several large drops of hemolymph from its buccal region37. It can be proposed from our findings here that the secretion in defensive glands in a mature adult is rich in mandelonitrile; a drop is enough to repel predators. In contrast, mandelonitrile in the hemolymph is not so abundant in a younger, which has to use several drops to defend against predation. Moreover, we discovered that when beetles are disturbed, it will secrete nearly all the secretions from its defense glands and will not secrete any defense substances within an hour. Our findings revealed that there is no regulatory mechanism in terms of the quantity of HCN release. Similarly, the release of all or nearly all defense substances in response to an encounter with a predator has been documented in other insect species38,39,40. In Forficula auricularia, for instance, an exposure to ant stimulates the larvae releasing more than 75% of 2-methyl-1,4-benzoquinone and 2-ethyl-1,4-benzoquinone in their pygidial glands40.

In contrast, the light yellowed L. decemlineata pupae survive in underground chambers to avoid predation15; they do not eject hemolymph secretion when distributed. Consistently, HCN was under detectable limit in pupal surface eluent (Fig. 1a). The findings demonstrate that L. decemlineata pupae neither employ aposematism nor deploy hypertoxic HCN weapon, similar to some cyanogenic Lepidopterans41,42. Lack of HCN weapon in soil-lived pupae indicates an evolutionary adaptation to save energy17. Remarkably, the storage of amygdalin was prevalent in the pupal samples (Fig. 1h) and a certain number of P. vulgaris Ld01 was presented in the 2- and 3-day-old pupae (Fig. 3g). Amygdalin should be actively biosynthesized in the pupae. Similarly, prunasin content in Paropsis atomaria is high in life stages without defensive secretions13. Furthermore, even though cyanochemicals (indicated by HCN contents) were actually found in the pupal samples (Fig. 1d, g, i), these cyanochemicals included few amount of mandelonitrile (Fig. 1i). It is accordingly proposed that L. decemlineata pupae may use amygdalin as nitrogen source synthesizing nitrogen-containing chemicals that are needed during metamorphosis, such as chitin. In fact, endogenous pathways to retrieve ammonia from cyanoglucosides have been hypothesized to operate in some insects43,44,45.

Our findings arouse an intriguing question, is P. vulgaris Ld01 a facultative bacterium or a symbiot? Firstly, the beetles were fed on sterile potato foliage before the analyses of temporal richness and the tissue distribution of P. vulgaris Ld01 in the current paper. Our temporal distribution patterns (Fig. 3g) demonstrate that P. vulgaris Ld01 can actively multiply in the beetle host. Secondly, our tissue distribution data revealed that P. vulgaris Ld01 are more abundant in the larval and adult guts (Fig. 5h, i), consistent with a common notion that Proteus genus belongs to Enterobacteriaceae, a bacterial family mainly harboring in guts46. Thirdly, even though P. vulgaris is an opportunistic pathogen that is widely distributed in water, soil, and contaminated food46, it has not been found in potato plants47. Lastly, the expression data of 16S rRNA displayed that a great amount of P. vulgaris Ld01 was in the embryo (Fig. 3g) and the second most abundant in the female ovaries (Fig. 3i), suggesting that P. vulgaris Ld01 may be able to vertically transmit. All these indicate that P. vulgaris Ld01 may be a bacterial symbiot.

In addition, there are several issues remains to be addressed. How does the degradation of amygdalin to mandelonitrile and transformation of mandelonitrile to HCN happen? How about the spatio-temporal variation rules and the efficiency of compounds transformation? Would the stress from the predator accelerate the biosynthesis process of these defensive compounds? Further investigation into these issues will be a captivating future endeavor.

Methods

Insect rearing and chemicals

The overwintered L. decemlineata adults were collected from field potatoes planted in Urumqi (43.71 N, 87.39 E). The beetles were kept in an insectary in Xinjiang Academy of Agricultural Sciences according to a previously described method48, with potato foliage at the vegetative growth or young tuber stages in order to assure sufficient nutrition.

Amygdalin (≥95%, HPLC grade reagent), prunasin (≥96%, HPLC grade reagent), mandelonitrile (≥97%, HPLC grade reagent) and benzaldehyde (>99%, GC grade reagent) were respectively purchased from Extrasynthese (France), zzstandard (Shanghai, China), Aladdin (Shanghai, China) and Aladdin (Shanghai, China). Isonicotinic acid (≥99%, Analytial reagent) and barbituric acid (≥98%, Analytial reagent) were from MACKLIN (Shanghai, China) and RYON (Shanghai, China) respectively. Sodium hydroxide (96%, analytical reagent) was from XiHua Company (Guangdong, China). Sodium cyanide standard solution (1 mg/l) was obtained from Aladdin (Shanghai, China).

Determination of HCN and benzaldehyde originated from beetles

To determine whether cyanochemicals are present in the beetle secretions, ten L. decemlineata 2-day-old fourth-instar larvae, 3-day-old pupae and 10-day-old adults were respectively transferred to a vial (8 cm in height and 3 cm in diameter) as a replicate, vials containing beetles were shaken vigorously for 30 s using a vortex mixer to mimick predator attack. The body surfaces of the beetles were eluted with 0.05 M sodium hydroxide (NaOH) solution and the eluents were collected. Moreover, the soil of ten pupation chambers were collected as a replicate, the same amount of adjacent soil was set as control. The soil samples were immersed with 0.05 M NaOH to extract HCN. For each collection, three biologically independent (a total of 30 individuals) replicates across three successive generations were set. The CN- contents (μg/beetle) were analyzed by isonicotinic acid-barbituric acid (IN-BA) method.

The described methods were followed to measure HCN and benzaldehyde emitted by living beetles16,49. Briefly, ten 2-day-old fourth-instar larvae, 3-day-old pupae or 10-day-old adults (sexually mature) in a glass jar (10.5 cm height × 8.5 cm internal diameter) remained motionless or were shaken vigorously for 30 s. Five biologically independent (a total of 50 individuals) replicates were obtained. The HCN and benzaldehyde in the headspace of samples were respectively collected by CAR/PDMS type (85 μm coating thickness) and PDMS/DVB (65 μm coating thickness) static solid-phase microextraction (SPME) for 30 min. The SPME volatiles collected from an empty glass jar for 30 min served as control. The contents (ng/beetle) of HCN and benzaldehyde were respectively determined by GC/MS and GC-MS/MS.

To compare the contents of cyanochemicals, ten L. decemlineata 2-day-old fourth-instar larvae, 3-day-old pupae and 10-day-old adults were collected as a replicate. The collection was across three successive generations and fifteen biologically independent (a total of 150 individuals) replicates were obtained. Three repeats were used to extract cyano-compounds from whole body, three repeats were dissected to separate specific organs for the extraction of cyanochemicals, and another nine repeats were dissected to collect cuticle for extracting cyanochemicals. These tissues included the 2-day-old fourth-instar larval cuticle (CU), gut (GU), fat body (FB), hemolymph (HL) and muscle (MU); the sexually mature adult cuticle (CU), elytrum (EL), hind wing (HW), gut (GU), fat body (FB), hemolymph (HL) and muscle (MU); 2-day-old fourth-instar larval cuticle (LC), the 3-day-old pupal cuticle (PC), the sexually mature adult cuticle (AC) and the exuviae from the final instar larvae (EX). The samples were individually weighed and then crushed in a pre-chilled mortar using a pellet pestle. The preparations were extracted with 0.05 M NaOH to collect HCN, and the CN- contents (μg/beetle) were analyzed by IN-BA method.

In order to test the contents of amygdalin in samples, ten 2-day-old fourth-instar larvae, 3-day-old pupae and 10-day-old adults were collected. The collection was across three successive generations and three (30 larvae, 30 adults) or six biologically independent replicates (60 pupae) were obtained. Cyanogenic compounds from whole bodies of larvae, adults or pupae (3 repeats, 10 individuals per repeat), and from pupal cuticle samples and other tissues except cuticle (3 repeats, 10 individuals per repeat) were extracted following below protocol. Each repeat was weighed, crushed in a pre-chilled mortar using a pellet pestle, lyophilized, added with 1 ml of methanol, vortexed, and sonicated twice on ice for 30 min, and then centrifuged at 8000 x g for 20 min at 4 °C. The supernatant was transferred into a centrifuge tube, and lyophilized. The lyophilized supernatant was reconstituted with 200 μl of methanol, vortexed, and sonicated on ice for 15 min, and centrifuged at 20,000 rpm at 4 °C for 20 min. The resultant supernatant was then filtered through a 0.22 μm syringe filter (Nylon) and analyzed by HPLC-triple quadrupole mass spectrometer system (Waters) (HPLC-MS/MS). Each replicate was analyzed 1 time. The contents (ng/beetle) of amygdalin in samples were tested by HPLC-MS/MS.

Isolation of cyanocompound-producing bacteria

In order to compare the effects of degerming on the amounts of cyanochemicals, a replicate of ten newly-ecdysed second-instar larvae was allowed to feed on the antibiotics mixture containing 1 mg/ml ciprofloxacin, 1 mg/ml levofloxacin and 2 mg/ml metronidazole48 treated or control leaves. Each treatment was repeated 27 times. After having continuously fed for 3 days, the control and aposymbiotic groups were transferred to the sterile leaves from bacteria-free cultured potato plants. Immediately after they reached 2-day-old fourth-instar larvae, nine repeats were collected. The remaining 18 replicates were then transferred to the surface of sterile soil for pupation. Nine replicates were collected at the 3-day-old pupal stage and another nine were collected at the 10-day-old adult period. In terms of each group, three repeats were used for qPCR analysis to examine the degerming effects measured by total bacteria, Enterococcus and Pseudomonas in control or treated beetles following a described method48, using primer pairs in Table S1. Six replicates were used for determination of HCN amount. QuantStudio 5 was used to collected and analysis qPCR data.

In order to isolate the culturable HCN-producing bacteria, the amounts of HCN in headspace and supernatant from larva- or adult- originated bacteria cultured with LB liquid medium were tested by IN-BA method. Briefly, two 2-day-old fourth-instar larvae and 10-day-old adults of L. decemlineata were respectively washed with sterile water 5 times and were grinded. The collection was added into 40 ml Luria-Bertani culture medium (LB), and cultured 1 day at the condition of 200 rpm and 30°C. The headspace volatiles in the culture bottle were directly collected throughout whole culture period via the cotton immersed with 0.05 M NaOH equipped in 50 ml centrifuge tube. After the absorption of headspace volatiles, a total of 30 ml NaOH solution (0.05 M) was added to the cotton-contained centrifuge tube. The NaCN titer (μg/L) was analyzed by IN-BA method using cotton-free liquid. To prepare the bacterial samples, the bacteria-containing LB medium cultured for 1 day was directly centrifuged at 8000 x g for 20 min at 4°C. The supernatant was collected for analysis. CN- in bacterial samples was extracted by 0.05 M NaOH, and the contents (μg/L) were tested by IN-BA method. Six biologically independent replicates were obtained.

In order to determine whether bacteria can degrade aromatic cyanoglucosides, the isolated bacteria from 2-day-old fourth-instar larvae and 10-day-old adults were added into enrichment LB medium, and cultured 2 days at the condition of 200 rpm and 30 °C. Then 1 ml of this liquid culture was added to 9 ml enrichment LB medium with amygdalin (100 mg/L) and cultured 2 days, the procedure was cycled with amygdalin concentration increasing to 150 mg/L to enrich the amygdalin-degrading bacteria. After the last transferring, 1 ml of the last liquid culture was added to 9 ml minimal media with amygdalin (150 mg/L) (MM1) and cultured 3 days, and the MM1 free of bacteria was cultured at the same condition. The amygdalin and prunasin in 7 ml bacterial culture solution and control solution were extracted by methanol and the contents (μg/L) were tested by HPLC-MS-MS. Three biologically independent replicates were obtained.

To evaluate whether the larva- and adult-originated bacteria can generate amygdalin, the bacteria were cultured in LB for 1 day at the condition of 200 rpm and 30°C. Amygdalin contents (ng/L) in the bacterial culture solution were measured by HPLC-MS/MS using a protocol described above. Directing by high content of amygdalin, the amygdalin-producing bacteria were isolated by culturing the larva- and adult-originated bacteria with the LB culture medium individually containing 0.05 mg/ml of ampicillin, tetracyclines, kanamycin, streptomycin, gentamicin or metronidazole. The resultant bacteria being capable of proliferation in ampicillin-added mediums could generate amygdalin and were further isolated with LB plate plus ampicillin by repeated streaking on the plate50 and cultured 1 day at 30°C, respectively. A total of 164 single colonies cultured from larvae and adults on the solid LB culture medium were collected. These single colonies were individually transferred into 50 ml centrifuge tube containing 40 ml LB ampicillin-contained medium with the sterile pipette tips (20 μl) and cultured 1 day at the condition of 200 rpm and 30 °C. Finally, two single colonies respectively from larval and adult samples that produced the highest level of amygdalin were selected, which were named as Larva1 and Adult1.

Larva1 and Adult1 were cultured with LB for 1 day, the bacterial culture solutions were prepared. Moreover, the bacterial culture solutions were centrifuged at 8000 x g for 20 min at 4 °C; the supernatant and precipitate of bacterial samples were collected. Then, −20 °C precooled methanol (70%) was added into samples. The samples were treated with liquid nitrogen 5 min for quenching and freeze-thawed on ice for 10 min twice. The mixture was centrifuged at 8000 x g for 20 min at 4 °C, and the supernatant was collected, lyophilized, added with 1 ml of methanol, vortexed, and sonicated twice on ice for 30 min, and then centrifuged at 20,000 rpm for 20 min at 4 °C. Finally, the supernatant was filtered through a 0.22 μm syringe filter (Nylon) and analyzed by HPLC-MS/MS. Each sample was set as a replicate. The collection was repeated three times. Each replicate was analyzed 1 time. HCN from headspaces of whole culture medium, of supernatant and precipitate were collected by the same method in Fig. S2. The CN- concentrations (μg/L) were tested by IN-BA method. The benzaldehyde in headspace was collected by SPME PDMS/DVB (65 μm coating thickness), and the contents (μg/L) were tested by GC-MS/MS. For each collection, three biologically independent replicates were obtained.

Identification of P. vulgaris Ld01

The genome of Larva1 and Adult1 were sequenced by the third-generation sequencing technology according to a described method51. Briefly, the two bacterial single colonies (Larva1 and Adult1) were added into 1200 ml ampicillin-contained LB medium and allowed to proliferate for 1 day at the condition of 30 °C and 200 rpm. Genomic DNA was prepared according to the standard operating procedure provided by the manufacturer. The sequencing adapters supplied in the SQK-LSK109 kit were attached to the DNA ends. The DNA library was loaded onto a flow cell, transferred to the Nanopore GridION X5/PromethION sequencer (Oxford Nanopore Technologies, UK), and sequenced. Larva1 and Adult1 had the same genome sequence and the identified bacterium named as Ld01, the genome had been deposited in the NCBI Sequence Read Archive under accession number PRJNA791501. The gene position in genome was drawn by MG2C software online (MapGene2Chrom; http://mg2c.iask.in/mg2c_v2.1/).

The Average Nucleotide Identity (ANI) was calculated using the algorithm with the web service EzBioCloud in the default setting. We used reference genomes from 10 P. vulgaris strains, and 9 represent species within Proteus genus. The Ld01 bacterium was identified as P. vulgaris.

The publicly available 16S rRNA sequences of type strains of Proteus spp. (including P. vulgaris Ld01) were retrieved from the National Center for Biotechnology Information (NCBI) nucleotide database. In particular, three P. vulgaris strains were included in order to confirm the phylogenetic status of Ld01. Evolution history was reconstructed using the built-in maximum-likelihood method with 1000 bootstraps.

To mine functional genes involved in the metabolism of cyanochemicals, we annotated gene functions from P. vulgaris Ld01 and 2021EL-00131 genomes, comparing to the functional genes from Proteus genus. TBLASTN search of the P. vulgaris Ld01 genome data was carried out using the amino acid sequences of Proteus mirabilis L-amino acid deaminase, HcnABC operon, an α-hydroxynitrile lyase and β-cyanoalanine synthase as the queries. This resulted in the identification of 7 genes. Sequence alignment and phylogenic analysis of putative proteins were completed by MEGA7.

In order to test the abundance of Proteus in different developing stages and tissues in the host beetles, we analyzed the temporal richness and the tissue distribution of Proteus in the beetles fed on sterile potato foliage using q-PCR. For temporal abundance analysis, DNA templates were derived from eggs (day 3); the first, second, third and fourth larval instars; prepupae; pupae and adults at an interval of one day (D0 indicated newly ecdysed larvae, or newly emerged adults). For tissue distribution analysis, DNA samples were extracted from 2-day-old fourth-instar larval leg (L), head (H), hemolymph (HE), tracheae (T), muscle (M), fat body (FB), gut (G), Malpighian tubules (MT) and epidermis (EP); the 10-day-old sexually-mature adult leg (L), head (H), elytrum (EL), membranous wing (MW), hemolymph (HE), muscle (M), fat body (FB), Malpighian tubules (MT), gut (G), epidermis (EP), ovary (OV), lateral oviduct (LO) and median oviduct (MO). Eggs contained 200 individuals; samples for temporal richness contained 2-6 individuals and samples for tissue distribution included 10-15 individuals. Each sample repeated three times. The total DNA was extracted using DNAiso reagent (Takara, Japan). The abundance of Proteus was determined according to its specific primer pair52.

Obtainment of P. vulgarisHcnB1 or ∆HcnB2 mutants

HcnB gene in P. vulgaris Ld01 genome was deleted via a suicide plasmid method53. The original P. vulgaris Ld01 solution was mixed with the LB liquid medium at a ratio of 1:1000, shaken and cultivated at 200 rpm and 30°C for 16 h until the liquid was completely turbid to obtain the activated bacterial solution. The genomic DNA of P. vulgaris Ld01 was extracted according to standard procedures. The upstream (HcnB-US) and downstream (HcnB-DS) DNA fragments which flanking the HcnB open reading frame were amplified using primers HcnB-up and HcnB-down. The PCR reaction system included 2 μl genomic DNA, 25 μl high-fidelity enzyme Mix, 2 μl upstream and downstream primers, and 19 μl sterile water. The correction of HcnB-US and HcnB-DS was confirmed by DNA gel electrophoresis. HcnB-US and HcnB-DS were recovered using gel recovery kit (Omega, Cat#D2500-02), and stored in a -20°C refrigerator.

The suicide vector pK18mobsacB (BIOSCI, Cat#YP5367) was extracted using the plasmid extraction kit (Omega, Cat#D6943-02), and was double-digested using the two restriction enzyme sites BamHI (ThermoFisher, Cat#ER0051) and BglI (ThermoFisher, Cat#ER0071) to obtain the linearized plasmid. HcnB-US and HcnB-DS were combined with the pK18mobSacB linearized plasmid via homologous recombination method, using One Step Cloning Kit (ATG, Cat#C101-025). Ten μl of the recombinant plasmid pK18mobsacB_HcnB-US-DS was slowly added to 100 μl Escherichia coli Trans-T1 competent cells. After ice incubation for 30 min, the mixture was heat-shocked (42 °C) for 60 s, and rapidly placed on ice for 2 min. The mixture was added into 800 μl LB liquid medium, and cultured at 37 °C and 220 rpm for 1 h. And then, 100 μl bacterial solution was evenly spread on the LB solid plate containing 20 μg/mL kanamycin and cultured in 37 °C for 12-16 h. The single colonies growing on the kanamycin-contained LB solid plate were picked, placed into the liquid medium and cultured at 37 °C and 220 rpm for 16 h. The amplified pK18mobsacB_HcnB-US-DS was extracted from resultant E. coli; its sequence correctness was confirmed by PCR and sequencing.

In order to prepare competent cells, 0.4 ml activated P. vulgaris Ld01 bacterial solution was inoculated into 400 mL of LB liquid medium, and cultured at 30 °C and 200 rpm for 2-3 h. When the cells reached an OD600 of 0.4–0.6, the bacterial growth was interrupted by placing the culture on ice for 10 min and centrifuged at 5000 g for 10 min at 4 °C. The precipitate was resuspended in 10 ml precooling calcium chloride (CaCl2) solution (0.1 M/L), placed on ice for 10 min and centrifuged at 5000 g for 10 min at 4 °C. The competent cells was resuspended again in 2 ml precooling CaCl2 and 2 ml 30% glycerol solution, and stored in a −80°C refrigerator.

The recombinant plasmid pK18mobsacB_HcnB-US-DS was transformed into P. vulgaris Ld01 according to the following protocol. Ten μl of pK18mobsacB_HcnB-US-DS was slowly added to 100 μl P. vulgaris Ld01 competent cells. After ice incubation for 30 min, the mixture was heat-shocked (42°C) for 60 s, and rapidly placed on ice for 2 min. The resulting P. vulgaris Ld01 was added into 800 μl sugar-free LB liquid medium, and the bacteria were cultivated at 30°C and 200 rpm for 4 h. Finally, 100 μl bacterial solution was evenly spread on the LB solid plate containing 10 μg/mL ampicillin plus 20 μg/mL kanamycin and cultured in 30°C until the transformants, whose genomes were successfully integrated with pK18mobsacB_HcnB-US-DS (single exchange), formed single colonies. These colonies were picked and cultivated in the LB liquid medium at 30 °C and 200 rpm for 16 h. Then, 100 μl bacterial solution was evenly spread on the LB solid plate containing 10% sucrose, and cultured in 30 °C for the second homologous recombination, until the single colonies grew. These single colonies were picked and cultured in the LB liquid medium at 30 °C and 200 rpm for 16 h. The positive knockout mutants (∆HcnB1 or ∆HcnB2) were identified by PCR and HcnB primer pair. HcnB primer pair was designed by Primer Premier 5.

To verify HcnB was the primary gene for the biosynthesis of HCN in Proteus vulgaris Ld01. P. vulgaris Ld01, ∆HcnB1 or ∆HcnB2 mutants were added into LB medium and were cultured at 200 rpm and 30°C for 1 day. HCN was collected from headspaces of whole culture medium, and the CN- concentrations (μg/L) were tested by IN-BA method.

P. vulgaris Ld01 is responsible for HCN synthesis

To test the rescuing effect by P. vulgaris Ld01, ∆HcnB1 or ∆HcnB2 mutants on the production of cyano-compounds, three clonies were cultured with LB medium at 200 rpm and 30 °C for around 1 day until the OD value reached 0.6. Fifty newly-ecdysed second-instar larvae were randomly separated into five groups; a group (ten larvae) was allowed to feed on the control leaves and another four groups were confined to feed on antibiotics mixture treated (aposymbiotic) foliage. Three days later, the control and an aposymbiotic group were transferred to the sterile leaves from bacteria-free cultured potato plant. The other three aposymbiotic groups were provided sterile leaves immersed with Proteus vulgaris Ld01, ∆HcnB1 or ∆HcnB2 mutants. The five groups were admitted to consume their corresponding foliage for three days until they had developed to 2-day-old fourth-instar stage. The treatment was repeated 12 times. All twelve repeats were collected immediately when they became 2-day-old fourth-instar larvae. Three repeats were used for qPCR analysis (n = 3), 3 repeats for measuring the body weight (n = 10 individuals), the HCN and benzaldehyde contents in the headspace according to a described method16,49, 6 for determination of HCN contents in secretion (n = 3) and in body (n = 3), and 3 for measurement of mandelonitrile contents in body (n = 3).

To compare whether the addition of P. vulgaris Ld01 or mandelonitrile can affect the production of HCN, the headspace air was collected and HCN and benzaldehyde contents were tested according to a described method16,49. There were three treatments: control, aposymbiot and aposymbiot+800 ng mandelonitrile. Each treatment repeated 9 times. The protocol followed the above experiment. The final samples were used for qPCR (n = 3) and HCN and benzaldehyde tests (n = 3).

The dual-choice experiments with chick

The dual-choice trials were conducted using 4-day old naive Chinese native domestic chick (Gallus gallus domesticus) as predators. Chicks were obtained from a local hatchery in groups of 10-20 individuals and kept together in an enclosure for 2–3 days (80 × 80 × 90 cm).

To assess whether a chick preferentially selects and preys on beetles, a series of paired living fourth-instar larvae, pupae and adults were offered to the chick under light conditions. The chicks were deprived of diet for 4 h before testing. They were then initially presented with a mealworm to trigger hunger. Whenever a chick attempted to approach and attack the mealworm, the mealworm was withdrawn, and the chick was regarded as hungry without neophobic reaction. The chick was then subjected to formal testing.

A pair of living beetles was offered to a chick that was confined in a cage (40 cm × 40 cm × 30 cm; a topless cage). Each beetle was weighed to determine initial biomass and then suspended by sewing threads fixed on two ends of a bamboo stick to eliminate the effect of the different locomotive capabilities of chicks on the catchability of beetles. A total of 7 pairs were set. They were larva versus pupa, adult versus pupa, pupa having injected with 800 ng mandelonitrile versus with water, aposymbiotic versus normal larvae, aposymbiotic versus aposymbiotic+ P. vulgaris Ld01 reclonized larvae, aposymbiotic versus aposymbiotic+ 800 ng mandelonitrile injection larvae, and normal versus aposymbiotic+ P. vulgaris Ld01 reclonized larvae.

The attacking and feeding behaviors of the chick were then recorded on the pair of prey items under light conditions using a digital video camera (4 K FDR-AX30, Sony, Japan) operated at 25 fps in normal mode. Each assay lasted for 5 min. After the assay, the biomass of each prey was weighed, including the remaining uneaten body parts of the victims. A new pair of samples was then offered successively until all the seven pairs were finished. If a chick refused to attack further offerings before all the seven pairs were tested, all data of this chick were discarded. In order to avoid systematic error, the orders of each sample pair were changed when offered to each chick. A replicate of the dual choice experiment included 10 chicks. A total of 8 biological replicates were set (A total of 80 chicks were used). The average first-choice rates of chicks were calculated (n = 8). The injury rates (the incidence of each beetle injured by chicks) and consumption rates (the percentage of the total biomass of each beetle lost by chick feeding on each paired offering) were determined.

GC/MS and GC-MS/MS

GC/MS (Agilent Technologies, Wilmington, DE, USA) equipped with an Agilent GS-GASPRO (30 m length, 0.32 mm ID, 0.25 mm film thickness) capillary column (part 113-4332) was used to were qualitatively analyze HCN content16. Carrier gas was He at 1.0 mL/min (constant flow by pressure programming). Oven temperature began at 50 °C then ramped at 10 °C per min to 140 °C, then 50 °C per min to 240 °C and held for 2 min. SPME fiber injection was splitless, with injector temperature at 200 °C. Injector purge (25 mL per min) began at 1.0 min. The MS source and MS quadropole temperature was 230 °C and 150 °C, respectively. Electron impact ionization was used (70 eV) and mass spectra were collected over the range of 10-250 m/z.

The GC-MS/MS analysis was performed to test benzaldehyde content according to a documented protocol, with the same thermal programs49. Briefly, a Bruker GC system (456-GC) coupled with a triple quadrupole (TQ) mass spectrometer (Scion TQ MS/MS, Bruker Daltonics, Bremen, Germany.) equipped with an DB-1MS column (30 m × 0.25 mm i.d. × 0.25 μm film thickness, Agilent Technologies) was used to quantify the volatile compounds in the SPME samples. The GC-MS/MS electron impact source was operated in multiple reaction monitoring (MRM) mode, and collision-induced dissociation on argon as collision cell gas with pressure 2.0 Torr. The injector temperature was maintained at 250 °C with a constant flow rate of 1.0 mL/min of helium. The fiber was injected into the inlet operated in splitless injection mode and held for 1 min. Mixed samples consisting of standard compounds were used as external standards to develop the standard curves to quantify the volatiles.

CN- titer analyzed by isonicotinic acid-barbituric acid method

The IN-BA method was used to analyze CN- content evaluating by comparison to a standard NaCN curve constructed using a series diluted concentration of 0.01, 0.04, 0.06, 0.08, 0.1, 0.15 and 0.2 mg/L, modified from a previously described method54. Briefly, samples were added into 50 ml tuber with 40 ml NaOH water solution (0.05 M), each sample was grinded, vortexed, sonicated twice on ice for 30 min and centrifuged at 20,000 rpm at 4 °C for 20 min, and the supernatant were collected. In order to remove the color of solution from whole body samples, the specimens (40 ml) were added with 12 g activated carbon powders, vortexed 5 h at room temperature, filtered by filter paper and centrifuged at 20,000 rpm at 4°C for 20 min, and the supernatant were collected. A total of 100 μl of sample, 20 μl phosphate buffer and 2.5 μl chloramine (T) solution were added into 96 holes enzyme panel (Corning/Costar 3590 enzyme panels, USA), vortexed 1 min and reacted 5 min at room temperature. Then, 40 μl IN-BA solution was added to the mixture, vortexed 1 min and reacted 30 min at room temperature, the OD value of 162.5 μl final reacted solution was tested by enzyme-labeled instrument (Spectramax M5, Molecular Devices, USA) at 600 nm.

A preliminary test revealed that the minimum LOD of CN- standard solution was 0.005 mg/l. The CN- absorption rate by activated carbon powders was estimated as follows: 1 ml of 0.02, 0.04, 0.08, and 0.11 mg/l CN- standard solution were prepared, and each solution was divided into two parts (each part was 500 μl). One part was treated with 0.15 g activated carbon powders, vortexed 5 h at room temperature, filtered by filter paper and centrifuged at 20,000 rpm at 4 °C for 20 min, and the supernatant of samples were collected. Another part was used as control. The contents of CN- were tested following the same protocol for sample. The concentration gradient curve was draw through the contents of serial NaCN standard solution (x axis) and their corresponding OD600 value (y axis). The contents of CN- in the samples treated with activated carbon powders were calibrated by the concentration gradient curves in Fig. S11.

HPLC-triple quadrupole mass spectrometer (HPLC-MS/MS) analysis

The chromatographically pure mandelonitrile, amygdalin and prunasin were dissolved in methanol to give stock solutions of 10 mg/L. The serial dilutions of mandelonitrile (range from 1 μg/L to 800 μg/L), amygdalin (range from 6 μg/L to 1000 μg/L) and prunasin (range from 20 μg/L to 800 μg/L) were used to estimate the linear range and limit of detection (LOD). All the solutions were stored at 4°C in the dark.

The contents of mandelonitrile, amygdalin and prunasin were tested using a pump liquid chromatograph with an autosampler and column oven (Waters® Acquity® I Class) coupled to a triple quadrupole mass spectrometer (Waters® Xevo TQ-S micro). MassLynx® V4.1 software was used for data analysis. The analysis was performed on an ACQUITY UPLC® HSS C18 column (2.1 × 50 mm, 1.8 μm; Waters Acquity) of High-Definition Mass Spectrometer (Waters). Mobile phase A was 0.1% formic acid water solution, while mobile phase B was acetonitrile. The gradient elution procedure was set as follows: 0–0.5 min, 5% B; 0.5–3 min, 5–95% B; 3–4 min, 95% B; 4–4.01 min, 95–5% B; and 4.01–5 min, 5% B. The flow rate was 0.3 ml min-1, and the column temperatures were held constant at 45°C.

Each sample was detected by negative ion modes using an electrospray ionization mass spectrometer (ESI-MS). The ESI conditions of mandelonitrile were as follows: source temperature, 150°C; desolvation temperature, 500°C; desolvation gas flow, 1000 L/Hr; capillary voltage, 1.2 kV; cone voltage, 7 V; LM resolution 1, 9.5; HM resolution 1, 14.9; ion energy 1, -0.3; LM resolution 2, 7.9; HM resolution 2, 14.7; ion energy 2, 0.4; collision energy, 30 V. In negative ion mode, the data acquisition of first mass spectrum and secondary mass spectrum was set as m/z: 100–800 and m/z: 90–800, respectively. The ESI conditions of amygdalin were as follows: source temperature, 150°C; desolvation temperature, 500 °C; desolvation gas flow, 1000 L/Hr; capillary voltage, 1.2 kV; cone voltage, 7 V; LM resolution 1, 9.5; HM resolution 1, 14.9; ion energy 1, −0.3; LM resolution 2, 7.9; HM resolution 2, 14.7; ion energy 2, 0.4; collision energy, 19 V. In negative ion mode, the data acquisition of first mass spectrum and secondary mass spectrum was set as m/z: 100-800 and m/z: 90–800, respectively. The ESI conditions of prunasin were as follows: source temperature, 150 °C; desolvation temperature, 500°C; desolvation gas flow, 1000 L/Hr; capillary voltage, 1.2 kV; cone voltage, 7 V; LM resolution 1, 9.5; HM resolution 1, 14.9; ion energy 1, −0.3; LM resolution 2, 7.9; HM resolution 2, 14.7; ion energy 2, 0.4; collision energy, 25 V. In negative ion mode, the data acquisition of first mass spectrum and secondary mass spectrum was set as m/z: 100–800 and m/z: 90–800, respectively. The product ion scan was attained using the first- and second-level mass spectrometry data acquisition method based on the Photodiode Array (PDA) detector. MassLynx® V4.1 was used to collect and analysis data.

In order to test the mandelonitrile, amygdalin, and prunasin contents in samples, the concentration gradient curves were drawn through the contents of serial standard solution (x axis) and their corresponding peak area (y axis). The minimum LOD of mandelonitrile, amygdalin, and prunasin were 1 μg/L, 6 μg/L and 20 μg/L respectively. The contents of mandelonitrile, amygdalin and prunasin in samples were calculated by the formula of concentration gradient curves and their peak area.

All bar graphs in the article were drawn by GraphPad Prism 7.

Data analysis

The SPSS 17.0 (SPSS Inc., Chicago, IL, USA) statistical analysis software was used to process all data. The behavioral data of chickens were analyzed for statistical significance using Mann-Whitney U test (n = 8 for each paired beetle; means ± SD). Other data were analyzed statistically using the Shapiro-Wilk test to assess for normality and equal variance test for same variance, followed by one-way analysis (ANOVA) of variance with the Tukey-Kramer test, or compared using an unpaired Student’s t-test. *P < 0.05, **P < 0.01 and ***P < 0.001 indicate significant difference; NS indicates no significant between two groups.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.