As we careen toward the end of a tumultuous year, President Trump and many of his supporters have put down their eggnog to launch attacks on the nation’s law enforcement structure.

By undermining the legitimacy of the front line institutions that uphold the law, these attacks threaten the rule of law itself. They have not yet succeeded and must not be allowed to do so.

Trump’s attacks appear driven by his compulsion to lash out at anything that threatens his presidency or his fragile ego. The pace and ferocity of Trump’s attacks often correlate with new developments in the Russia investigation. Recall that Trump and his lawyers predicted months ago that the investigation would wrap up by the end of the year. At year’s end, however, the investigation appears to be expanding and intensifying. We learned, for example, that Robert Mueller is looking into possible connections between the Trump campaign’s data operation and the Russians’ very precise targeting of social media attacks. We also got a whiff from The Washington Post that the White House is on the verge of panic about cooperator Michael Flynn. It reported that advisors are preparing an assault on Flynn’s credibility. Such an assault makes sense only if Mueller is about to act on the basis of Flynn’s cooperation, since denouncing Flynn prematurely as a liar will only incline Flynn to be more forthcoming with Mueller’s investigation. The leaking of this strategy occurred after a meeting between Mueller’s team and Trump’s attorneys. These circumstances suggest the possibility of a Mueller move in the near term, though past actions such as the completely unexpected Papadopoulos plea reveal that nobody outside the investigation knows for sure.

Trump’s Republican shock troops in Congress – assisted by the right-wing media echo chamber — have stepped up dramatically their assaults on Mueller and the FBI, alleging that both are so infected by bias that the entire investigation must be shut down. They appear driven largely by partisanship and self-preservation. They hail from districts in which Trump remains popular and fear nothing so much as a primary challenge from Trump’s core supporters. Staying on Trump’s good side is their best job insurance.

Their willingness to construct fabulous theories of anti-Trump bias is exceeded only by their ability to concoct extraordinary tales of FBI favoritism toward Hillary Clinton. Seriously? This is the the same FBI whose director shattered FBI and Justice Department tradition by publicly denouncing Clinton’s handling of classified information while exonerating her of criminal liability, sent a letter to Congress shortly before the election reopening the investigation to examine newly discovered emails before obtaining a warrant or determining whether they were relevant, and brought the story back to life days before the election with another letter to Congress revealing that there actually was no new evidence. Indeed, this was the director who told the world that candidate Clinton was under FBI investigation for her handling of emails while declining to mention that the Trump campaign was under investigation for colluding with Russia to win the presidency.

The facts, however, do not deter Trump’s supporters, who have gotten considerable mileage out of texts exchanged by two FBI agents who disparaged Trump. They ignore that the same agents also disparaged Democrats in their texts. They also ignore that Mueller booted one agent off the investigation when he learned of the texts in July. The other had already left. Trump’s supporters persist in claiming that the personal views of agents should disqualify them. One has even gone so far as to urge a “purge” of the FBI to remove agents on the basis of their political views.

Nothing could be more dangerous. The Constitution places the enormous power to prosecute in the executive branch of government. As Robert Jackson said: “The prosecutor has more control over life, liberty, and reputation than any other person in America.” While other societies lodge this power in independent agencies, for better or for worse, we have maintained an element of political control over prosecutions. To cabin political influence, however, a series of norms and laws have been implemented to ensure that political considerations don’t drive law enforcement.

One such norm is the erection of a wall between the White House and Justice Department that allows the president to set policy, but prevents him from launching investigations or prosecutions of individuals. A second is a requirement, enforced by custom, that investigators and prosecutors act in response to criminal conduct, rather than targeting an individual first and then looking for criminal actions. A society that allows the executive to employ criminal law as a weapon against opponents because they are opponents has abandoned the rule of law. Another essential norm is the requirement that FBI agents and Justice Department attorneys set aside their personal views when they take the oath of office to defend the Constitution. Candidates for these jobs are selected through highly competitive processes. Almost all successful candidates bring considerable knowledge of public affairs, which means that most bring well-formed opinions. Hiring qualified candidates precludes eliminating those with views. The safeguard is that they must be willing and able to make decisions based solely on law, facts, and the mission of the agency.

A complementary requirement – written into statute and Justice Department regulations – is that the Justice Department and FBI will not inquire into the personal political views of those they hire. This prohibition is an essential safeguard against politicizing law enforcement. The political hiring authorities cannot be permitted to select only candidates who share their political views and who will be expected to act in accordance with those views. The prohibition on inquiring into political views is essential to neutral enforcement of the law. The chilling suggestion that the administration should conduct a purge of the FBI to eliminate agents based on their political views springs directly from the playbook of autocratic strongmen. Putin and Erdogan would approve.

The ultimate measure of these safeguards is the quality of the product. That product is subject to rigorous testing. Investigations and recommendations to prosecute must survive strenuous internal scrutiny, including by leaders within the FBI and Justice Department, all of whom are now Republican appointees, including Deputy Attorney General Rod Rosenstein, FBI Director Chris Wray, and Special Counsel Mueller. Recommendations to prosecute that survive internal scrutiny must be approved by a grand jury and ultimately a judge and jury, if the matter gets that far.

We can be grateful that the rule of law has prevailed thus far. Law enforcement has persisted. The career investigators and attorneys, though threatened, have persisted. Courts have stood firm. The press has withstood withering attacks. And people have risen up in support of fundamental values, from the Women’s March shortly after Trump’s inauguration to recent stunning electoral victories in Virginia and Alabama. In less than a year, the country will have the opportunity to restore essential constitutional checks by electing a Congress that will reassert itself through conducting meaningful investigations, blocking dangerous legislation, stopping the confirmation of unqualified judges, and preventing the confirmation of another radically conservative Supreme Court justice. So, hang on and Happy New Year to all!

Bill Yeomans is the Senior Justice Fellow at Alliance for Justice. He currently serves as Lecturer in Law at Columbia Law School, and previously taught constitutional law, civil rights, and legislation at American University Washington College of Law. He also served for 26 years in the Department of Justice, where he litigated cases involving voting rights and discrimination in employment, housing, and education, and prosecuted police officers and racially motivated violent offenders before assuming a series of management positions, including acting Assistant Attorney General. For three years, Bill served as Sen. Edward M. Kennedy’s chief counsel on the Senate Judiciary Committee, and has also held positions at AFJ and the American Constitution Society.