An independent lawyer assigned to represent Americans' privacy interests before the nation's top-secret spy court failed to persuade a judge to block FBI agents from searching intelligence databases to hunt for evidence of traditional crimes rather than restricting them to national security probes, according to a newly declassified court opinion.
The ruling released Tuesday provides one of the first glimpses into how a 2015 bipartisan law aiming at reining in government intelligence-gathering is being implemented at the Foreign Intelligence Surveillance Court, which oversees requests for surveillance warrants from law enforcement agencies involving suspects inside the U.S.
In the aftermath of domestic surveillance programs exposed by former National Security Agency contractor Edward Snowden, Congress last year passed the USA Freedom Act, which allowed certain information-gathering practices to continue, but created a privacy advocate to represent the public interest.
The newly released documents also reveal that the FBI is storing encrypted communications it has obtained in intelligence investigations until they can be decrypted and analyzed by specialists.
The Nov. 6 opinion by Thomas F. Hogan, the chief judge of the FISA court, reauthorized a long-standing government spying effort known as the "702 program," which targets electronic communications of those believed to be foreigners living abroad.
Hogan ruled that the nation's spy agencies and the FBI were following proper procedures in how they selected targets for surveillance, gathered intelligence data and later mined it.
The communications data collected under Section 702 of the Foreign Intelligence Surveillance Act ranges from phone numbers and email addresses to the content of calls and messages in the possession of U.S. telecommunications and Internet companies.
FISA judges have approved the spying effort each time it has been submitted for review since 2008. But Hogan's 80-page opinion was the first to rely on advice from an outside privacy advocate, known as an amicus curae, to help him determine the legality of the initiative.
The advocate was attorney Amy Jeffress, a former top national security prosecutor at the Justice Department who is now a defense attorney in Washington.
Giving judges the ability to tap such a lawyer for advice was a key element of the 2015 reform measure to address criticism that only the government's position was being heard in the ultra-secretive court.
It is only the second publicly disclosed instance in which the court has used an outside lawyer to examine an aspect of the government's spying programs.
Last September, the court asked attorney Preston Burton to examine whether the government could retain bulk telephone metadata that it had been told to destroy. Investigators wanted to keep the data for an extra few months so it could ensure the accuracy of information it would attain under the more targeted procedures enacted last year by Congress. Burton agreed that it was permissible to do so.
In August, Hogan asked Jeffress to address whether the spy agencies and FBI were setting proper boundaries in how they gathered intelligence, as well as how they retained and searched the data, according to the judge's redacted opinion.
Jeffress generally agreed that the spy agencies and FBI were following proper procedures in targeting those they believed to be non-U.S. citizens living abroad.
However, she raised concerns about how the FBI queries the sensitive data in its hunt for those who may have committed crimes unrelated to national security matters. She felt the FBI was restricted by law from conducting such searches.
The FBI's procedures "go far beyond the purpose for which the Section 702-acquired information is collected in permitting queries that are unrelated to national security," Jeffress argued, according to the judge's opinion.
Hogan disagreed, however, writing that the law clearly permitted FBI agents to search databases for such purposes. He added that such searches rarely generate a link to criminal activity.
"The risks that the results of such a query will be viewed or otherwise used in connection with an investigation that is unrelated to national security appears to be remote, if not entirely theoretical," Hogan wrote. "The court is not prepared to find a constitutional deficiency based upon a hypothetical problem."
Even so, the judge ordered the government to report "any instance in which FBI personnel receive and review" intelligence information that the "FBI identifies as concerning a United States person in response to a query that is not designed to find and extract foreign intelligence information."
The FBI's use of FISA-obtained data to help in criminal investigations is an issue that has long troubled civil liberties groups. They are particularly concerned that communications involving innocent Americans might be unintentionally swept up and stored in vast government databases only to be later linked to an alleged crime.
"It's clear that the government's conversion of a spying program that is justified on terrorism and foreign intelligence grounds into a tool for investigating ordinary crimes is one that raises deep constitutional concerns," said Patrick Toomey, a lawyer for the ACLU. "This is what the slippery slope looks like. The government claims sweeping new surveillance authority in the name of fighting terrorism and then starts using it in routine criminal investigations."
Jeffress declined to comment, as did Marc Raimondi, a Justice Department spokesman.
Hogan's opinion also disclosed that the FBI is grappling with breaking into encrypted communications, an issue that was brought to light recently when the government persuaded a federal judge to order Apple to unlock an iPhone used by one of the terrorists in the San Bernardino attacks.
The FBI ultimately dropped the case when it was approached by an unidentified third-party that was able to bypass Apple's security on the phone, allowing the bureau to download its contents. A law enforcement official, speaking on condition of anonymity, said nothing of significance was found on the device.
In the opinion, Hogan noted that the FBI has been storing encrypted communications until government analysts can find a way to access and read them. Once the information is decrypted, Hogan wrote, the data will then become subject to the government's retention and deletion timetables.
Law enforcement officials say they need tech companies' help to access encrypted devices and messages to investigate crimes and stop potential terrorist attacks. Privacy advocates and technology firms say creating backdoors into products would expose customers' data to hackers and foreign governments.