Sex assignment (also known as gender assignment)  is the discernment of an infant's sex at birth. A relative, midwife, nurse or physician inspects the external genitalia when the baby is delivered and, in greater than 99.95% of births, sex is assigned without ambiguity. In the remainder of cases, additional diagnostic steps are required to understand the cause and sex assignment might be deferred. Sex may also be determined prior to birth through prenatal sex discernment. 

The number of births where the baby is intersex—where their sex characteristics do not fit typical definitions of male and female—is estimated to be between 0.018% and 1.7%. While some intersex conditions can lead to genital ambiguity (about 0.02% to 0.05% of births), in others genitalia can clearly be identified as either male or female. In the latter cases, an intersex condition might not be recognized at birth. 

Generally, parents and society, as well as governments and healthcare systems, assume that a person's gender identity will develop according to the sex assigned at birth; a condition known as being cisgender. While this is the case for a majority of people, for a significant number assigned sex and gender identity do not align; a condition known as being transgender or gender non-conforming.

The sex assignment of an intersex individual may also contradict their future gender identity. If available, knowledge about the gender identity that a majority of people with the specific intersex condition develop is considered in sex assignment. Assignments might later be adjusted as a person grows up. Reinforcing sex assignments through surgical or hormonal interventions without informed consent is considered by the Office of the United Nations High Commissioner for Human Rights to violate the individual's human rights.

Terminology
Sex assignment is the discernment of an infant's sex at birth, usually based on the phenotypic sex. It is also referred to as gender assignment.

According to the Diagnostic and Statistical Manual of Mental Disoders maintained by the American Psychiatric Association, the result is referred to as birth-assigned sex or birth-assigned gender, while the terms assigned sex and assigned gender include later assignments or reassignments during infancy and early childhood, as they are common in intersex people. The birth-assigned sex was previously also called natal gender and historically was referred to as "biological sex".

Sex is assigned as either male or female, giving rise to the following terminology:

Assigned male at birth (AMAB) a person of any age and irrespective of current gender whose sex was assigned as "male" at birth.  Synonyms: male assigned at birth (MAAB) and designated male at birth (DMAB).

Assigned female at birth (AFAB) a person of any age and irrespective of current gender whose sex assigned as "female" at birth.  Synonyms: female assigned at birth (FAAB) and designated female at birth (DFAB).

AGAB Acronym for assigned gender at birth.

Assignment in cases of infants with intersex traits, or cases of trauma

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.

Cases of trauma include the famous John/Joan case, where sexologist John Money claimed successful reassignment from male to female of a 17-month old boy whose penis was destroyed during circumcision. However, this claim was later shown to be largely false. The subject, David Reimer, later identified as a man.

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%). Typical examples would be an unusually prominent clitoris in an otherwise apparently typical girl, or complete cryptorchidism in an otherwise apparently typical boy. In most of these cases, a sex is tentatively assigned and the parents told that tests will be performed to confirm the apparent sex. Typical tests in this situation might include a pelvic ultrasound to determine the presence of a uterus, a testosterone or 17α-hydroxyprogesterone level, and/or a karyotype. In some of these cases a pediatric endocrinologist is consulted to confirm the tentative sex assignment. The expected assignment is usually confirmed within hours to a few days in these cases.

Some infants are born with enough ambiguity that assignment becomes a more drawn-out process of multiple tests and intensive education of the parents about sexual differentiation. In some of these cases, it is clear that the child will face physical difficulties or social stigma as they grow up, and deciding upon the sex of assignment involves weighing the advantages and disadvantages of either assignment. Intersex activists have criticised "normalising" procedures performed on infants and children, who are unable to provide informed consent.

History 
In European societies, Roman law, post-classical canon law, and later common law, referred to a person's sex as male, female, or hermaphrodite, with legal rights as male or female depending on the characteristics that appeared most dominant. Under Roman law, a hermaphrodite had to be classed as either male or female. 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.

With the medicalization of intersex, criteria for assignment have evolved 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.

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".

Challenges to requirements for sex assignment
In recent years, the perceived need to legally assign sex is increasingly being challenged by transgender, transsexual, and intersex people. A report for the Dutch Ministry of Security and Justice states "Gender increasingly seems to be perceived as a 'sensitive' identity feature, but so far is not regarded, nor protected as such in privacy regulations". Australian government guidelines state that "departments and agencies that collect sex and/or gender information must not collect information unless it is necessary for, or directly related to, one or more of the agency's functions or activities"

Sex registration was introduced in the Netherlands in 1811 due to gender-specific rights and responsibilities, such as military conscription. Many gender-specific provisions in legislation no longer exist, but the provisions remain for rationales that include "speed of identification procedures".

References

Genital modification and mutilation
Human sexuality
Intersex and medicine
Sex-determination systems
Transgender and medicine