; and (B) in section 3124— (i) by amending subsection (d) to read as follows: (d) No cause of action against a provider disclosing information under this chapter No cause of action shall lie in any court against any provider of a wire or electronic communication service, its officers, employees, agents, or other specified persons for providing information, facilities, or assistance in accordance with a court order under this chapter, request pursuant to section 3125 of this title, or an order from a foreign government that is subject to an executive agreement that the Attorney General has determined and certified to Congress satisfies section 2523. ; and (ii) by amending subsection (e) to read as follows: (e) Defense A good faith reliance on a court order under this chapter, a request pursuant to section 3125 of this title, a legislative authorization, a statutory authorization, or a good faith determination that the conduct complained of was permitted by an order from a foreign government that is subject to executive agreement that the Attorney General has determined and certified to Congress satisfies section 2523, is a complete defense against any civil or criminal action brought under this chapter or any other law. . 5. Executive agreements on access to data by foreign governments (a) In general Chapter 119 of title 18, United States Code, is amended by adding at the end the following: 2523. Executive agreements on access to data by foreign governments (a) Definitions In this section— (1) the term lawfully admitted for permanent residence has the meaning given the term in section 101(a) of the Immigration and Nationality Act ( 8 U.S.C. 1101(a) )