What is occurring in Portland is deeply troubling. As masked, federal agents toss Americans into unmarked vans and unleash violence, it is Orwellian theater in the streets. They are endangering lives and violating the rights of the people they ostensibly are protecting. At the forefront of this breakdown are agents from the U.S. Border Patrol, which is part of U.S. Customs and Border Protection. With this debacle as a backdrop, the Trump administration is threatening to send federal agents to other American cities. Many Americans are rightly asking: Why are Border Patrol agents in Portland, and what are they doing?

The answers to these questions are straightforward. They should not be there, and they are acting far outside their mission. While there are occasions that CBP rightfully assists with domestic law enforcement, it is not CBP’s role to stop graffiti, generally protect federal property or engage in municipal police duty. CBP is a border agency — full stop — and it has plenty to do stopping terrorists and criminals from entering the country, and processing the flows of lawful trade and travel.

This misuse of the Border Patrol in Portland is another sad example of how troubled it and its parent department, the U.S. Department of Homeland Security (DHS), have become under the Trump administration. The president has deprived DHS and CBP of real leadership, relying instead on a roving band of incompetents and sycophants like the acting Secretary, Chad Wolf, and the acting CBP Commissioner, Mark Morgan. These “leaders” have placed a premium on pleasing the president at the expense of the nation’s security and the interests of the organizations and employees they manage. Their public posturing and chest-thumping is an embarrassing and dangerous spectacle. By contrast, when the president attempted to misuse the military to target protesters, the military pushed back and the effort fizzled. Where is a similar pushback from DHS and CBP leaders?

The damage to CBP is going to be longstanding. CBP’s job is hard, operationally and politically. The agency needs the support of Congress and the understanding of the American people to do it. As the administration has politicized CBP, it erodes the political capital and public trust that was built under the Bush and Obama administrations. CBP, like its sister agency U.S. Immigration and Customs Enforcement, is facing increasingly serious calls for it to be disbanded, calls which will intensify now especially for the Border Patrol. That outcome may be unlikely, but a serious reform effort, with possible budget cuts and restrictions of its activities, is almost certainly coming.

There is also a trickle-down effect on DHS and CBP personnel. How demoralizing it must be for those who are committed to their missions to watch the agency be exploited. And what lessons are being taught to young agents and officers who watch their colleagues display such aggression with impunity — and with the Secretary and Commissioner celebrating it?

If it sounds bad, it is. And the next administration faces a difficult task in rebuilding CBP — and DHS. A few points are critical. First, appoint experienced and responsible leadership. The rebuilding effort will be a multiyear endeavor that requires Senate-confirmed leaders behind it. Second, CBP should not shy away from accountability and reform; it should embrace it. DHS and CBP need to be partners with the next administration and Congress in fixing what’s gone wrong. That is critical to rehabilitating the agency’s credibility and ensuring that reform efforts have the benefit of CBP’s experience and expertise. Finally, America needs a strong, professional border-management agency. Regulating the flows of people and goods who cross the border is essential to American security and economic competitiveness, and any reform effort must reflect that.

I care deeply about CBP, and I believe in its border — and national security — mission. CBP stands at the front lines of protecting the country from serious threats, and its officers and agents regularly put themselves in harm’s way to protect us. They, and the country, deserve better.