For bacteria, the mammalian gut is like Shangri-La. It’s warm and consistently so, sheltered from the environment, and regularly flooded with a nutritious soup. But what happens when this all-you-can-eat buffet stops serving? What happens to microbes if their host stops eating?

When animals from mice to flies become sick, they often lose their appetite and temporarily stop eating. This makes sense: it takes a lot of energy to find or capture food, and for the moment, that energy is better spent on fighting off disease. But these short-term fasts harm the beneficial microbes that live in our guts. As we starve, so do they. Their absence makes us less efficient at digesting our food and creates vacancies that more harmful microbes could exploit.

A team of scientists, led by Alexander Chervonsky from the University of Chicago, has now found that mice deal with this problem by manufacturing molecules that feed their gut microbes during bouts of infection.

The cells of their intestines glom a sugar called fucose onto fats and proteins, which the bacteria can yank off and eat. The sugar is an emergency currency, used to pay off microbial employees when the usual coffers are empty, to keep them from quitting the firm.

Joseph Pickard and other team members discovered these back-up payments by injecting mice with molecules like LPS, found on the outer coats of bacteria. When such molecules are swallowed, they cause few problems. But if they float around the bloodstream, they can trigger an intense immune response. That’s what the team saw: the injections were enough to sicken the mice. They lost their appetites, became sluggish, developed diarrhoea, and lost weight.

In response, their intestinal cells started attaching fucose to proteins and other molecules, using a gene called Fut2. They then released these modified substances into their guts. As a result, they recovered faster, and regained their lost weight. When the team did the same experiments with mice that lacked the Fut2 gene, the animals took an extra day to put as much weight back on as their normal peers.

The team found that fucose only triggered a speedier recovery if the rodents had a normal community of gut microbes. The team suspected that the microbes were eating the sugars directly, and they developed a way of watching this feeding frenzy in action. They infused the mice with bacteria that would give off a green glow whenever they activated genes for digesting fucose. When the rodents were injected with LPS and began releasing fucose, these reporter microbes started glowing.

So, it seems that if sick hosts aren’t ingesting food from the outside, they’re secreting food from within for their bacteria. Of course, the microbes behind the illness might also be able to sup on these sugars. But the team also found that fucose switches off virulence genes in gut microbes, diminishing their ability to cause disease. It not only feeds beneficial bacteria, but defangs harmful ones.

Although these experiments were done in mice, Chervonsky believes that something similar happens in humans—or at least, in the majority of them. Around one in five people lacks the Fut2 gene, and they are more likely to develop an inflammatory bowel disorder called Crohn’s disease. Perhaps that’s because they’re not as good at keeping a happy rapport with their gut microbes, during times of stress.