The nation’s top intelligence officials told Congress last week that President Trump is wrong about the success of his diplomacy with North Korea, that Iran is not attempting to manufacture a nuclear bomb and that the Islamic State is unlikely to be destroyed as quickly as the president claims. And they barely mentioned, in an annual report to Congress on the threats facing the United States, the “crisis” on the U.S.-Mexico border that Trump insists is a national emergency.

But it was Trump’s response to the Worldwide Threat Assessment that shocked me, a veteran of more than 30 years in the CIA’s Clandestine Service.

“Perhaps Intelligence should go back to school!” Trump declared in a Wednesday morning tweet. “The Intelligence people seem to be extremely passive and naive when it comes to the dangers of Iran. They are wrong!”

Trump’s public criticism of his senior intelligence leadership will damage morale in the U.S. intelligence community, as well as the relationships our security services have with their foreign counterparts.

Inside the CIA — and in other intelligence agencies, I would imagine — there is a well-respected tradition of encouraging the workforce to ignore politics. CIA officers are not hired or fired for their political beliefs, but rather for their competence and, in the case of more junior officers, their potential. Integrity is the key factor in hiring and retention. I never saw a case in which personal politics played a role in hiring or firing. Nor did I ever witness politics play a role in operational or analytical decisions. For decades, CIA leaders and front-line managers have counseled patience, suggesting officers don professional blinders when it comes to public pronouncements regarding the arcane work of intelligence.

“Ignore it,” I used to tell junior officers. “Just focus on your work, which has not changed and will not change regardless of who is in the Oval Office or which party is in the majority. Remember, your job is to collect intelligence securely and disseminate it to policymakers, whether or not they like the information you give them. Speak truth to power.”

Just as in the military, the men and women of the CIA, the Federal Bureau of Investigation, the National Security Agency and other intelligence services are professionals focused first and foremost on their mission. They are more interested in facing the unique challenges of clandestinely collecting intelligence, and they view politics and those who practice it as largely irrelevant to their craft. Most intelligence officers I know are also inherently loyal to the consumers of intelligence. The holy grail of intelligence professionals is knowing the information they helped collect, analyze and disseminate went straight to the president, the commander — and intelligence consumer — in chief. This is not because they like or even voted for a specific president, but because that is the whole point of intelligence work: to provide the best information to the highest levels of government.

But there is a limit to everything. And despite the apolitical work ethic of intelligence professionals, being called passive, naive and uneducated will sting. It will sting officers serving abroad in war zones and other places where they and their families are at risk. It will sting those officers who have personally sacrificed to serve, but who know (or at least thought they knew) that at the end of the day, it was worth it because their work was important to protect our democracy and highly valued by policymakers and elected officials.

I am not predicting a mass exodus of intelligence officers from federal service. Intelligence work is some of the most fascinating, complex and rewarding work our government does, and its practitioners are dedicated and thick-skinned. But they’re not used to sophomoric public criticism from an impulsive, angry president, and they may eventually decide it’s just not worth it.

It’s hard not to wonder why Trump continues his unprofessional personal attacks on the intelligence community, when he could simply fire the people who so irritated him in the first place. The director of national intelligence, the CIA director and the director of the FBI all serve at the pleasure of the president. Trump appointed each of these officials, and, indeed, he has spoken highly of them in the past. Until, that is, they provided facts he did not want to hear regarding several of his overseas pet projects for which he is claiming (largely without evidence) great success. Refusing to accept bad news is a significant flaw for a president, or any leader; publicly throwing the messenger under the bus is even worse.

Of course, the president has the right to formulate his own foreign policy. While policymaking is usually done with the assistance of an experienced national security team, the process should be informed, not driven, by intelligence. Plenty of presidents have listened to the information provided by intelligence professionals, then gone on to formulate policies at odds with what was suggested. President John F. Kennedy, for example, decided against using the CIA’s preferred invasion site in Cuba and asked the agency to find a less-populated landing site, which turned out to be the Bay of Pigs. That is healthy. In this case, Trump reacted as if the intelligence community’s threat assessment was a threat to him. Presidents are certainly entitled to their own policies, but they are not, as the saying goes, entitled to their own facts.

Trump’s inappropriate public criticisms will have a chilling effect on one of the United States’ most potent intelligence-force multipliers: our relationships with allied foreign intelligence agencies. Indeed, the president’s comments are uniquely self-defeating, in that our best hope for monitoring and perhaps modifying the behavior of rogue states such as Iran, North Korea and Russia is working in unison with our partners. Many have already taken note of Trump’s cavalier attitude toward sensitive information, as well as his apparent failure to understand the basic rules of intelligence-sharing. Recall when our president shared sensitive intelligence obtained from one of our foreign partners with Russian Foreign Minister Sergei Lavrov. I wouldn’t be surprised if our best intelligence allies were holding back information they might normally pass on to their U.S. counterparts, for fear Trump could not keep it a secret. Their concerns might even be justified when they consider the possibility that our president discussed sensitive matters with Russian President Vladimir Putin behind closed doors, with no record of the conversation.

At its heart, intelligence is about protecting our national security and our values by informing foreign policy. You can certainly criticize the performance of U.S. intelligence agencies. Any large organization should always be striving to improve efficiency. You can encourage the intelligence community to do better by learning from past experiences, taking those lessons and translating them into the ever-changing modern information era (as the Russians have done using hybrid warfare). We should have high expectations of our intelligence agencies because so much rides on their work.

We are well past the point where we can write off the president’s public criticisms of the intelligence community as those of a political outsider, who despite his constant missteps has a heart of gold and the best of intentions. We are now at the point where Trump’s actions are making us all less safe.

Read more: