For a While there, Seres Thera­peutics was the most promising name in poop. Located in Cambridge, Massa­chusetts—in the same building as Crispr Therapeutics, one of the key players in gene editing today—the biotech company has been trying to transform medicine by harnessing the billions of bacteria in people’s intestines.

Those bacteria, plus others that live in and on the body, make up the human microbiome, an invisible world that is only recently coming into focus. Scientists now know that the wrong balance of bugs in your gut—a delicate ecosystem that can collapse as you age, travel, or even take new medi­cation—can lead to all sorts of distress. Seres is one of the first startups aiming to design treatments that would manipulate the microbiome to repair bad guts and cure diseases. When it went public last year, the company was valued at $133.7 million, a vote of confidence for its first drug candidate: a set of microbes distilled from human feces, washed with ethanol, and condensed into a pill.

The technical term for transferring poop from one person to another is fecal microbiota transplant, and Seres’ oral version appeared to work wonders. One of the deadliest antibiotic-resistant health threats in the country is Clostridium difficile, a nasty gut infection that can strike patients after a course of antibiotics wipes out their existing bacterial residents. Early trials suggested Seres’ treatment cured recurring C. diff infections 97 percent of the time, the kind of result pharma companies only dream of. The startup was primed to nab the Food and Drug Administration’s first drug approval in microbiome-based therapeutics, pioneering the way in targeted treatments for a whole range of gastrointestinal disorders, from C. diff to Crohn’s disease. So nobody expected what happened next. In July, Seres reported the results of its more rigorous, second-phase trial: Nearly half the patients had their C. diff infections return—statistically indistinguishable from those who received no treatment at all.

The lab-built poop pill had failed.

Just a 20-minute drive from Seres is OpenBiome, the country’s largest stool bank. Its scientists are trying to cure C. diff too. The difference is, OpenBiome’s product has worked for years.

OpenBiome believes in the power of pure, barely processed poop. Every month, a hundred or so donors drop off anonymized bags of their stool at the bank, where a lab tech in a poop-emoji-emblazoned hair net weighs and scores every sample (on the Bristol stool scale: Google it). Another tech adds a simple saline solution, shakes it up in a Whirl-Pak bag, and freezes the liquid—ready to send to doctors and researchers across the country. Since OpenBiome opened in 2012, these simple preparations have successfully treated more than 15,000 cases of C. diff. The form of delivery to the body doesn’t even seem to matter. Enema, colonoscopy, oral capsule full of freeze-dried stool: It all works. “With C. diff,” says Mark Smith, OpenBiome’s cofounder and research director, “you can deliver it however you want.” And that’s the problem. Raw poop, diversely delivered, makes OpenBiome’s approach a regulation nightmare.

Introduce the good microcritters in large enough numbers and they can gobble up C. diff ’s food supply, starving the infection out.

Nobody, least of all the safety sticklers at the FDA, sees Open­Biome as a long-term solution. While stool banks screen donors for harmful pathogens, no amount of testing can turn up everything. And even if it could, it’s not just bacterial threats like E. coli that patients have to worry about. There’s no telling how someone else’s microbiome will affect your health down the line: The bugs in two people’s guts can differ by as much as 90 percent. So it wasn’t surprising when, in 2013, the FDA announced that it would regulate fecal transplants as drugs—a major blow to OpenBiome. Though stool banks can still operate, the development of safer alternatives will likely phase them out.

Seres felt pretty good about its chances to unseat OpenBiome—it had a theory about exactly which intestinal microbes combatted C. diff. Whereas OpenBiome went with the whole shebang, confident that something in there would do the trick, Seres thought it could design a more tailored, and therefore more regulation-friendly, fecal experience. (Seres declined to participate in this story, but it has reported some details about its process.) C. diff thrives, the idea went, on certain bile acids in your intestines. The more it eats, the worse the infection gets. But there are good critters in your gut—so-called spore-forming bac­teria—that have an appetite for those bile acids too. Introduce these guys in large enough numbers and they can gobble up C. diff’s food supply, starving the infection out. So Seres took batches of poop from healthy donors and reduced it to just 50 specific species of the spore-formers, adding ethanol to kill pathogens. Et voilà, the company thought—a poop pill even the FDA could love.

