Observation or recognition of an infant's sex may be complicated in the case of intersex infants and children and in cases of early trauma. In such cases, the infant may be assigned male or female, and may receive
intersex surgery to confirm that assignment. These medical interventions have increasingly been seen as a
human rights violation due to their unnecessary nature and the potential for lifelong complications. The number of births with ambiguous genitals is in the range of 1 in 2,000 to 1 in 4,500 (0.05% to 0.02%). The 12th-century
Decretum Gratiani states that "Whether a hermaphrodite may witness a testament, depends on which sex prevails". The foundation of common law, the 16th Century
Institutes of the Lawes of England, described how a hermaphrodite could inherit "either as male or female, according to that kind of sexe which doth prevaile". Legal cases where sex assignment was placed in doubt
have been described over the centuries. Research suggests that within early modern common law, particularly in England and colonial America during the seventeenth and eighteenth centuries, such cases were treated as matters of legal determination rather than medical diagnosis, and were resolved through evidentiary procedures in court. Rather than applying a fixed biological standard, courts considered a range of physical, behavioral, and social factors when assigning sex, without sharply distinguishing between what would later be conceptualized as “sex” and “gender.” Decisions were typically based on testimony and social context, reflecting the broader common law tradition of relying on juries and community knowledge in fact-finding. Toward the late eighteenth century, with the medicaliztion of intersexuality, medical and scientific authorities began to play a more central role in such determinations, marking the beginning of a shift toward the modern view of sex as a biological and binary category. Over the decades, as clinical understanding of biological factors and diagnostic tests have improved, as surgical techniques have changed and potential complications have become clearer, and in response to the outcomes and opinions of adults who have grown up with various intersex conditions, criteria for assignment have evolved. Before the 1950s, assignment was based almost entirely on the appearance of the external genitalia. Although physicians recognized that there were conditions in which the apparent secondary sexual characteristics could develop contrary to the person's sex, and conditions in which the gonadal sex did not match that of the external genitalia, their ability to understand and diagnose such conditions in infancy was too poor to attempt to predict future development in most cases. In the 1950s,
endocrinologists developed a basic understanding of the major intersex conditions such as
congenital adrenal hyperplasia (CAH),
androgen insensitivity syndrome, and
mixed gonadal dysgenesis. The discovery of
cortisone allowed survival of infants with severe CAH for the first time. New hormone tests and karyotypes allowed more confident diagnosis in infancy and prediction of future development. Sex assignment became more than choosing a sex of rearing, but also began to include surgical treatment. Undescended testes could be retrieved. A greatly enlarged clitoris could be amputated to the usual size, but attempts to create a
penis were unsuccessful.
John Money and others controversially believed that children were more likely to develop a gender identity that matched sex of rearing than might be determined by chromosomes, gonads, or hormones. The resulting medical model was termed the "Optimal gender model". Historical accounts indicate that the development of sex-assignment surgery further reinforced the idea that sex could be medically constructed and permanently fixed, with surgical intervention functioning as a means of establishing legally recognized sex status. ==Challenges to requirements for sex assignment==