Chazal tells us (Midrash Rabbah Bereishis 64:4 and 95:3; Yoma 28b, based on. Gen. 26:5; Kiddushin 82a) that the Patriarchs observed the mitzvahs before they were given. But Avraham did not circumcize himself or his male household members until specifically commanded. Why did he wait?
From part of my answer here:
The Lubavitcher Rebbe (Likutei Sichot Volume 5, page 146) gives a very practical reason why Avraham waited to have a bris. Rashi explains that G-d's commandment to Noach after the flood, forbidding spilling a mans blood (Genesis 9:6) applies to spilling ones own blood as well. As such, Avraham was legally unable to circumcise himself until G-d explicitly commanded him to do so.
The בית הלוי explains (I forgot where) that you cannot have a one-sided contract. Therefore, even though Avraham kept all the מצוות before they were commanded, the מצוה of ברית מילה was untenable before Avraham was commanded, as the whole point is a ברית between 'ה and Avraham, and it wouldn't really be a contract without 'ה commanding Avraham.
The Riva (commentary on the Torah to the end of Pashas Lech Lecha) explains that Bris Milah is a mitzvah that can only be performed once a lifetime. Since the Gemora (Kiddushin 31a) concludes that it is preferable to keep something out of obligation rather than voluntarily, Abraham waited till he was commanded to fulfill the mitzvah in the best way possible.
To add to the question, according to Midrash Tanchuma (cited by Rashi on Vayera), Avraham was initially quite reluctant to perform brit milah and was persuaded to do so only after consulting Mamre.
in the plains of Mamre: He [Mamre] was the one who counseled him about circumcision. Therefore, He appeared to him [Abraham] in his [Mamre’s] territory. — [from Tan. Vayera 3]
This demonstrates that his lack of performing brit milah until now was no delay tactic. (This could be a question to the Riva's classic answer.)
Chazal do say, on occasion, that Avraham Avinu et al fulfilled all the mitzvot of the Torah, even unto Rabbinic decrees. There are many obvious exceptions, such as Avraham marrying two sisters, Avraham descending to Egypt, Yaakov marrying two sisters, the shevatim marrying their own twin sisters or else Canaanite women, and so on.
This might lead us to understand the midrashim in a more homiletic vein, or in a figurative vein.
However, many Rishonim took these midrashim absolutely literally, and that was the spark to creating brand new midrashim, which I don't believe reflected Chazal's intent, but still was a way of generating new Rabbinic output. And so I can understand the question of what classic answers were, from Rishonim and Acharonim, as to how to solve this problem. Though I think that some of the "problems" people come up with push the envelope, and that many of the resulting answers are more that ridiculous.
Looking at the Rashba, who propounds this idea of them keeping the Torah, he has a very sensible answer which would cover most exceptions. I translated it in this post. An excerpt:
And the patriarchs reached, with their great wisdom, to these fundamentals, just as Chazal said regarding Avraham that his two kidneys expressed to him chochma like two teachers. And so too all the patriarchs, such that Yehuda, who received from his fathers, kept the commandment of yibbum, even though he was not yet commanded upon it, and he commanded it to his son in that language itself that the Torah commands it, and this is via the aspect I have spoken.
And regarding that which Yaakov married two sisters, know that the Torah stands on three pillars:
The time, that not all days are forbidden in labor as on Shabbat and Yom Tov. And one is not prohibited in chametz like on Pesach. And one is not obligated in Succah and lulav like on Succot.
And the place, that not every place is obligated in terumah and maaser, and is prohibited in untithed foods, as in the land of Israel. And one is not obligated in sacrifices as in the Bet HaMikdash.
And vessels, that not with every possible item can one fulfill, in exchange for the lulav and etrog, and not every thing can one offer, like cattle and sheep, turtledoves and doves, and not everyone is fit to offer like a kohen. And I am not able to explain further, and one who contemplates the matter will find."
Obviously, where Hashem was eventually going to use this brit to establish a covenant, it was not the time for Avraham to have fulfilled beforehand. And Avraham would have intuited that.
I do like the Bet Halevi's answer, which seems to touch upon this idea.
The Maharsha (Yevamos 100b) explains that the statement that Avraham kept the entire Torah refers only to the time after he had the bris. (This is why he was permitted to marry Hagar although she was a first generation Egyptian - because it was before his bris).
The Lubavitcher Rebbe explains (Likkutey Sichos vol. 3 Parshas Lech Lecha - see here for an English rendition of the Sicha):
Although the Avos observed the entire Torah even before it was given, they were not able to permeate the physical world with the holiness of the mitzos they had performed. For example, the Zohar writes that the sticks Yaakov set before Lavan's sheep were his way of fulfilling the mitzvah of Tefillin - yet after he was done, those sticks remained ordinary physical pieces of wood. It was only after the Giving of the Torah that we have the ability to draw down holiness into physical objects.
However, since our observance of mitzvos is made possible through the actions of our forefathers, it was necessary that at least one mitzva performed by the Avos would resemble the mitzvos performed after the giving of the Torah in it's entirety, including the capacticty to infuse this world with holiness. The one mitzvah by which our Patriarchs drew down holiness into material existence was that of circumcision. This mitzvah would establish a connection between all the mitzvos the Patriarchs observed — even those with an effect only on the spiritual plane — and the mitzvos observed after the giving of the Torah. Through this connection, all of our Patriarchs’ mitzvos empower us to draw holiness into the material world.
We can thus understand why Avraham waited to perform the mitzvah of circumcision until he was commanded to do so by G‑d instead of observing it on his own initiative. Since this mitzvah resembles the mitzvos observed after the giving of the Torah, it was necessary for its observance to have been commanded by G‑d, and thus to be endowed with a measure of Divine influence.
This question is asked by the Toras Hamincha (a student of the Rashba) in his drashos (Lech L'cha drasha 8). Another student of the Rashba R. Yehoshua ibn Shu'aib writes that many have asked this question (parshas vayeira and drasha to Parshas Tzav / Shabbs Hagadol). He writes that some answered that Avraham refrained from doing so because the merit for a mitzva is greater if one is commanded in it and he knew that God would command him in the future so he held off until he was commanded. He quotes others who explain that without a divine command he wouldn't have circumcised himself, for by doing so was tampering with the form that God had granted him which would be an insult to God.
Naturally, these midrashim about keeping the mitzvot were not meant figuratively. And we cannot say the classic answer (Kiddushin 31a) that Gadol hametzuvah ve'oseh mimi she'eino metzuvah ve'oseh" -- "The one who is commanded and fulfills is greater than the one who fulfills without a command", such that Avraham deliberately waited. Nor will we say like any of these answers.
Avraham Avinu didn't wait. Since he knew it would be an eventual commandment, he gave himself a brit milah immediately, at the tender age of three years old, when he first recognized his Creator (see Nedarim 32). However, since Hashem now issued him this command, what he actually performed on himself and all his male household was hatafas dam bris, just as Yisro did when he circumcised himself (see Maharsha on Sanhedrin 94).