The new rules will prevent women affected by hyperandrogenism - women producing higher than normal levels of the male sex hormone testoterone.- from competing in distances between 400 metres and the mile.
Under the new legislation, published today, the IAAF will allow women with hyperandrogenism to compete only if they lower their naturally occuring testosterone levels with medication.
Semenya is a double Olympic and triple world champion in the 800 metres.
Last month she was crowned double Commonwealth champion in the 800 and 1500 metres distances.
Since bursting onto the international stage at the world championships in 2009, Semenya's dominance in women's middle distance has been controversial.
Her powerful physique and deep voice has left many of her fellow competitors complaining she had an unfair advantage.
The IAAF's previous attempt to regulate on hyperandrogenism fell foul of a Court of Arbitration for Sport ruling in 2015 after the appeal on behalf of Indian athlete Dutee Chand, who had been banned from competing because of her testosterone levels.
The new rules create a new female classification called Athlete with Differences of Sexual Development (DSD).
"Experts consulted by the IAAF have gathered and reviewed all of the published evidence and data, which indicates that increasing the level of circulating testosterone from the normal female range to the normal male range leads to increased muscle mass and strength and higher haemoglobin levels," the report says.
"The result is these new regulations, which seek to facilitate the participation in the sport of athletes with DSDs on terms that preserve fair and meaningful competition in the female classification.
"The IAAF has gathered observational data about the difference in performance levels of DSD athletes depending on whether or not their testosterone levels are suppressed."
Medication could harm performance
Experts say Semenya taking the medication to reduce her testosterone could take as much as seven seconds off her 800 metres time.
The IAAF's medical advisors have say the advantage of DSD athletes is much less significant in short sprints or longer distances.
Semenya would therefore be free to move up to 5,000 or 10,000 metres, if she desired.