Astronauts never travel to space alone. Each person voyaging off-world is accompanied by up to 100 trillion bacteria, viruses and other microorganisms, any number of which could jeopardize human health. Yet we are still mostly in the dark about how these communities of microscopic hitchhikers react to microgravity. We do not even know the full spectrum of spacefaring species living onboard the International Space Station (ISS). New studies, however, are designed to change that. Last month astronauts collected samples from across the interior of the ISS to build an unprecedented three-dimensional map of its microbiome. This effort at a space-based microbial census is the first step toward understanding, preventing and mitigating dangerous outbreaks—whether they arise onboard the station, during long-duration flights toward Mars or even back home in hospitals.

We are constantly overrun by microbes. From the bacteria lining our guts to the too-small-to-see mites living at the base of our eyelashes, it is estimated that there are at least as many microbes on and within us as there are human cells. “You can think of people as walking ecosystems,” says Pieter Dorrestein, a chemical biologist at University of California, San Diego. Most of these minuscule creatures are actually essential and have such far-reaching impacts on our health—affecting our immunity, our heart and perhaps even our mental health—that scientists often refer to the microbiome as an “invisible organ.” In fact, the microbial multitudes within us are so numerous that their total mass can add up to roughly the weight of our brain.

It might not come as a surprise, then, that understanding how the microbiome behaves during spaceflight is crucial if we want to send astronauts on long-term missions to Mars and beyond. But scientists are not only worried about the human microbiome—they are also worried about the spacecraft’s microbiome. Take the Russian space station Mir as an example. In 1998—about three years before the station deorbited into the Pacific Ocean—scientists discovered several dozen species of bacteria, fungi and dust mites hiding behind a service panel. “I never pictured an inanimate object—a machine that works beautifully like the station—as having a microbiome similar to someone who’s alive, like a human,” says Serena M. Auñón-Chancellor, who is both a physician and a NASA astronaut. Yet, counter to the notion of space as a sterile, inert environment, any spacecraft will inevitably host an assortment of microbes in numbers sufficient to make any astronaut’s skin crawl.

A spacecraft’s microbiome could prove hazardous to the health of the astronauts. “Can you imagine you’re on a long flight and all of the sudden you start to get, let’s say, a flesh-eating bacterium, and you can’t get rid of it?” Dorrestein says. “Those are the kinds of consequences that could materialize.”

It is not a crazy idea. In 2006 a team of scientists sent a culture of salmonella bacteria for an 11-day ride on the space shuttle Atlantis only to find that once the microbes returned to Earth, they more easily killed mice. Bacteria that have slipped Earth’s surly bonds can also become more resistant to antibiotics—a recipe for disaster, given the fact that long-duration spaceflight tends to weaken astronauts’ immune systems.

The new project launched by NASA’s Jet Propulsion Laboratory and U.C. San Diego could help mitigate the microbial threat. In February astronaut Kate Rubins swabbed 1,000 different locations throughout the ISS. That is about 100 times greater than the number of swabs in typical microbial tracking studies, which usually focus on the most suspect parts of a living space such as kitchens, bathrooms and exercise areas. The samples will be placed in cold storage and, in a few months, sent back to Earth, where scientists will analyze their genetic signatures and name the various microbes to build a three-dimensional map of the ISS’s full microbiome.

Moreover, each swab will capture trace molecules from food, oils, skin, and more. That prospect particularly excites Dorrestein, who is working on the project. Scientists currently know very little about what kinds of molecules are present on the ISS that nourish the growth of different microbial communities there. The new map will help them link specific molecules or nutrients to specific microbes. With that connection, scientists can craft guidelines to promote the growth of beneficial microbes and reduce the dangerous ones—through nutrients alone. That might be as simple as utilizing specific construction materials on a spacecraft to Mars. All of this suggests the problem of a “sick spacecraft” could be partially solved before it even reaches the launchpad.

