President Donald Trump likes to mimic reality TV when setting administration policy — frequently promoting contrived conflicts to try to boost ratings. He did just that when he called on California to send National Guard troops to the U.S.-Mexico border to combat “lawlessness.” Gov. Jerry Brown, to his credit, just took a red pen to that awful script.

After days of silence on the subject, the governor sent a letter Wednesday to administration officials accepting federal funding to add 400 Guard members statewide but also setting fairly strict conditions for how they will be used.

“This will not be a mission to build a new wall,” Brown wrote. “It will not be a mission to round up women and children or detain people escaping violence and seeking a better life. And the California National Guard will not be enforcing federal immigration laws.”

Critics of President Trump’s bellicose pronouncements on immigration had hoped the governor would rebuke the administration, as he did last month when he defended California against U.S. Attorney General Jeff Sessions’ screed about “radical extremists” in the state supporting sanctuary city policies. “This is really unprecedented, for the chief law enforcement officer of the United States to come out to California and act more like Fox News than a law enforcement officer,” Brown said at the time. “This is a political stunt.”

But the governor needs to choose wisely in his battles with the federal government, and there was ample precedent for agreeing to the general terms of Trump’s call for additional border patrols. California had accepted similar requests by President George W. Bush in 2006 and President Barack Obama in 2010, as Brown noted in his letter.

Trump’s border policy isn’t as coherent or as well-intentioned as his predecessors’ but California had an opportunity here to gain more federal funding for the National Guard while maintaining control over how the additional personnel are used. Had the governor fought the president, California might have lost the ability to ensure those Guard members are used constructively.

Under the agreement, which expires at the end of September, the state will use most of the additional federal funding for an existing program to combat transnational crime and will deploy many of the additional Guard members statewide rather than at the border.

“Your funding for new staffing will allow the Guard to do what it does best: support operations targeting transnational criminal gangs, human traffickers and illegal firearm and drug smugglers along the border, the coast and throughout the state,” Brown wrote. “Combating these criminal threats are priorities for all Americans — Republicans and Democrats.”

The deal also comes with a much-needed fact-check. In his letter, Brown points out that there isn’t a wave of illegal immigrants crossing the border. Apprehensions are at the lowest point in nearly 50 years, and the majority of those have occurred outside of California.

Republican governors in Texas, Arizona and New Mexico readily agreed to Trump’s call for more border troops, but it’s doubtful the show of force will be anything but a show. California, at least, has taken steps to deploy them where reality indicates they’ll be most useful. If Trump wants to help fund that, we welcome federal support.