The UN Convention on Torture, signed on behalf of the United States by Ronald Reagan, is quite clear about this in Article 2:
No exceptional circumstances whatsoever, whether a state of war or a threat or war, internal political instability or any other public emergency, may be invoked as a justification of torture.Nor is it permissible to exempt from punishment the low-level underlings who administer the torture:
An order from a superior officer or a public authority may not be invoked as a justification of torture.The latter was the essence of the Nuremberg trials.