Robots could take over the human job of milking a scorpion for its venom, potentially making the task a lot safer for everyone involved.

The Society for Experimental Biology described the robot as clamping onto a scorpion’s tail and using electrical stimulation to get it to release venom that can be safely collected. The robot is also portable and lightweight, and can be operated by a single person. According to SEB, which recently held its annual main meeting in Gothenburg, Sweden, the technology can have different settings for different species of scorpion and can be programmed to remember them.

Read: Snake Venom Used in New Heart Disease Drug

“The extraction of scorpion venom is a very difficult task and usually takes at least two experimenters,” robot designer Mouad Mkamel said in the society’s statement. “There are numerous risks, including potentially deadly scorpion stings and electric shocks from the stimulators used to extract the venom.”

Apart from using electrical shocks to get the animal to release the venom, other methods include mechanical stimulation, which could also lead to a sting, or puncturing its gland to get at it, which is harmful to the creature.

Mkamel and the other researchers, from Ben M'sik Hassan II University in Morocco, hope their invention will cut down on those risks.

“This robot makes venom recovery fast and safe,” he said. “It is designed to extract scorpion venom without harming the animal and to provide more safety for the experimenters.”

Scorpion venom is not gathered just for kicks — it is used to create immunosuppressant, cancer or anti-malaria drugs.

Pick your poison

It’s not the only poison used as medicine. Many deadly substances also have medical applications and have been modified to serve humans.

Venomous snakes have been used in drugs that treat heart disease, including a recently developed drug that cuts down on the excessive bleeding that is a common side effect of other similar treatments.

Heart disease might be a disease that is one of the most widely treated with poisons. Some people with cardiovascular conditions take digoxin, which improves circulations and is derived from the deadly plant foxglove. In high doses, the lethal component in foxglove can cause low blood pressure, hallucinations, vomiting, diarrhea, headaches, depression and confusion.

Read: Scientists Can Use Dopamine to Read Your Thoughts, Control Behavior

Also treating heart disease is nitroglycerin, the explosive used in dynamite. In small enough doses, the compound merely relaxes blood vessels to treat high blood pressure. Any more than that and you are a human stick of TNT.

Cancer is another disease that is widely treated with poison. Radiation shrinks tumors, but it is also deadly for healthy cells, which is what gives patients nasty side effects and also kills people who spend time around malfunctioning nuclear reactors.

Like scorpions and snakes, spiders also have venom that can be used for medical reasons. Some have been investigated as a treatment that slows down the cell deterioration in muscular dystrophy while others could make effective painkillers. Just don’t go searching for spider bites next time you have a headache.

Insects are another group that are used for their venom, including bees, wasps and hornets. One of the main purposes of their poison is in the allergy field, exposing people to the substances so they build up a tolerance and become less allergic. But it was recently reported that there are currently shortages of the insect venoms, partly due to contamination issues, and doctors might have to limit their treatment only to patients who need it the most.