Hydrogen peroxide is the preeminent chemical weapon that organisms use for combat. Individual cells rely on conserved defenses to prevent and repair peroxide-induced damage, but whether similar defenses might be coordinated across cells in animals remains poorly understood. Here, we identify a neuronal circuit in the nematode Caenorhabditis elegans that processes information perceived by two sensory neurons to control the induction of hydrogen peroxide defenses in the organism. We found that catalases produced by Escherichia coli, the nematode's food source, can deplete hydrogen peroxide from the local environment and thereby protect the nematodes. In the presence of E. coli, the nematode's neurons signal via TGFβ-insulin/IGF1 relay to target tissues to repress expression of catalases and other hydrogen peroxide defenses. This adaptive strategy is the first example of a multicellular organism modulating its defenses when it expects to freeload from the protection provided by molecularly orthologous defenses from another species.Supported by NIH Office of Research Infrastructure Programs (P40 OD010440), and the National BioResources Project, Japan. The research was supported by National Science Foundation CAREER grant 1750065 to JA, a Northeastern University Tier one award to JA, a National Institutes of Health grant R01AG051659 to AG, the MEIC Excelencia award BFU2017-88615-P to NS, the Spanish Ministry of Economy, Industry and Competitiveness (MEIC) to the EMBL partnership to NS, the Centro de Excelencia Severo Ochoa to NS, and the CERCA Programme/Generalitat de Catalunya, and European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (Grant agreement No. 852201) to N