This week I took part in a debate on the question "Does the Russia investigation endanger the rule of law?" I said yes, and here is why:

First, a caveat: If "endanger the rule of law" means "destroys our legal order and threatens our democracy," then no, I don't think the Trump-Russia investigation does that. But if it means "involves our nation's most powerful law enforcement and intelligence agencies in reckless political conduct that undermines our system of elections and the orderly transfer of power," then yes, the Trump-Russia investigation does, in fact, endanger the rule of law.

Two incidents from 2016 and early 2017 point to the danger posed by overzealous Trump-Russia investigators.

The first is that the Justice Department used the Logan Act, which bars private Americans from conducting foreign policy, as a pretense to pursue an investigation against the Trump team.

The Logan Act was passed in 1799 and has never been used to successfully prosecute anybody. No one has even tried since the 19th Century. It is, by any practical measure, dead — look up the legal concept of "desuetude."

And yet, in the summer of 2016, some prominent Democrats began accusing then-candidate Donald Trump of violating the Logan Act. They said he broke the law by sarcastically encouraging Russia to release Hillary Clinton's famous deleted emails. Several called for hearings.

Then, after Trump's victory, stunned and angry Democrats watched him prepare for the presidency — and prepare to undo many of former President Barack Obama's policies.

Democratic Rep. Jared Huffman of California introduced the One President at a Time Act of 2016 which would specifically subject presidents-elect to the Logan Act. Rep. John Conyers of Michigan, then the top Democrat on the House Judiciary Committee, asked the Justice Department to investigate Trump for a possible violation of the Logan Act.

All of that was just political posturing — not a threat to the rule of law. But unbeknownst to the public, the Obama Justice Department was using the Logan Act as a pretext to take action against the incoming administration.

When intelligence intercepts picked up Michael Flynn, the new national security adviser, talking to the Russian ambassador in late December, the Obama Justice Department saw that as a possible violation of the Logan Act. (It wasn't; many foreign policy experts saw nothing wrong with that.)

Nevertheless, four days into the Trump administration, Sally Yates, the Obama holdover leading the Justice Department, sent agents to the White House to question Flynn, ostensibly on the suspicion that he might have violated the Logan Act. (She also said she was worried that Flynn might be subject to blackmail, which seemed at least as dubious as a Logan Act violation.)

It was that interview that ultimately resulted in Flynn pleading guilty to one count of lying to the FBI.

The bottom line is, the Flynn saga, which is at the heart of the Trump-Russia investigation, appears to have hinged on a trumped-up suspicion that a new administration had broken a centuries-old law that has never been prosecuted before — when in fact, the new administration's real transgression was to make clear it would throw away many of its predecessor's policies.

The second incident that suggests the Trump investigation threatens the rule of law is the FBI's use of the Trump dossier — a Clinton campaign opposition research product — as a part of its counterintelligence investigation into the Trump campaign.

To compile the dossier, a Democratic law firm hired the oppo research group Fusion GPS, which hired a former British spy named Christopher Steele, who paid a number of Russian "collectors," who then talked to other Russians, who provided gossip about Trump. The most spectacular gossip is the dossier's description of Trump, in a Moscow hotel room in 2013, watching as prostitutes play out a kinky sex scene.

Steele took his material to the FBI, and the bureau agreed to pay Steele to keep gathering dirt on Trump — an astonishing development in the midst of a presidential election.

And even though the pay-for-dirt deal fell through, the FBI still incorporated the dossier into its Trump-Russia investigation. It was used as the basis to ask a secret court to grant a warrant to wiretap an American, Carter Page, in October 2016.

Now fast forward to the transition. In early January 2017, intelligence chiefs James Comey, John Brennan, Mike Rogers, and James Clapper traveled to Trump Tower to brief the president-elect on Russian efforts to interfere with the 2016 campaign.

After the briefing, by a plan they devised earlier, three of them left the room, leaving Comey alone with Trump. Comey gave Trump a summary of the dossier, including the Moscow sex scene.

Imagine that. The very first time the incoming president met the FBI director face to face, the FBI's message was: We know about you and those hookers in Moscow.

In their new book Russian Roulette, authors Michael Isikoff and David Corn report Trump thought the FBI was blackmailing him:

"Trump had seen this sort of thing before," they write. "Certainly, his old mentor Roy Cohn — the notorious fixer for mobsters and crooked pols — knew how this worked. So too did Comey's famous predecessor J. Edgar Hoover, who had quietly let it be known to politicians and celebrities that he possessed information that could destroy their careers in a New York minute."

The intel chiefs' briefing of Trump soon leaked to the media. And the fact that top officials had seen fit to tell the incoming president about the dossier made it a legitimate news story. Within hours, BuzzFeed published the entire dossier on the Internet.

As Senate Minority Leader Chuck Schumer, D-N.Y., said as all this was happening: "You take on the intelligence community, they have six ways from Sunday of getting back at you."

With the Logan Act, Obama holdovers used a dead law as a pretense to push the Trump investigation. With the dossier, they used unverified opposition research not only to investigate the Trump campaign but to execute a clever maneuver to make the dirt public.

And this was all done by the nation's top law enforcement and intelligence officials, targeting a new president. So yes, it is reasonable to say the Trump-Russia investigation endangers the rule of law.