Have you ever been on a deployment, ate some unusual local food, and then spent the next week in the porta-john? Or had trouble getting back to a normal sleep schedule after kicking down doors all night? 

The Defense Advanced Research Projects Agency understands, and it wants to put bioelectronic gizmos in your body to keep you in tip-top shape.

Sound creepy? Maybe a little bit, but DARPA says it’s all in the name of readiness. After all, sleepiness makes service members less alert and diarrhea keeps them from going out on patrol. According to a 2005 study, 76.8% of troops surveyed in Iraq and 54.5% of troops surveyed in Afghanistan reported diarrhea, and many of those had to miss missions or go to the hospital to get treatment.

The runs is a long-running problem in military history, a constant threat that one physician in 1892 described as “more fatal to soldiers than powder and shot.” During the Civil War, 95,000 soldiers died from diarrhea or dysentery, and hospital admissions for diarrheal diseases during the Vietnam War outnumbered those for malaria by nearly four to one.

Now, DARPA believes it has the technology to wipe out the problem once and for all. The Advanced Acclimation and Protection Tool for Environmental Readiness (ADAPTER) would take the form of an “implantable or ingestible bioelectronic carrier that can provide warfighters control over their own physiology,” DARPA wrote in a press release on Wednesday.

Once inside the service member, ADAPTER would decontaminate any local food or water the service member eats or drinks. Specifically, it would target the top five bacterial sources of traveler’s diarrhea, DARPA wrote, thereby rendering the greatest military in history fully shit-proof.

“ADAPTER will provide a transient, non-genetic means of extending and enhancing warfighter readiness,” the agency said.

Diarrhea isn’t ADAPTER’s only target. DARPA also wants the program to “entrain the sleep cycle—either to a new time zone or back to a normal sleep pattern after night missions,” the agency wrote.

But what’s wrong with Rip Its and dip, you ask? DARPA says those chemical methods “disrupt downstream sleep patters and lead to exhaustion.” In contrast, the goal of the ADAPTER program “is to produce the therapies within the body itself,” said Paul Sheehan, the program manager.

“ADAPTER will manage a warfighter’s circadian rhythm, halving the time to reestablish normal sleep after a disruption such as jet lag or shift lag,” Sheehan said in the release.

Though DARPA has yet to release more specific details on how ADAPTER will work, the press release said that “performers” will choose one of two tracks, either the reduce-sleepiness track or the stop-diarrhea track. For now, it seems, participants will have to choose between either being sleepy-proof or diarrhea-proof, but not both at the same time.

Now, the real question for DARPA: How can we get less constipated after eating MREs?