Most insects, including the genetic model Drosophila melanogaster, are frequently infected by endoparasitoid wasps in nature. These wasps inject their eggs into the body of the insect wherein the wasp egg hatches and the resulting wasp larva eventually consumes the host tissue. Like other insects, Drosophila larvae mount a cellular immune response against infection whereby the wasp eggs are encapsulated, melanized, and killed, which wasps attempt to suppress by injecting venoms along with their eggs. Drosophila larvae also perform defensive behaviors in the presence of wasps, such as moving away from wasp odors, rolling to interrupt wasp oviposition, and self-medication to increase their toxicity to the wasp larvae inside them. Here, we describe a new larval defensive behavior in which more larvae burrow into the food substrate in the presence of wasps. We investigate the causes and adaptive value of this behavior, as well as the neurobiological mechanisms underlying it.