By all accounts, Gen. John Kelly was a fine Marine. He served with Gen. James Mattis, now the secretary of defense, and was seen as being in the Mattis mold — a low-key, prudent, rigorous thinker. So it is with surprise that I see Mr. Kelly, in his new role as secretary of Homeland Security, presiding over a ham-handed crackdown on immigrants.

Immigration and Customs Enforcement agents are operating aggressively under President Trump, feeling, as The New York Times reported, “newly emboldened” and “newly empowered.” Officials’ use of detention powers is widening, with some people being held who have no criminal history at all. The government raids often are conducted around dawn, to catch people as they leave for work. The uniformed agents are wearing body armor and carrying semiautomatic weapons. The morning raids and the military appearance may not be new developments, but they are especially worrisome when ICE and Customs and Border Protection, domestic law enforcement agencies, are overseen by a former general.

And there definitely seems to be recklessness in the way Homeland Security is operating. In recent days, agents have taken a woman with a brain tumor out of a hospital, almost deported a distinguished French scholar flying into Houston to deliver a university lecture and scared the daylights out of an Australian children’s author who vowed after the experience never to visit the United States again.

This isn’t being done solely to foreigners. The son of the boxer Muhammad Ali, a citizen, was questioned upon arriving in Florida from Jamaica about his religion, which would seem to be a clear violation of the First Amendment’s guarantee of religious freedom. And passengers on a domestic flight from San Francisco to New York were required to show their identity documents to customs officials because ICE thought a person with a deportation order might be on the plane.