A judge in Washington, D.C., has stepped in to limit the government's search of Facebook accounts in connection with a criminal investigation into protests during President Donald Trump's inauguration.

In a decision made public Monday, D.C. Superior Court Chief Judge Robert Morin ruled the government's law enforcement needs should be balanced with the Fourth and First amendment rights of innocent Facebook users. The judge imposed safeguards on the process, such as requiring the government to file reports under seal about its search protocols in order to limit the exposure of innocent users' personal and political communications.

“Given the potential breadth, the warrants in their execution may intrude upon the lawful and otherwise innocuous online expression of innocent users,” Morin wrote. “Therefore, the court deems it appropriate in this case to implement procedural safeguards to preserve the First Amendment and Fourth Amendment freedoms at stake and ensure that only data containing potential incriminating evidence is disclosed to the government.”

The U.S. Attorney's Office wants to search three Facebook accounts—two belonging to individual users and the official page for the group DisruptJ20, which organized the protests—for incriminating evidence related to rioting in Washington, D.C., on Jan. 20. The American Civil Liberties Union moved to intervene in the case in September on behalf of the account holders, asking the court to block the three warrants. The account holders themselves have not been charged with any crimes.

In a hearing last month, Morin asked Facebook attorney John Roche of Perkins Coie to consult with the company and report back on how capable it is of limiting information handed to the government. In his Nov. 9 order, Morin wrote that law enforcement should be able to execute the safeguards “based on Facebook's technological capabilities.”

For the two individual accounts, Morin ordered Facebook to redact any identifying information of people who received Facebook messages from the account, who liked or friended the particular account holder, and other information not “directly” related to the account holder. The government should then review the redacted information and file any requests for the identifying information under seal, along with an explanation for why the information should be revealed.

A spokesman for the U.S. Attorney's Office in D.C. declined to comment. In a statement, Scott Michelman, an ACLU senior staff attorney, said he is disappointed the judge will allow the government to search the individual account holders' pages in full.

“The court agreed to impose safeguards to protect political activity and third-party communications from government snooping, but was not equally careful to protect our clients' private and personal communications,” Michelman said. “Our clients, who have not been charged with any crime, expect that when they send private Facebook messages about, for instance, their medical history or traumatic events in their lives, those messages will remain private unless the government shows probable cause to search those particular messages, which it has not done.”

For the group page, the judge ordered the government to file a sealed report with the court explaining how it plans to search the account and avoid uncovering data not pertinent to the crimes it's investigating. Should the court approve the protocols, the government can then conduct its search on a redacted data set that does not include non-account holder identifying information. After the review, the government will file another sealed report explaining what data it wants to seize, and the court will decide if its plans are acceptable.

The rules are similar to those Morin imposed on the government's search of the website hosting company DreamHost, which hosted the DisruptJ20 website. That company also fought government warrants, claiming they were too broad and infringed on its users' First and Fourth amendment rights.

Lastly, despite limiting the searches, the judge denied the ACLU's motion to intervene in the case. He said the individual account holders already had the opportunity to protect their interests, but because Facebook had yet to produce the information, they had yet to be aggrieved by the search. Thus, Morin reasoned, they could not appeal his ruling.

“Since account holders have had robust involvement before this court, the only conceivable benefit is a speculative opportunity to appeal this court's order, which the court does not determine to be a sufficient reason to circumvent the normal processes concerning the enforcement of search warrants,” Morin wrote.