Defense Secretary Jim Mattis is known for the occasional intemperate remark about being willing or even eager to kill people. But the former Marine Corps general sometimes called “Mad Dog” has been the picture of caution in the face of President Trump’s attack on thousands of transgender Americans who volunteered to serve their country.

Charged with implementing one of the worst examples of Trumpian Twitter policy, Mattis reached for that indispensable weapon of every Washington official who wants to say no but can’t: the panel of experts. The secretary recently announced that a group drawn from the Defense and Homeland Security Departments will “provide advice and recommendations on the implementation of the president’s direction.” Meanwhile, President Barack Obama’s 2016 order welcoming transgender Americans in the military will remain in effect with respect to between 1,300 and 6,600 members on active duty.

Mattis’ announcement wasn’t an act of insubordination. A few days beforehand, in his first attempt to articulate his transgender ban beyond the 140-character confines of a tweet, Trump effectively invited the secretary to slow-walk the directive — perhaps because even the president isn’t quite ready to face the consequences of expelling an entire group of people from the armed forces. Mattis seems to be accepting the invitation with enthusiasm.

That is in keeping with the military’s response since Trump’s July tweets vowing to purge it of trans troops. Marine Gen. Joe Dunford, the chairman of the Joint Chiefs of Staff, responded the next day by saying there would be “no modifications to the current policy” until the president provided further guidance, and he urged that all members of the armed forces be treated “with respect.” Mattis’ office echoed those sentiments soon afterward.

Trump’s unexpected fiat was reportedly designed to end a dispute among members of Congress that threatened funding of another of the president’s monuments to prejudice, his beloved border wall. While his tweets suggested that transgender troops somehow diminish the military’s efficacy, that claim is thoroughly unsupported by experience or research, including the extensive study that preceded Defense Secretary Ash Carter’s ending of discrimination against trans members and recruits.

It also places Trump decidedly on the wrong side of history, which has seen the military become steadily more inclusive — from Obama’s embrace of gay and trans service members as well as women in combat roles to Harry Truman’s 1948 order that integrated African Americans and other minorities in the armed forces.

In fact, in a depressing coincidence, Trump’s lurch backward came on the 69th anniversary of Truman’s declaration “that there shall be equality of treatment and opportunity for all persons in the armed services without regard to race, color, religion, or national origin.” For Mattis and others, protecting that legacy from the current commander in chief will be a tall order indeed.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.