NON-MONETARY STIPULATIONS AGAINST THE TORAH [Tanai: against Torah]
Gemara
(Mishnah): If one said 'I am a Nazir on condition that I may drink wine and become Tamei', he is a Nazir, with all the Isurim. If he said 'I knew about Nezirus, but I did not know that a Nazir is forbidden to drink wine', he is forbidden;
R. Shimon says, he is permitted;
(R. Yehoshua ben Levi): R. Shimon argues also in the Reisha.
(Ravina): R. Shimon agrees in the Reisha, because he stipulated contrary to Torah, and such a Tanai stipulation is void.
R. Yehoshua ben Levi holds that 'on condition' limits what he accepts. (This is unlike accepting Nezirus and stipulating that he will have a leniency.)
Support (for Ravina - Beraisa): If one said 'I am a Nazir on condition that I can drink wine and become Tamei', he is a Nazir with all the Isurim, because he stipulated contrary to Torah, and such a Tanai is void.
Kesuvos 56a (Beraisa - R. Meir): If one was Mekadesh a woman on condition that he is exempt from giving to her food, clothing or Onah (the proper frequency of Bi'ah), the Kidushin takes effect and his Tanai is void;
R. Yehudah says, in monetary matters the Tanai is valid.
83a (Mishnah): If a man wrote to his wife 'I have no claim in your property ... and after your death ... and he does not inherit her;
R. Shimon ben Gamliel says, he inherits her, because any Tanai contrary to Torah is void.
83b (Rav): The Halachah follows R. Shimon, but not for his reason.
84a: R. Shimon holds that a husband inherits mid'Oraisa, and a Tanai contrary to Torah is void. Rav holds that the inheritance is mid'Rabanan, and Chachamim strengthened their enactments as much as Torah law.
Menachos 109a (Mishnah): If one vowed to bring an Olah on condition to offer it in Beis Chonyo (a place in Alexandria where certain Kohanim offered Korbanos), he must offer it in the Mikdash. If he offered it in Beis Chonyo, he was Yotzei.
Question: Why was he Yotzei? (A Korban slaughtered outside the Mikdash is Pasul,) it is as if it was killed (without slaughter)!
Answer #1 (Rav Hamnuna): It is as if he stipulated that he has no Acharayos (responsibility to bring another if this animal is disqualified).
Answer #2 (Rava): He did not intend for a real Korban, rather, a mere 'gift' to Hash-m. He did not accept the exertion of offering in the Mikdash. (E.g. he is closer to Beis Chonyo than to the Mikdash.)
Support (for Rav Hamnuna - R. Yochanan): If one said 'Alai Olah on condition to offer it in Beis Chonyo', and he offered it outside the Mikdash, he was Yotzei (his vow). He gets Kares (for offering outside the Mikdash, for it is a real Korban).
Support (for R. Yochanan - Beraisa): If one vowed to offer a Olah it in the Midbar, and he offered it in Ever ha'Yarden, he was Yotzei. He is Chayav Kares.
Rishonim
Rambam (Hilchos Nezirus 1:13): If one accepted Nezirus 'on condition that I may drink wine' or '...I may become Tamei' or 'I may cut my hair', he is a Nazir, with all the Isurim, because he stipulated contrary to Torah, and this is void.
Rambam (Hilchos Ma'aseh ha'Korbanos 14:7): If one made a house outside the Mikdash for offering Korbanos, and vowed to offer a Korban there, if he offered it there or in the Mikdash he was Yotzei. He is like one who was Makdish an Olah without Acharayos. He is Chayav Kares for offering it outside the Mikdash. Similarly, if one accepted to be a Nazir on condition that he shave (and bring Korbanos) in this house, if he shaved there he was Yotzei. He is like one who vowed to pain himself. He pained himself; he was not a Nazir.
Ri Korkus: Even though regarding Korbanos the Halachah does not follow Rava, who says that it is not a real Korban, regarding Nezirus the Halachah follows Rava, who says that he is not a Nazir.
(Hilchos Matanos Aniyim 5:8): If one said 'I harvest on condition that I will take what I forget, what he forgets is Shichchah (it must be left for the poor), for any Tanai contrary to Torah is void.
Pnei Moshe (Yerushalmi Pe'ah Sof Perek 6): Only a monetary Tanai is valid. One cannot stipulate about a Mitzvah.
Question (R. Akiva Eiger Pe'ah 6 (69)): Why did the Bartenura need to say (like the Rambam) that the Tanai is void because it is contrary to Torah? Even if normally such Tanayim were valid, that is only when one does an action on condition. If the Tanai will not be fulfilled, the action will not take effect. Here, there is no one with whom to stipulate! If the Tanai is not fulfilled, can we say that the harvest was invalid?! Regarding a loan or sale to Levi on Tanai that 'you will not Meshamet (cancel it in Shemitah)' or 'you will not claim Ona'ah (the overcharge)', we can say that if it is not fulfilled the money was a deposit, or was not a sale. Alternatively, perhaps these are not Tanayim. Rather, Levi agreed to waive his right to cancel the loan or claim Ona'ah. However, Tosfos (Kesuvos 56a DH Harei) asked about Tanai Kaful, i.e. he holds that it is a proper Tanai. This requires investigation.
Poskim
Rema (EH 38:5): Any Tanai about a non-monetary matter is void. Some say that anything that Chachamim decreed about is like something explicit in Torah.
Beis Shmuel (13): The Mordechai derives this from Rav, who rules that a Tanai not to inherit one's wife is void. However, all Poskim disagree. They say that a Tanai after Nisu'in does not help, just like a son cannot stipulate not to inherit his father. Why does the Rema rule like the Mordechai, against the Poskim?! All agree that a Tanai about Onah (conjugal rights) does not help, even though a woman can pardon her Onah (on any occasion).
Gra (10): The Halachah does not follow Rav. I.e. we hold that monetary Tanayim are valid even against Torah law. However, the inference that a non-monetary Tanai is void, even regarding mid'Rabanan laws, is true.