The Talmud debates whether a person is permitted to injure himself. R. Akiva's view (adopted in halacha) is that one may NOT injure oneself even with one's own consent — the classic Talmudic source for the issur of chavalah b'atzmo.
וְקָתָנֵי: הַחוֹבֵל בְּעַצְמוֹ, אַף עַל פִּי שֶׁאֵינוֹ רַשַּׁאי – פָּטוּר! הָכִי קָאָמַר לֵיהּ: לָא מִבַּעְיָא בּוֹשֶׁת, דְּאָדָם רַשַּׁאי לְבַיֵּישׁ אֶת עַצְמוֹ; אֶלָּא אֲפִילּוּ חֲבָלָה, דְּאֵין אָדָם רַשַּׁאי לְחַבֵּל בְּעַצְמוֹ – אֲחֵרִים שֶׁחָבְלוּ בּוֹ, חַיָּיבִין. וְאֵין אָדָם רַשַּׁאי לְחַבֵּל בְּעַצְמוֹ? וְהָתַנְיָא: יָכוֹל נִשְׁבַּע לְהָרַע בְּעַצְמוֹ – וְלֹא הֵרַע, יְהֵא פָּטוּר? תַּלְמוּד לוֹמַר: ״לְהָרַע אוֹ לְהֵטִיב״ – מָה הֲטָבָה רְשׁוּת, אַף הֲרָעָה רְשׁוּת; אָבִיא נִשְׁבָּע לְהָרַע בְּעַצְמוֹ וְלֹא הֵרַע!
and it teaches: With regard to one who injures himself, although it is not permitted for him to do so, he is nevertheless exempt from any sort of penalty, indicating that the prohibition is in effect even with regard to humiliation. The Gemara answers: This is what Rabbi Akiva said to the man: It is not necessary to say with regard to humiliation, where it is permitted for a person to humiliate himself, that someone else who humiliated him is liable. But even with regard to injury, where it is not permitted for a person to injure himself, others who injured him are liable. § The Gemara discusses whether it is permitted to injure oneself. And is a person not permitted to injure himself? But isn’t it taught in a baraita: One might have thought that if one takes an oath to do evil to himself and did not do evil he will be exempt from bringing an offering for having transgressed this oath. Therefore, the verse states: “Or if anyone swear clearly with his lips to do evil or to do good” (Leviticus 5:4), which teaches that just as taking an oath to do good for which one is liable is referring to an optional activity, as opposed to taking an oath to perform a mitzva, so too, taking an oath to do evil is referring to an optional activity, as opposed to taking an oath to transgress. I can therefore include within the category of one who is liable if he transgressed his oath the person who takes an oath to do evil to himself and did not do evil. It is clear from this baraita that doing evil to oneself is permitted.