Section 31 BNS or Section 31 of Bharatiya Nyaya Sanhita talks about "Communication made in good faith."
Section 31 of BNS is part of CHAPTER III GENERAL EXCEPTIONS in Bharatiya Nyaya Sanhita 2023 Act
Definition of Section 31 BNS
No communication made in good faith is an offence by reason of any harm to the person to whom it is made, if it is made for the benefit of that person.
Illustration.
A, a surgeon, in good faith, communicates to a patient his opinion that he cannot live. The patient dies in consequence of the shock. A has committed no offence, though he knew it to be likely that the communication might cause the patient’s death.