Notwithstanding any other provision of law, a civil action may not lie or be maintained in a Federal or State court against any person for providing assistance to an element of the intelligence community, and shall be promptly dismissed, if the Attorney General certifies to the district court of the United States in which such action is pending that—
(1) any assistance by that person was provided pursuant to an order of the court established under section 1803(a) of this title directing such assistance;
(2) any assistance by that person was provided pursuant to a certification in writing under section 2511(2)(a)(ii)(B) or 2709(b) of title 18;
(3) any assistance by that person was provided pursuant to a directive under section 1802(a)(4), 1805b(e), as added by section 2 of the Protect America Act of 2007 (Public Law 110–55), or 1881a(i) of this title directing such assistance;
in the case of a covered civil action, the assistance alleged to have been provided by the electronic communication service provider was—
(A) in connection with an intelligence activity involving communications that was— (i) authorized by the President during the period beginning on September 11, 2001, and ending on January 17, 2007; and (ii) designed to detect or prevent a terrorist attack, or activities in preparation for a terrorist attack, against the United States; and
(B) the subject of a written request or directive, or a series of written requests or directives, from the Attorney General or the head of an element of the intelligence community (or the deputy of such person) to the electronic communication service provider indicating that the activity was— (i) authorized by the President; and (ii) determined to be lawful; or
(5) the person did not provide the alleged assistance.
A certification under subsection (a) shall be given effect unless the court finds that such certification is not supported by substantial evidence provided to the court pursuant to this section.
(1) Review of certifications A certification under subsection (a) shall be given effect unless the court finds that such certification is not supported by substantial evidence provided to the court pursuant to this section.
(2) Supplemental materials In its review of a certification under subsection (a), the court may examine the court order, certification, written request, or directive described in subsection (a) and any relevant court order, certification, written request, or directive submitted pursuant to subsection (d).
If the Attorney General files a declaration under section 1746 of title 28 that disclosure of a certification made pursuant to subsection (a) or the supplemental materials provided pursuant to subsection (b) or (d) would harm the national security of the United States, the court shall—
(1) review such certification and the supplemental materials in camera and ex parte; and
(2) limit any public disclosure concerning such certification and the supplemental materials, including any public order following such in camera and ex parte review, to a statement as to whether the case is dismissed and a description of the legal standards that govern the order, without disclosing the paragraph of subsection (a) that is the basis for the certification.
Any plaintiff or defendant in a civil action may submit any relevant court order, certification, written request, or directive to the district court referred to in subsection (a) for review and shall be permitted to participate in the briefing or argument of any legal issue in a judicial proceeding conducted pursuant to this section, but only to the extent that such participation does not require the disclosure of classified information to such party. To the extent that classified information is relevant to the proceeding or would be revealed in the determination of an issue, the court shall review such information in camera and ex parte, and shall issue any part of the court’s written order that would reveal classified information in camera and ex parte and maintain such part under seal.
The authority and duties of the Attorney General under this section shall be performed by the Attorney General (or Acting Attorney General) or the Deputy Attorney General.
The courts of appeals shall have jurisdiction of appeals from interlocutory orders of the district courts of the United States granting or denying a motion to dismiss or for summary judgment under this section.
A civil action against a person for providing assistance to an element of the intelligence community that is brought in a State court shall be deemed to arise under the Constitution and laws of the United States and shall be removable under section 1441 of title 28.
Nothing in this section shall be construed to limit any otherwise available immunity, privilege, or defense under any other provision of law.
This section shall apply to a civil action pending on or filed after July 10, 2008.
(Pub. L. 95–511, title VIII, § 802, as added Pub. L. 110–261, title II, § 201, July 10, 2008, 122 Stat. 2468; amended Pub. L. 115–118, title I, § 101(b)(2)(A), Jan. 19, 2018, 132 Stat. 8.)