Bhagavad Gita Chapter 17
Powerful Cognition
Only when it is in the nature of total surrender, with no expectation of any results, it is in satva and of spiritual value.
mūḍhagrāheṇātmano yat pīḍayā kriyate tapaḥ parasyotsādanārthaṁ vā tattāmasamudāhṛtam
Austerity performed with foolish stubbornness or with self-torture or for harming others, is said to be in the mode of ignorance