Indian Penal Code 1860
Section 99 :
Acts against which there is no right of private defense:
(See section 37 of BNS 2023)
There is no right of private defense against an act which does not reasonably cause the apprehension of death or of grievous hurt, if done, or attempted to be done, by a public servant acting in good faith under color of his office, though that act may not be strictly justifiable by law.
There is no right of private defense against an act which does not reasonably cause the apprehension of death or of grievous hurt, if done, or attempted to be done, by the direction of a public servant acting in good faith under color of his office, though that direction may not be strictly justifiable by law.
There is no right of private defense in cases in which there is time to have recourse to the protection of the public authorities.
Extent to which the right may be exercised :
The right of private defense in no case extends to the inflicting of more harm than it is necessary to inflict for the purpose of defense.
Explanation 1 :
A person is not deprived of the right of private defense against an act done, or attempted to be done, by a public servant, as such, unless he knows or has reason to believe, that the person doing the act is such public servant.
Explanation 2 :
A person is not deprived of the right of private defense against an act done, or attempted to be done, by the direction of a public servant, unless he knows, or has reason to believe, that the person doing the act is acting by such direction, or unless such person states the authority under which he acts, or if he has authority in writing, unless he produces such authority, if demanded.