This past weekend, President Donald Trump and the most visible member of his legal team, former New York Mayor Rudolph Giuliani, fired up their campaign against special counsel Robert Mueller. They attacked people at the Department of Justice whom Trump appointed. They smeared career DOJ lawyers and FBI agents by offering allegations without showing any supporting evidence. And they purported to challenge the legitimacy of Mueller's office itself.

The legitimacy question is an opinion Giuliani offered six times to my colleague Bill Hemmer on "Fox News Sunday." Surely, Giuliani is entitled to any opinion on any matter, but he must know that his illegitimacy opinion is baseless. Mueller's work, though a constant irritant to Trump, is quite legitimate. It is authorized by the Federal Rules of Criminal Procedure, which were approved by Congress. It was created by Deputy Attorney General Rod Rosenstein, a Trump appointee. It has been ratified by six different federal judges.

The president himself has even accepted the legitimacy of some of Mueller's work. Trump unilaterally imposed financial sanctions on the Russian intelligence agents whom one of Mueller's grand juries indicted for computer hacking and other crimes allegedly committed during the 2016 election.

The recent claim by Trump and Giuliani that the investigatory process is rigged against Trump betrays insincerity by Giuliani and an effort to gin up the base by Trump. From his years as a federal prosecutor, Giuliani knows the prosecutorial mindset. It is not one of patiently examining law and facts to ascertain guilt or innocence. That is the judicial mindset.

Prosecutors target folks they believe are guilty and then look for enough lawfully acquired evidence to prove guilt. That is a legitimate use of government assets -- a use geared to charging defendants, not evaluating their moral worth for high office.

One of the tools available to prosecutors -- and often used in white-collar cases -- is to dispatch a friendly person to chat with those at the periphery of an investigation to see whether any spoken words can lead prosecutors to credible evidence. This process of using an informant to gather evidence is so stunningly normal that it ought not even be of note. That's often how criminal investigations of nonviolent crimes begin -- with conversations between intermediaries who spill the beans.

One of the most successful practitioners of this technique was a U.S. attorney in Manhattan named Rudy Giuliani. Today, as the spokesman for Trump's defense team, Giuliani is condemning this process he once perfected -- a process he knows to be lawful -- and he is doing this by calling the intermediary not an informant but a spy. Calling an informant a spy depends on where you sit. When he is your guy, he's an informant. When he is the other side's guy, he's a spy.

The Giuliani claim -- unsupported by any public evidence -- is that the Obama administration sent an unnamed FBI undercover agent to inveigle the inner circle of the Trump campaign. If this is true and if it was done without a search warrant, it was a monumental violation of the civil rights of Trump campaign officials, including those of the man who would become the president. But Giuliani has shown no evidence for this.

How did we get here?

All of this spying and informing -- this mishmash of law enforcement and intelligence gathering -- is today the byproduct of the federal government's post-9/11 mentality. Before 9/11, the CIA gathered intelligence from outside the U.S., and the National Security Agency gathered intelligence from inside the U.S. The FBI constitutionally, for the most part, gathered evidence of crimes.

Pre-9/11, the intelligence community and the law enforcement community were prohibited from communicating with each other, for well-grounded historical and practical reasons. Because the intelligence community uses unconstitutional and often unlawful means to acquire data and because law enforcement must use constitutional and lawful means to acquire evidence for a court not to suppress it, they did not exchange notes.

But pursuant to the commands of the wildly unconstitutional Patriot Act (six federal judges have held portions of it unconstitutional), the intelligence community and law enforcement began blending their work.

FBI agents soon realized that by portraying their work as intelligence gathering and not emphasizing the law enforcement aspects, they could go to a different court -- the FISA court, with its unconstitutionally low bar for obtaining a search warrant (namely, probable cause of speaking to a foreign person) -- to get search warrants. This proved far easier than obtaining a constitutional search warrant, which requires probable cause of a crime. An easier warrant means less work. That was a temptation too great to resist.

The intelligence community soon realized it could share with law enforcement what it found by spying on Americans, in return for law enforcement's looking the other way at the lawlessness of domestic spying. All of this produced a cowboy culture of utter disregard for constitutional norms in much of federal law enforcement and domestic intelligence gathering.

This is a form of corruption -- the knowing governmental violation of constitutional norms and the intentional toleration of it, set below the radar.

Now back to Trump and Giuliani. If they are successful, they will have assaulted the rule of law by persuading the public to accept innuendo and known untruths. I am often on the side of the individual against the government, but if legitimate law enforcement has been or is undermined for political purposes, whether by President Barack Obama in 2016 or by President Trump in 2018, all of us will suffer from more corruption.

Giuliani's job is not to be Trump's lawyer; rather, it is to effect public sentiment. For the government, as Abraham Lincoln once said, with public sentiment, nothing can fail; without it, nothing can succeed. Trump and Giuliani understand that better than they understand the rule of law.