50 U.S. Code § 1885a - Procedures for implementing statutory defenses
(a) Requirement for certification
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(h) of this title directing such assistance;
(4) 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
(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—
(b) Judicial review
(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).
(c) Limitations on disclosure
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—
(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.
(d) Role of the parties
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.
(h) Relationship to other laws
Nothing in this section shall be construed to limit any otherwise available immunity, privilege, or defense under any other provision of law.