Researchers studying the public health system of leafcutter ants in Panama have discovered that these social insects synthesize large amounts antimicrobials to battle parasitic fungal infections. The findings were published in Proceedings of the Royal Society B this week.

When lots of animals (or people for that matter) live together in large societies, it can become really difficult to manage diseases. In our history, the disease burden was especially high during the Neolithic agricultural revolution that began a several thousand years ago and during the period of urbanization that followed -- we didn’t get things under control until the dawn of modern antibiotics in the last couple centuries. Turns out, social insects living in agricultural societies face similar challenges.

Leafcutter ants (genus Atta) live in colonies made up of millions of individuals. They’re farmers who cultivate fungi for nutrients, but specialized fungal pathogens, like Escovopsis, lurk around as well. Over millions of years, these fungus farmers have abandoned their ancestors’ antibiotic-based biological control: Rather than depend on bacteria and other microbes to fight off the fungi, some leafcutter species began to rely heavily on chemical secretions to control infections. Their special metapleural glands synthesize large quantities of a foul-smelling antimicrobial agent called phenylacetic acid.

To study this little investigated antimicrobial agent, INDICASAT’s Hermógenes Fernández-Marín and colleagues created multiple colonies of 16 Atta species in the lab using ants collected from Soberania National Park or near Gamboa in central Panama. After experimentally infecting the colonies, the team examined four specific disease defense behaviors of the ants: “licking” their fungal garden to remove contaminated particles (fungal grooming), bringing the opening of their metapleural gland into contact their forelegs to then apply onto the infection source (MG grooming), transplanting a piece of healthy fungus into an infected garden area (cultivar planting), and removing a piece of the fungal garden into the garbage dump (weeding).

Sure enough, phenylacetic acid is a defensive compound effective at controlling fungal pathogens. The smallest worker ants, in particular, greatly reduced the spread of fungal spores by applying phenylacetic acid secretions to the infection in their garden. As the ants formed larger colonies, their extreme caste system became even more differentiated: That subset of small worker ants developed enlarged metapleural glands, and they seemed to specialize in these search-and-destroy operations.

So far, there’ve been no known instances of an Escovopsis outbreak destroying a colony, Science reports, though fungus populations living alongside these ants are becoming less sensitive to phenylacetic acid. (The typical next step in an evolutionary arms race.) Fortunately for now, the ants’ chemical pest management system seems to prevent the rise of resistant strains: They only use their antimicrobials when there’s an actual infection, and only on the infected area, thanks to their precise grooming process.