The FBI faced a national security nightmare three years ago: It suspected that the new president of the United States was, in some unknown way, in the sway of Russia.

Was an agent of a foreign power in the White House? Should they investigate Donald Trump? “I can’t tell you how ominous and stressful those days were,” Peter Strzok, then the No. 2 man in FBI counterintelligence, told me. “Similar to the Cuban missile crisis, in a domestic counterintelligence sense.”

But the Cuban missile crisis lasted only 13 days — and it had a happy ending. This crisis has no end in sight. Despite the investigation by former special counsel Robert S. Mueller III, despite the work of congressional intelligence committees and inspectors general — and despite impeachment — we still don’t know why the president kowtows to Vladimir Putin, broadcasts Russian disinformation, bends foreign policy to suit the Kremlin and brushes off reports of Russians bounty-hunting American soldiers. We still don’t know whether Putin has something on him. And we need to know the answers — urgently. Knowing could be devastating. Not knowing is far worse. Not knowing is a threat to a functioning democracy.

The FBI’s counterintelligence agents wondered: Why did Trump invite the Russian ambassador and the Russian foreign minister into the Oval Office on the day after he keelhauled FBI Director James B. Comey — and brag about it? “I just fired the head of the FBI,” Trump told them in confidence. “I faced great pressure because of Russia. That’s taken off.” Like the rest of America, the FBI learned about that conversation only from a Russian government readout. But then Trump went on television and said he had fired Comey over the FBI’s probe into ties between Team Trump and Team Putin during and after the 2016 election.

The FBI knew that key members of Trump’s inner circle, like the national security adviser, Michael Flynn, were lying about their relationships with Russia. Trump had also lied about his business deals in Moscow during the 2016 campaign. The counterintelligence team asked itself: Why are they all lying? What was Trump’s relationship to the Russians? Was it something to do with money? The possibility that the Russians had “kompromat” — compromising information — about Trump’s finances was strong. And Trump has most likely been a target of Russian intelligence since the waning days of the Cold War, as a dozen CIA and FBI veterans I’ve spoken with in reporting my new book agree.

Once in the White House, Trump was shielded in the invisibility cloak of presidential power. If the counterintelligence agents wanted to follow the money, and they did, how could they get to Trump’s tax returns or the records of his 500-odd limited liability companies? And how could they do it in secret — an imperative for a counterintelligence investigation?

They had other theories of the case to weigh. There are many kinds of foreign agents. And one is the agent of influence. That’s a term spelled out in the American counterintelligence handbook: someone who uses their power “to influence public opinion or decision-making to produce results beneficial to the country whose intelligence service operates the agent.” Did Trump fit the description? The old hands from the CIA and the FBI think so. Leon Panetta, the veteran politician who ran the CIA and the Pentagon under President Barack Obama, told me he has no doubt about it.

If the Russians were really manipulating Trump, how were they doing it? Rolf Mowatt-Larssen, a former CIA station chief in Moscow who worked on the epic mole hunts that captured the American turncoats Robert Hanssen and Aldrich Ames, told me that Trump has the classic vulnerabilities that Russian intelligence could and would exploit: his greed, his corruption, his trysts and above all his ego. Trump openly courted Putin. (A 2013 tweet: “Do you think Putin will be going to The Miss Universe Pageant in November in Moscow — if so, will he become my new best friend?”) In turn, Putin, a veteran KGB officer trained to manipulate people, flirted with Trump and flattered him. Putin and his social media minions supported him openly — and with secret political warfare operations. So perhaps Putin had only to influence Trump to win influence in return.

Mowatt-Larssen wonders whether that’s all there is to it. “Is it only because Putin is such a master manipulator and that Trump is so vain that he loves it?” he asked. “Because I could never have imagined that an American president could — whether it’s witting or unwitting — betray American interests so thoroughly to the Russians as has occurred in the last four years.”

When the FBI seeks to pursue an American agent of a foreign power, it knows the hunt might take years or decades, as those that snared Ames and Hanssen did. Ames had been the chief of the counterintelligence branch of the CIA’s Soviet division in 1985. He betrayed a dozen KGB officers secretly spying for the United States. It took eight years before the investigators focused on Ames. They found that he had paid cash for a nice new house and a Jaguar. Their antennae tingled. Then they searched his trash: He had tossed in torn-up notes addressed to his Russian case officer. Bingo.

Hanssen held a similar counterintelligence post at the FBI. He gave the KGB keys to the American intelligence kingdom. He spied for 22 years undetected, starting in 1979. The mole hunters finally broke the case by paying $7 million to a Russian intelligence officer who had a tape of Hanssen, talking to his handlers, using a salty quote from Gen. George S. Patton. An FBI analyst remembered Hanssen saying those words. A trap was laid, and the case was closed.

But none of that has ever happened in the Trump case. The FBI’s counterintelligence investigation seems to have vanished. It wasn’t handed off to Mueller — to the surprise of many in and outside of the American intelligence community. There’s no sign the FBI pursued it. Perhaps it’s still going on in the deepest secrecy. But I doubt it. I think it’s likely that the Trump Justice Department waylaid it. And so does Strzok, who was removed from Mueller’s team and dismissed from the FBI over some politically pungent texts disparaging Trump, who in turn accused him of treason. I made Strzok a bet — my tattered copy of J. Edgar Hoover’s bestseller “Masters of Deceit” — that the case was killed. He wouldn’t take that wager.

At this point, only a dedicated team of FBI agents, CIA counterspies, and Treasury Department money-laundering experts can solve the mystery of Trump’s relationship with Russia, even if it doesn’t learn the truth for years to come.

The investigators have to follow the money, as they did with Ames and Hanssen, who between them received more than $4 million from the Kremlin. They have to look at Trump and his business empire going back to the 1980s — the casinos that teemed with Russian high rollers and failed to report suspicious transactions, the real estate deals with shady Russians, and every single one of those 500 limited liability companies.

They need to see the secret records of his conversations with Putin, just as they needed to piece together the ripped-up messages Ames wrote to his Russian handler. After his first face-to-face talk with Putin in 2017, Trump confiscated the notes of his interpreter, Marina Gross. And no American but she knows what they said at their second two-hour tete-a-tete in Helsinki two years ago. If the FBI can’t get the records, it needs to talk to Gross. Her code of confidentiality, like those of lawyers and priests, can be breached if need be.

Ideally, the FBI would do what they did in the Hanssen case: recruit a Russian intelligence officer, specifically one with a case file bearing Trump’s name. That person can be bought for the right price. And that file is locked away somewhere in the vast archives of the Russian spy services.

There’s a classic story about an American agent of influence that predates the Cold War — and might presage the strange case of Donald Trump, if these questions about his relationship with Russia go dormant. Samuel Dickstein was a member of Congress from Manhattan, elected in 1922, and chairman of the House Immigration and Naturalization Committee in the 1930s. He walked into the Soviet Embassy in 1937 and offered the ambassador his services for $25,000 a year — three times his congressional salary. In exchange, he sold fake passports to Soviet spies. And he held headline-grabbing public hearings investigating Joseph Stalin’s enemies in the United States. Dickstein served 11 terms in Congress. His file lay locked up in the KGB archives for 60 years. Today, if you go down to Manhattan’s Lower East Side, to the intersection of Pitt and Grand streets, you’ll be standing in Samuel Dickstein Plaza. He got away with it.