I don't know very much about the situation, that is I don't know if this "alteration" is natural or induced by what would be in practice doping. With this premise, I think that there is a simple way to solve this problem, and is a combination of the so called biological passport and "personalized medicine" (I spent hours yesterday on PubMed looking for some reviews, so please forgive me :D ). My point is that nowadays athlete are (or at least should be) tested for doping multiple times, for the sake not only of the fairness of sport but also and especially for their health. With this, it is going to be easy to understand if this alteration is normal or induced. In the first case, nothing should be done. In the second case, it is in practice use of doping. In the intermediate case of transgender athletes, (but this is really starting to be out of my field of knowledge), the use of hormones should be limited so that a maximum amount cannot be exceeded, otherwise it will be considered as doping. My opinion is that we have all the technical means to do it and this should be done.
For what I know, Semenya is not doped and she is as she appears since her birth, so it is a wrong decision.