Lisa Pratt was nearly 2 miles below ground in a South African gold mine when the lights went off and the air stopped moving. Power had cut out, along with the reassuring roar of the ventilating fans that regulate the mine’s methane and carbon monoxide levels. Pratt, then an Indiana University ­geology professor, was hunting for evidence of life-forms capable of ­surviving in extreme dark, salinity, and temperature. As miners began to pour from a crease in the rock above her and run for the exit, it was clear that humans weren’t on that list. “It was not a good moment,” she recalls of that day in 2001. “I honestly thought that might be the end of the line.”

Today, Pratt’s work in such environments has led her to a brightly lit office at NASA headquarters in Washington, D.C., as the agency’s planetary protection officer. In this sparse room with a laptop and a whiteboard, she still ponders a question she faced during her years of crawling, sliding, and rappelling into harsh places to collect extremophiles: “How do you look for signs of life without inadvertently bringing life with you?”

Pratt’s answer will influence everything from spacecraft construction to interplanetary flight plans. Her core mission is this: Keep Earth’s hardiest microbes from hitching rides on equipment we send to places like Mars, and try to stop native critters (if they do in fact exist) from thumbing a ride back.

Since the launch of the satellite age, most space-faring nations have adhered to strict contamination-control guidelines set up by the Committee on Space Research (COSPAR). These don’t call for complete sterilization—an impossibility without damaging a spacecraft’s materials and electronics. Instead, they rely on a probabilistic approach that tries to minimize the likelihood of a tough little microbe making its way to another world. To achieve that, Pratt is working with NASA engineers and mission planners to ensure these guidelines are met as the agency constructs new spacecraft.

“Everybody has played well together on this,” Pratt insists, “at least until just recently.” By that she means Elon Musk. In February, his private company, SpaceX, sent a ­(microbe-​laden) Tesla Roadster hurtling through space. While it’s unlikely to collide with any planet in the next 100,000 years, Pratt still lets out an exasperated groan when the topic comes up, and launches into a long list of all ­planetary-​protection protocols that SpaceX ignored.

Pratt doesn’t have the power to slap Musk with a fine for cleanliness infractions, but she can try to convince companies like his that protocols matter. With SpaceX planning to deliver mining and life-support materials to Mars ahead of what could be actual humans, there’s a new urgency to her mission. “We don’t have any agreements or methods in place to get cargo like that clean,” she says. Over the next several years, working with ­COSPAR and private space companies, Pratt will try to formulate agreements and guidelines for ­public- and private-sector space powers.

She doesn’t have much time. Once ­humans carrying microbes step onto Mars, a key opportunity for discovering new life will end. And even then, what if we do find life out there? While momentous, it won’t necessarily trigger a global embrace. “Earth as a whole is going to say, ‘Sorry, until we know enough about it to be certain it’s not dangerous, you can’t bring it home,’” she says. “You can’t just bring a Mars pet back with you.”

This article was originally published in the Winter 2018 Danger issue of Popular Science.