The ability to detect toxic compounds in foods is essential for animal survival. However, the minimal subunit composition of gustatory receptors required for sensing aversive chemicals in Drosophila is unknown. Here we report that three gustatory receptors, GR8a, GR66a and GR98b function together in the detection of L-canavanine, a plant-derived insecticide. Ectopic co-expression of Gr8a and Gr98b in Gr66a-expressing, bitter-sensing gustatory receptor neurons (GRNs) confers responsiveness to L-canavanine. Furthermore, misexpression of all three Grs enables salt- or sweet-sensing GRNs to respond to L-canavanine. Introduction of these Grs in sweet-sensing GRNs switches L-canavanine from an aversive to an attractive compound. Co-expression of GR8a, GR66a and GR98b in Drosophila S2 cells induces an L-canavanine-activated nonselective cation conductance. We conclude that three GRs collaborate to produce a functional L-canavanine receptor. Thus, our results clarify the full set of GRs underlying the detection of a toxic tastant that drives avoidance behaviour in an insect.