As law enforcement digs deeper into Americans’ digital lives, tech companies and privacy advocates have been crying foul over the use of gag orders to hush up investigations. Now, in a rebuke to the U.S. government, a federal judge in Brooklyn has refused to issue orders that would have forbid Facebook and other internet companies from telling users that authorities had obtained their data.
In an unusual ruling published last week, U.S. Magistrate Judge James Orenstein objected to the Justice Department’s use of the same “boilerplate” language to justify gag orders in 15 different cases, and turned back the requests.
The gag orders at issue are not uncommon in criminal cases. They allow the FBI or other agencies to forbid internet companies from communicating with a third party, if doing so would compromise the investigation. For instance, a judge might grant a gag order if knowledge of an investigation might cause a suspect to flee or to intimidate a witness.
Get Data Sheet, Fortune’s technology newsletter.
In recent years, such gag orders have become more common. In response, tech companies and advocacy groups like the Electronic Frontier Foundation have sought to limit them on the grounds they prevent users from challenging, or even knowing about, intrusions on their privacy. In 2014, for instance, Twitter (TWTR) unsuccessfully fought to overturn a gag order attached to a grand jury subpoena.
In rejecting the gag order requests, the judge also told the government it could resubmit them with more details, and also expressed sympathy for the position of law enforcement:
“Government prosecutors and agents have a difficult time investigating crime, and one that is made more difficult by the fact that some of the investigative techniques they must rely on can backfire by alerting criminals to the fact of the investigation.”
But Orenstein also said judges ultimately require specific facts before they can take the drastic step of putting a gag order on the internet companies, and that boilerplate descriptions would not suffice.
The ruling also contains a curious discussion of a request by the government to ban Facebook (FB) from taking “certain actions” that could indirectly alert users that they might be under investigation. Orenstein says he won’t for now reveal what “actions” Facebook has been doing, but expressed skepticism that they would necessarily compromise an investigation.
The ruling also coincides with a broader debate over how to protect civil liberties in an age when people store vast amounts of personal information on digital devices and with companies like Facebook.
Should governments be able to see your Facebook data?
Judge Orenstein has also been at the center of another such fight, refusing to grant an order requiring Apple to unlock a criminal suspect’s iPhone. He is also associated with the so-called “Magistrate’s Revolt” in which magistrate judges, who oversee the granting of search warrants, have pushed back against perceived overreach by the government. (Another prominent magistrate judge, Paul Grewal, revealed last week he is stepping down to join from the bench to join Facebook).
Facebook and the Justice Department both declined to comment to the Wall Street Journal, which earlier reported the story.