“It was very encouraging at first that just spore-forming bacteria worked,” says Dale Gerding, an epidemiologist who’s been studying C. diff since 1980 and is now the chief medical officer for Rebiotix, another company developing a poop pill. “But now that’s in question.” When Seres’ drug trial failed, the neat hypothesis fell apart. The fact is, Gerding says, the whole field of microbiome-based medicine was due for a reckoning. Doctors were so thrilled with the power of poop that they got overconfident in their ability to control it. Even Open­Biome’s Mark Smith agrees. “From a scientific perspective, the Seres result is actually a pretty important contribution to the field,” he says. “I’m sure it’s not what they intended, but previously people thought anything would work. Here we found something that didn’t.”

Colleen Kelly started using fecal microbiota transplants in 2008—one of the first gastroenterologists in the US to do so. Over the years, she has noticed some strange side effects. One of her C. diff patients, for instance, also suffered from alopecia universalis. He hadn’t been able to grow any hair since he was 16: not on his head, not in his armpits, not even on his eyebrows. But when he got a stool transplant from his sister, he started sprouting fresh patches.

When Kelly told a colleague about the result, she got a second shock: He had seen a fecal transplant recipient regrow hair too. The two doctors were stuck. They didn’t have the resources to analyze their patients’ microbiomes to see what bugs might have been responsible for the change. “You don’t know how bad I wish I had that,” she says.

Tabletop robots sort through fecal samples from around the world, identify species of bacteria, and use those to grow more.

She’s not alone. It’s becoming more and more clear that the microbiome has therapeutic potential beyond the gut. Some patients undergo signi­ficant weight changes after a transplant; others say their depression goes away. Yet doctors still can’t figure out how it works.

Which is why, in early August, the National Institutes of Health announced that it would fund a fecal transplant registry, maintained by the American Gastroenterological Association. For the first time, thousands of transplant patients will have their microbiomes sequenced before and after treatment so doctors can have a better shot at identifying not only the bugs that fight C. diff but also what’s causing all those side effects. If Kelly had access to that kind of analysis with her alopecia patient, she might have stumbled onto a new, targeted microbiome therapy—delivering just the right bacteria to trigger hair growth.

Walk 15 minutes down Allston Street from Seres’ headquarters and you arrive at yet another microbiome-based start­up, Vedanta Biosciences. (One wonders if these 25 square miles contain the highest concentration of human feces of any major American city.) To Vedanta, fecal transplants have always been hopelessly irregular. Though it still handles real poop, the company is looking toward cleaner pastures.

At its lab, tabletop robots sort through fecal samples from around the world, identify individual species of bacteria, and use those to grow more of the same. Then algorithms look for bacteria and diseases that go together to determine how the former can be used to treat the latter. Vedanta already has its first drug candidate, a combination of microbes to treat inflammatory bowel disease (better known by its two main types, ulcerative colitis and Crohn’s disease).

It is this kind of research-based approach that will move microbiome therapies forward. And it’s what the rest of the field is finally undertaking—tearing apart Seres’ trial data, following up with OpenBiome’s patients, and diving into the NIH’s new database.

In the sterile, glassed-in spaces at Vedanta, you can glimpse a future free of the concerns that real, raw poop brings. There, robots are busy growing microbes themselves, no human donors necessary. Imagine: All the magic of poop—with none of the mess.

Senior associate editor Katie M. Palmer (@KatieMPalmer) runs WIRED’s science coverage. She wrote about the science of marijuana in the April issue.

This article appears in our special November issue, guest-edited by President Barack Obama. Subscribe now.