In a too-little-noted ruling, the FBI has been granted new and vastly expanded surveillance powers, which will likely have profound and frightening implications in the upcoming Trump administration.

Before the new ruling, which took effect Dec. 1, a magistrate judge could issue warrants for the FBI to hack computers only within the few towns or counties of his or her jurisdiction. Now, the warrant of a single judge can allow the bureau to search online communications anywhere and everywhere in the United States, possibly even overseas.

There is logic to this ruling. In tracking down terrorists, child-porn purveyors, and other criminals who leave trails or do their mischief online, the FBI is often thwarted by the fact that the bad guys use “anonymizing” software to cover their tracks: It’s hard, if not impossible, to know where they are—and therefore to know which judge to ask for a warrant. The new ruling will allow warrants and searches to be granted without geographic restriction.

Even if the Justice Department were headed by a strong advocate for civil liberties, it would still be hard to impose discipline on gung-ho field agents keen to exploit the new ruling as license for fishing expeditions, scouring all streams of online traffic, no matter how slight the suspicion—especially once the agents know which judges are easy rubber stamps.

But with Jeff Sessions as Trump’s pick to be the next attorney general, it’s all but certain that the FBI will unfurl its surveillance wings wider, and in a more politicized direction, than any time since the days of J. Edgar Hoover. As a Republican senator from Alabama, Sessions called for more domestic surveillance, strict limits on encryption, requirements for firms to turn over all data without a warrant, and the defeat of all the post-Snowden National Security Agency reforms—including one, involving the remote storage of metadata files, that was endorsed by the NSA director.

The NSA is also likely to get more involved in domestic surveillance. Through a procedure called a “request for technical assistance,” the FBI can—and does—call upon the NSA to hack or tap the phones, servers, or networks of various bad guys (as long as they have a foreign connection) that are too wily for the bureau to monitor. And Sessions—if his current colleagues in the Senate confirm him—will play a role here, too. Each year, the director of the NSA submits a list of surveillance targets whose communications he would like to intercept under Section 702 of the Foreign Intelligence Surveillance Act Amendments Act. (That section allows the government to conduct electronic surveillance inside the United States, as long as the people communicating are “reasonably believed” to be outside the country.) This list is certified by—yes—the attorney general. (It is then approved by the FISA Court.) Under the same law, every 15 days after a new intercept begins, a special panel inside the Justice Department—appointed by, yes, the attorney general—reviews the operations to make sure they conforms to the list. And every six months, the—yes—attorney general informs the congressional intelligence committees on all issues of compliance. The idea behind all of these procedures is to ensure that the NSA is restrained by a higher legal power. But if the higher legal power wants to loosen restraints on surveillance, this hardly amounts to “oversight.”

In researching my book Dark Territory: The Secret History of Cyber War, I was surprised to learn that the NSA is packed with lawyers, who take their jobs seriously. For instance, when the Tsernaev brothers bombed the Boston Marathon, senior NSA officials were hauled before a congressional committee, whose members demanded to know why the metadata program hadn’t intercepted the brothers’ communications with Chechen terrorists. The officials replied that the court order restricted the NSA to trace metadata of just three international terrorist organizations. One of them was al-Qaida; none of them were Chechen.

However, all of these legal restraints—the FISA Court orders, the attorney general’s certifications, and the Justice Department’s testimony to Congress—are carried out under highly classified programs. And the restraints are enforced internally at the NSA, where everything is highly classified. If a rogue director wanted to clear out (or simply ignore) the lawyers, and if the attorney general gave him a nudge and a wink, there is little that anyone could do about it. Or, less nefariously, if the attorney general expanded the list of surveillance targets to include, say, all mosques (and everyone who communicated with a mosque and everyone who communicated with those people who communicated with a mosque …), or if he wanted to include the list to include anything he wanted it to include, that would be perfectly legal.

In 2013, President Obama appointed a five-man commission to investigate charges of abuse in the NSA and to propose reforms. After the report was published, to much fanfare (and the passage of a few of its reforms), the NSA invited one of its authors, Geoffrey Stone, a University of Chicago law professor, to come give a speech. Stone, who had written books on suppression of speech during wartime, began his lecture by noting that he’d approached the NSA with skepticism but was quickly impressed by its “high degree of integrity” and “deep commitment to the rule of law.” The agency had made mistakes, but they were rarely intentional acts of illegality. It wasn’t a rogue agency, as he’d suspected; it was doing what its political masters wanted and what the courts allowed.

Stone lavished praise a while longer, then took a sharp turn. “To be clear,” he said, “I am not saying that citizens should trust the NSA.” The agency needed to be held up to “constant and rigorous review.” Its work was “important to the safety of the nation,” but, by the nature of its intrusive technology, it posed “grave dangers” to American values. “I found, to my surprise, that the NSA deserves the respect and appreciation of the American people,” Stone summed up. “But it should never, ever, be trusted.”

That is doubly—triply—true, given that Attorney General Sessions’ review of the NSA is not likely to be very “constant and rigorous”—and given that Congress has rarely been vigilant on this front, either. And we’re talking not just about Jeff Sessions here. We’re also talking about the man who nominated him to the office, President-elect Donald Trump, who, during the campaign, while discussing charges that Russia had hacked into the files of his political opponent, said, “I wish I had that power. Man, that would be power.” Indeed, it would be.