The battle between humans and rats has been raging for thousands of years, and while we might have strength, size and smarts on our side, rats have their own secret weapon: the ability to breed like crazy. Now, the City of New York – a notorious rat hotspot – is working with biotech company SenesTech to disarm that tactic, with a birth control substance called ContraPest that renders both males and females infertile. The method is said to be humane, environmentally friendly and pose no risk to humans, pets and other animals.

An estimated two million rats call New York City home, and so bad is the problem that the Department of Health offers a three-day training course for residents and business owners to learn how to detect and deal with the freeloading rodents. But keeping them out of your property and garbage is a full-time job, and poisons can not only harm kids, animals and the environment, they aren't all that effective anyway: as SeneTech says, if one colony of rats is wiped out, neighboring groups will take the opportunity to invade the newly-empty territory.

Instead, the company's technique is designed to tackle the root of the problem: the animals' proclivity for procreation. According to SenesTech, just four breeding pairs of rats (and their offspring) could produce up to 15 million rats in the space of a year. ContraPest is a non-lethal – and tasty – liquid bait, that renders the creatures infertile without otherwise harming them, allowing them to live out the rest of their eight- to twelve-month lifespan without reproducing, before eventually dying of natural causes.

Essentially, the bait works by triggering early menopause in the females. Ovarian follicles are the cell clusters that release eggs in mammals, and over the lifespan of the animal, they naturally degrade, until eventually the animal becomes unable to reproduce. ContraPest speeds up that process to sterilize the rats in a matter of weeks, and it also affects the males of the species by impairing their sperm production.

The active ingredient is a chemical called 4-vinylcyclohexene diepoxide (VCD), which is mixed into a liquid bait that's designed to be appealing to rats. The compound doesn't affect other animals – in fact, the scientists behind the stuff say they've been tasting it themselves for years – and it becomes inactive after ingestion, so the chemical won't persist in the animal's droppings.

"They put sugar in it and oil and fat, things to make it taste good," says Patricia Hoyer, the University of Arizona researcher who originally developed the formula that led to ContraPest. "The rats love it, and they remember it tastes good, so they go back for more. And people are crazy about this approach because it doesn't kill the animal. It's like having them on permanent birth control."

A collaboration between the New York Department of Health and SenesTech begins this month, with trials of ContraPest taking place in particularly rat-infested parts of the city. In the past, the University of Arizona team has successfully tested the bait on farms and transit systems in Chicago and New York.

"The potential for worldwide use is tremendous because rats are pests around the world," says Hoyer. "It will get rid of them in the places where you don't want them."