But Kasthuri Venkateswaran, a microbiologist at the Jet Propulsion Laboratory and principal investigator of the project, is most excited about the protective measures that could take place in transit. Although the current samples are being sent back to Earth, he notes that astronauts will need to cut out that middleman on future missions. “When we go all the way to other planets, you don’t have a FedEx to send the samples back,” Venkateswaran says. Although scientists do have the capability to perform genomic analysis onboard the ISS, the process is not particularly speedy, and in the event of a dangerous outbreak, every moment may count (just think about how long it often takes to get results back from a PCR test for COVID-19). “You want to make sure you can stay on top of that—as we’re all too aware these days of how some little bug can kind of mess up your world,” says David Klaus, a space microbiologist at the University of Colorado Boulder.

To combat that issue, the swabs Rubin used in the station-sweeping assay are double-headed. One tip collects microbes for simple detection whereas the other intends to capture their metabolites—the microorganisms’ natural chemical by-products. Once Venkateswaran and his colleagues have created a database linking specific microbes with certain metabolites, they can build small biosensors that look for just the metabolites. Picture a handheld device that could diagnose the presence of bacteria or fungi on the spacecraft and alert astronauts of an outbreak immediately—similar to a carbon monoxide detector.

A notification from such a system (which Venkateswaran suspects will take another five to 10 years to become a reality) would spark immediate action—as astronauts would intensify their cleaning protocols to prevent an onboard outbreak. “This will make for a better maintenance of tomorrow’s habitat,” Venkateswaran says. Astronauts onboard the ISS already work hard to keep the microbiome population under control. Every week they vacuum the vents and wipe down surfaces with disinfecting wipes. Auñón-Chancellor estimates that when she was in orbit, each of the crew’s six astronauts spent roughly three hours a week cleaning. That is 18 hours each week for the ISS’s total habitable volume of just 388 cubic meters (around half of the passenger space in a Boeing 747), which may seem excessive. But given the ISS’s unique circumstances, all that sanitizing is necessary. “Up there, food just doesn’t fall to the floor,” she says. “Food goes to the ceiling. Food sticks to the walls. Food is everywhere. So it’s 3-D cleaning.”

This kind of conscientious cleaning leads some scientists to dismiss worries about an outbreak en route to Mars. “I don’t think that the influence of bacteria is really a big showstopper for long term spaceflight because evidence suggests otherwise,” Klaus says. “We’ve had people living on the [ISS] with rotating crews continuously for over 20 years now. And there hasn’t been any kind of outbreak there.” Auñón-Chancellor notes that simply finding dangerous bacteria is not cause for alarm—it is only worrying if the microbes are making astronauts sick. “I see it more as an identification and a heads up,” she says. “And then we’re just kind of watching and mapping and waiting to see what those bacteria do in that stressful environment,” she adds.

But Venkateswaran is worried not only about risks to the astronauts—but also the chances of microbial contamination of any otherworldly destinations they visit. “Astronauts are basically a pathogen to the planet,” Auñón-Chancellor says. “They’re a new microbiome that’s suddenly stepping foot on Mars. Even the spacesuit that they step out in will have their own mission’s microbiome on the material surface of that suit.” If scientists could map the microbiome on that suit better, they might be able to clean it better, too. Venkateswaran is hopeful that the research will even help scientists design superior suits with joints that prevent even the smallest microbes from leaking through.

The unique applications do not end there. For Liz Warren, senior program director at the ISS U.S. National Laboratory, the most tantalizing aspect about all this research has little to do with space. Any partially closed environment—a house, an airplane, a hospital—will have its own microbiome. So learning how to prevent certain microbes from thriving in space (or how to halt them when they do) offers helpful lessons for similar environments on Earth. For example, consider another project running on the ISS that tests the efficacy of antimicrobial coatings manufactured by Boeing. The idea is that if the coatings work in space—where microbes can be far more dangerous—then they will work on Earth. In short, the ISS is an incredible laboratory in its own right. “You can’t do that on Earth—you can’t take gravity out of the picture,” Klaus says. “Having microgravity is kind of like having a microscope for the first time in a different way. You see behaviors that you couldn’t otherwise see.”