Wasps are dangerous little insects. They're aggressive as heck, and being stung can be on a spectrum from incredibly painful to fatal.

But that venom isn't just dangerous to humans. It can also wipe out bacteria - and scientists have just figured out how to retain the bacteria-killing part while removing the pesky "dangerous to humans" part.

The result? A potential new antibiotic based on a peptide in wasp venom that kills bacteria without harming human cells - although we need to note that so far the only living beings it's been tested on were mice.

"We've repurposed a toxic molecule into one that is a viable molecule to treat infections," said microbiologist and immunologist Cesar de la Fuente-Nunez of MIT. "By systematically analysing the structure and function of these peptides, we've been able to tune their properties and activity."

All classes of life on the planet produce antimicrobial peptides - a short chain of amino acids that kills microbes by disrupting their cell membranes - as part of their defence against infection.

As more and more bacteria develop antibiotic resistance around the world, more and more people are dying. One potential way of fighting these "superbugs" is developing a new class of antibiotics to which the bacteria have no resistance.

This is why scientists are working on trying to adapt antimicrobial peptides into antibiotics. But it's complicated work.

The research team discovered a potential target in one particular peptide, found in the venom of a South American wasp called Polybia paulista(the same wasp whose venom was being investigated as a cancer treatment a few years ago), and consisting of just 12 amino acids.

"It's a small enough peptide that you can try to mutate as many amino acid residues as possible to try to figure out how each building block is contributing to antimicrobial activity and toxicity," said de la Fuente-Nunez.

First, the team developed a few dozen variants of the peptide, and tested them against 7 species of bacteria and 2 fungi to test how well they interacted with the cell membranes.

Based on this, the researchers could work out which structures and physicochemical properties of the peptides were the most effective against microbes, and refine them accordingly.

The refined peptides were tested for toxicity to humans on lab-grown human embryonic kidney cells. This way, the team established a human-safe dose level.

Finally, the peptides were ready for testing on live animals - mice. These were infected with an antibiotic-resistant bacteria called Pseudomonas aeruginosa, which is particularly dangerous to patients with compromised immune systems.

The team tested several of the most promising peptides, with varying degrees of success. Several of them did in fact reduce the level of infection. But one really stood out - at a high enough dose, it completely eradicated P. aeruginosa.

"After four days, that compound can completely clear the infection, and that was quite surprising and exciting because we don't typically see that with other experimental antimicrobials or other antibiotics that we've tested in the past with this particular mouse model," said de la Fuente-Nunez.

The research does need further work - the researchers are trying to figure out if they can retain its efficacy at lower (safer) doses.

But it's promising. Scientists have developed a number of drugs based on antimicrobial peptides that are currently in clinical use to treat antibiotic-resistant infections - although it's worth noting that not all such pharmaceuticals pass clinical trials.

However, even if the wasp venom ends up being a dead end, the researchers believe that the methods they developed can be applied to other antimicrobial peptides in the search for a wider range of solutions - and that's something we all need.

The research has been published in the journal Communications Biology.