Good news if you hate needles. Vaccinations, insulin injections, or intravenous drips could one day be replaced by smart pills that inject the medicine directly into your stomach.

What’s new: Many pharmaceutical compounds simply aren’t suited to being taken orally, because they can’t survive the stomach’s harsh, acidic environment. A new device could overcome that problem, allowing virtually any medication to be swallowed, according to a paper published in Science this week.

How? The device works by attaching itself to the inside of the stomach and then injecting a payload through the gastric wall. It involves some clever engineering to ensure it’s released at exactly the right time: a tiny, spring-loaded needle is released once the sugar glass that surrounds it is dissolved by acid in the stomach.

You won’t be able to feel it because there are no pain receptors within the gastrointestinal tract, says coauthor Robert Langer at MIT. It’s inspired by the shape of a leopard tortoise’s shell, which automatically self-rights no matter how it lands. This ensures the device will attach to the gastric wall regardless of how it tumbles.

A first: “This is the first time we’ve managed to deliver insulin orally, as safely and effectively as you can by injection,” Langer says. “I don’t see any reason why this couldn’t work to replace virtually any injectable drug,” he adds. This could be life-changing for the 415 million people with diabetes worldwide, many of whom must inject insulin at least once daily to manage their condition.

A caveat: This invention is still at the proof-of-concept stage. It’s only ever been tested in animals, so it’s still many years away from becoming available to the public.

Sign up here to our daily newsletter The Download to get your dose of the latest must-read news from the world of emerging tech.