All that is needed is for the rules to state - as they do in athletics, swimming, rowing and rugby - that eligibility for the female competition is based on competitors being genetically female and that any queries be referred to a doctor.
It does not mean that every athlete be tested at the age of 10.. this is a very rare condition that is usually determined at birth, and in the extremely unlikely case that it is not, it is discovered during puberty. Once it becomes obvious, that athlete, their coaches and the organisations will know that this athlete is no longer eligible.
So, there may be a very very small number of athletes that compete in their teens in the wrong category - that would be OK - it would be excusable and every woman on the planet would be OK with that, as long as they did not continue to insist on the right to compete in a category for which they were not eligible.
Athletes who compete internationally, are seen by doctors - for all sorts of things, it is not invasive, it is not discriminatory, it is not dehumanising.
The ONLY reason this has come about - is because athletes knowingly entered the female category, on the basis that their sex might remain unknown and this happened because the IOC dropped the requirement for sex testing in 1999. It took 10 years for DSD athletes to appear on the world stage.
Womens Football and Womens boxing have not been as popular as Athletics in countries where there is a higher likelihood of babies being assigned the wrong sex at birth.
BUT: the Football and Boxing international organisations, have not followed the lead of Athletics and they have failed to defended the female category. None of these athletes are competing against the rules, the rules are failing to ensure the fairness in the female category.