It’s not a full-blown secession. But in the face of the heartless brutishness of the Trump administration on everything from health care and immigration to environmental protection, what California is now doing comes pretty close.

Call it semi-secession. And given the ugliness that has gripped Washington, it’s easy to understand. But carried too far, it could also be a strategic mistake.

Start with SB54, the California Values Act, which the state Senate passed this month and would, with the exception of violent felons and repeat offenders, prohibit state and local law enforcement officers from detaining, arresting or interrogating undocumented people for “immigration enforcement purposes.”

Add the sanctuary cities and counties (San Francisco, Oakland, Sacramento and Los Angeles, among others) that will not allow their resources to be used to detain unauthorized immigrants for federal immigration officials.

Then add last month’s ruling of the state Air Resources Board further tightening emissions standards for cars and trucks.

Now cap it with the we-dare-you letter that lawyers for the leaders of the Legislature, all Democrats, sent April 6 to Attorney General Jeff Sessions and Homeland Security Secretary John Kelly.

The letter was itself a response to one Sessions and Kelly wrote in reaction to California Chief Justice Tani Cantil-Sakauye’s demand that federal immigration agents stop “stalking courthouses and arresting undocumented immigrants.” Such measures, she said, correctly, “not only compromise our core value of fairness, but they undermine the judiciary’s ability to provide equal access to justice.”

The Sessions and Kelly letter charged that the state and “many of its largest cities and counties have enacted statutes and ordinances (to) hinder ICE (Immigration and Customs Enforcement) from enforcing immigration law by prohibiting communication with ICE and denying requests by ICE officers and agents to enter prisons and jails to make arrests.”

What specific laws, the legislators’ letter asked, are Sessions and Kelly referring to? “The administration appears to forget that our system (quoting a 1991 U.S. Supreme Court opinion) is one of ‘dual sovereignty between the states and the Federal Government.’”

John C. Calhoun of South Carolina, the great defender of the rights of the slave states, would have been familiar with the argument. A state, Calhoun had argued in his opposition to the federal Tariff Acts of 1828 and 1832, had the right to “interpose” itself to “arrest an unconstitutional act of the General Government.”

A similar case was advanced by the abolitionist authors of the Massachusetts Personal Liberty Act of 1855, which sought to prevent the federal Fugitive Slave Act from being enforced in Massachusetts. But neither effort to oppose federal law prevented the secession of the Southern states or the Civil War that followed.

More recently, Alabama Gov. George Wallace and Arkansas Gov. Orval Faubus, not unlike Donald Trump with his proposed wall at the border, postured “in the schoolhouse door” to block court-ordered desegregation in Southern classrooms.

Notwithstanding the weird campaign launched by expatriate Louis Marinelli (now living in Yekaterinburg, Russia) to have California withdraw from the union — aborted last week — there was never a chance, even if the Assembly passed SB54 and Gov. Jerry Brown signed it, that California will ever come to anything resembling formal secession.

But put together, the state is mounting a frontal challenge to the feds that, if not specifically using Calhoun’s words “interposition” or “nullification,” comes close in principle.

The legislators’ letter cites Trump’s executive order directing Sessions to “take appropriate enforcement action” against any entity “that prevents or hinders the enforcement of federal law” and issues what amounts to a direct we-dare-you challenge:

“If the Trump administration resorts to attempting to enforce its Order against California, the Legislature will use all available means to defend the rights, values and safety of California.”

And given the long list of U.S. Supreme Court decisions that the federal government can’t compel the states to use their own resources to enforce federal law, the legislators have a strong case.

Ten days ago, in trying to block suits filed by San Francisco and Santa Clara counties to stop Trump’s attempt to turn local cops into what one of the suits called “federal apparatchiks” and punish sanctuary cities with the loss of billions of dollars in federal aid if they don’t, the feds already seemed to back off.

Billions of dollars weren’t at stake, a Justice Department lawyer told U.S. District Judge William Orrick, just a million or so. Orrick wasn’t convinced. Have Trump and Sessions been bluffing, or was this just another momentary flip by the administration? Given its record of obfuscation and shameless mendacity, there’s no way to know.

The resisters in state and local government have powerful reasons for their defiance — not just moral in preventing the agony of family breakups, but practical: in the need for labor; in fostering enterprise and innovation; in inducing cooperation by immigrants with, not resistance to, law enforcement; in encouraging school attendance and civic cohesion.

Yet even if the federal courts uphold California’s interposition, then a law like SB54 could well make California look as extreme on the left as nativists and abortion abolition extremists look on the right. It doesn’t make the case with swing voters east of the Sierra. It alienates the state’s red counties and further divides the country. Should there be no enforcement of the immigration laws?

California’s own history may be the best model for an alternative: In 1994, voters passed the harsh Proposition 187, which denied unauthorized immigrants all public services, including education.

A generation later, California’s diversity has generated the sixth most powerful economy on Earth. Its rules to promote energy efficiency and protect wildlife, the water its people drink and the air they breathe are a model for the nation.

Its own governor’s approval ratings are nearly double Trump’s as president. The approval numbers for the Legislature, at 57 percent, are at record highs. Meanwhile, as former Gov. Arnold Schwarzenegger put it, Congress is less popular than herpes. Yes, let’s defend our immigrants wherever we can, but not with Calhoun’s or Wallace’s tactics. We are still one nation.

Peter Schrag is the former Sacramento Bee editorial page editor. To comment, submit your letter to the editor at http://bit.ly/SFChronicleletters