(a) Prohibition on warrantless queries
(1) Prohibition
Section 702(f) (50 U.S.C. 1881a(f)) is amended by inserting after paragraph (1) the following new paragraph (2):
(2) Prohibition on warrantless queries for the communications and other information of United States persons
(A) In general Except as provided in subparagraphs (B) and (C), no officer or employee of the United States may conduct a covered query of information acquired under this section in an effort to find the contents of communications or information of or about 1 or more United States persons.
(B) Exceptions for concurrent authorization, consent, emergency situations, and certain defensive cybersecurity queries
(i) In general Subparagraph (A) shall not apply to a query related to a United States person if—
(I) such person is the subject of an order or emergency authorization authorizing electronic surveillance under section 105 or a physical search under section 304, or a warrant issued pursuant to the Federal Rules of Criminal Procedure by a court of competent jurisdiction authorizing the conduct of the query;
(II) the officer or employee carrying out the query has a reasonable belief that—
(aa) an emergency exists involving an imminent threat of death or serious bodily harm; and
(bb) in order to prevent or mitigate this threat, the query must be conducted before authorization pursuant to subclause (I) can, with due diligence, be obtained;
(III) such person or, if such person is incapable of providing consent, a third party legally authorized to consent on behalf of such person, has provided consent to the query on a case-by-case basis; or
(aa) the query uses a known cybersecurity threat signature as a query term;
(bb) the query is conducted, and the results of the query are used, for the sole purpose of identifying targeted recipients of malicious software and preventing or mitigating harm from such malicious software; and
(cc) no additional contents of communications retrieved as a result of the query are accessed or reviewed.
(IV)