We learned in the Mishna:
If there is uncertainty whether or not to circumcise a baby, and likewise in the case of an androgynous (a hermaphrodite baby), one does not desecrate Shabbat to perform the circumcision of an androgynous even on the eighth day following the birth.
The Sages taught in a baraita: The verse states: “And on the eighth day the flesh of his foreskin shall be circumcised” (Vayikra 12:3), and they interpreted the verse: “His foreskin” indicates that only the circumcision of his halakhically certain foreskin overrides Shabbat, and the circumcision of a halakhically uncertain foreskin does not override Shabbat. And by means of the same inference from the termhis foreskin, derive that circumcision of his definite foreskin overrides Shabbat, and circumcising the foreskin of an androgynous, with regard to whom there is uncertainty whether or not circumcision is required, does not override Shabbat.
Rabbi Yehuda says: The circumcision of an androgynous overrides Shabbat, and if he is not circumcised, when he reaches majority he is punishable by karet. Rabbi Yehuda interprets the verse in the following manner: His definite foreskin overrides Shabbat; however, the circumcision of one born at twilight does not override Shabbat.
Medicine recognizes two types of androgynous. A true androgynous has both male and female sexual glands, while a Pseudohermaphrodite has the appearance of both male and female sexual organs, although the individual actually has only one set of sexual glands. According to the Sages, the challenge in both of these cases is that we cannot be certain that we are dealing with a male child who is obligated in the commandment of circumcision. Rabbi Yehuda agrees that in situations where it is not clear that there is an obligation to perform circumcision, e.g., if we are uncertain as to whether the baby was actually born on Shabbat, Shabbat cannot be overridden. Nevertheless he interprets the passage in Sefer Bereshit (17:10) as offering a broad requirement to circumcise “every male among you,” which, he argues, includes an androgynous.