A new study in fruit flies describes how an animal's gut reacts differently to beneficial microbes versus harmful pathogens.