42 USC § 2000dd–1. Protection of United States Government personnel engaged in authorized interrogations
(a) Protection of United States Government personnel
In any civil action or criminal prosecution against an officer, employee, member of the Armed Forces, or other agent of the United States Government who is a United States person, arising out of the officer, employee, member of the Armed Forces, or other agent's engaging in specific operational practices, that involve detention and interrogation of aliens who the President or his designees have determined are believed to be engaged in or associated with international terrorist activity that poses a serious, continuing threat to the United States, its interests, or its allies, and that were officially authorized and determined to be lawful at the time that they were conducted, it shall be a defense that such officer, employee, member of the Armed Forces, or other agent did not know that the practices were unlawful and a person of ordinary sense and understanding would not know the practices were unlawful. Good faith reliance on advice of counsel should be an important factor, among others, to consider in assessing whether a person of ordinary sense and understanding would have known the practices to be unlawful. Nothing in this section shall be construed to limit or extinguish any defense or protection otherwise available to any person or entity from suit, civil or criminal liability, or damages, or to provide immunity from prosecution for any criminal offense by the proper authorities.
The United States Government shall provide or employ counsel, and pay counsel fees, court costs, bail, and other expenses incident to the representation of an officer, employee, member of the Armed Forces, or other agent described in subsection (a), with respect to any civil action or criminal prosecution or investigation arising out of practices described in that subsection, whether before United States courts or agencies, foreign courts or agencies, or international courts or agencies, under the same conditions, and to the same extent, to which such services and payments are authorized under section 1037 of title 10.
(Pub. L. 109–148, div. A, title X, §1004, Dec. 30, 2005, 119 Stat. 2740; Pub. L. 109–163, div. A, title XIV, §1404, Jan. 6, 2006, 119 Stat. 3475; Pub. L. 109–366, §8(a), Oct. 17, 2006, 120 Stat. 2636; Pub. L. 110–181, div. A, title X, §1063(d)(1), Jan. 28, 2008, 122 Stat. 323; Pub. L. 110–417, [div. A], title X, §1061(b)(10), Oct. 14, 2008, 122 Stat. 4613.)