President Trump’s choice of Lt. Gen. H.R. McMaster to replace Michael Flynn as National Security Adviser (NSA) elicited a sigh of relief from the president’s staunchest opponents on both sides of the aisle, and with good reason. Long familiar to specialists in national security affairs, the American public will find in McMaster a seasoned combat veteran who is among the military’s deepest thinkers—an officer who is absolutely committed to advancing American interests, yet who is equally committed to American values and who understands the limits of what military action can accomplish. There is hope that after Flynn’s tumultuous, short tenure, McMaster will bring greater professionalism and a more rational approach to the office. Those fearful of Trump’s dislike of hearing things he dislikes can take heart that McMaster has a lengthy track record of independent thinking and speaking truth to power, even at risk to his career.

That the new NSA is almost the polar opposite of Flynn in personality and outlook is clear, but his supporters should temper their enthusiasm for the moment. The question is not if McMaster will have the boldness to challenge flawed thinking—that’s a given. Whether he’ll survive in a Trump White House, and what degree of influence he can wield, are still open questions.

McMaster’s rise to prominence started with an act of insubordination. In 1991, when he commanded an armored unit in Kuwait, he disregarded orders to wait for reinforcements and plunged into battle with a much larger Republican Guard force. He received a Silver Star for trouncing an enemy that outnumbered his unit 8 to 1. His experience in the Persian Gulf, like that of the army as a whole, contrasted markedly with the “Vietnam Syndrome” then afflicting the U.S. military. “[It] was clear to me that our unit’s experience was dramatically different” from what had occurred in Vietnam, McMaster later wrote in his preface to Dereliction of Duty. For him, that difference was crystal clear: “[T]he ease with which we could connect our combat mission to strategic objectives that seemed clear and attainable contrasted starkly with combat actions in Vietnam.” Despite warnings that he would scuttle any chance of promotion by publishing on the subject, McMaster pressed forward in understanding how the nation had erred so badly in Southeast Asia a generation before.

McMaster became famous in history and security study circles in 1997 with the publication of his doctoral dissertation, Dereliction of Duty: Lyndon Johnson, Robert McNamara, the Joint Chiefs of Staff, and the Lies that Led to Vietnam, a scathing indictment of the Joint Chiefs of Staff during the Vietnam War. McMaster’s argument is often perceived as calling on military leadership to defy reckless or foolish orders. He claims nothing of the sort. Rather, his book condemns the Joint Chiefs for failing to provide their candid views about what it would take to win the war. They simply hoped for the best with the strategy they were given by the Johnson Administration, believing that over time he would come around to their view, without ever truly making their beliefs known to a president whom they (probably rightly) assumed would reject them. Finally, they were complicit in lying to Congress about the state of the war, failing to testify accurately in a vain effort to curry favor with the White House. The book also blasts Johnson and Secretary of Defense Robert McNamara for shutting the Joint Chiefs out of the decision-making process, for their deep-seated distrust of the military, and for only accepting advice that fit with their preconceived notions.

In the second war in Iraq, then-Colonel McMaster was among the first officers to adopt a “population-centric” strategy in Iraq. He became one of the authors of the “Surge” when he bluntly reported to his superiors at the Pentagon everything that was going wrong in Iraq. He and his like-minded comrades succeeded in changing American strategy, but McMaster almost cost himself a promotion to general in the process. Only the intervention of David Petraeus kept his career progressing.

The trait that has consistently distinguished McMaster is a willingness to say—and print—what he believes, regardless of the potential consequences. McMaster has a long history of speaking truth to power, and a set of beliefs and values that have remained doggedly consistent over a career of three decades. He will find no shortage of points of contention in his new role. He has a markedly different view of Vladimir Putin and Russia than what the president has expressed. He has maintained the position that demonizing Islam plays into our enemies’ hands, a fact that has created a predictable backlash from many of the administration’s most vocal supporters. On that front, he wasted no time showing daylight between himself and the president, telling his staff that he finds the term “radical Islamic terrorism” “unhelpful.” McMaster’s view on this front is perfectly reasonable; the fight against Al Qaeda, ISIS, and their ilk already includes working closely with allies in the Middle East, and no long-term solution exists that does not include cultivating support from practitioners of Islam. Painting all Muslims as the enemy is indeed counterproductive. Still, the religious motivations of our enemies is crystal clear, and given that even David Petraeus was willing to use the term, this seems like a highly suspect hill to choose to die on.

If he chooses his battles well though, the country can depend on McMaster to be a consistent voice for using force wisely and with a set of clearly-defined objectives. He will keep the political endgame in mind rather than send troops into harm’s way in haphazard fashion. It can also trust him to act as a dogged defender of rules of war and honorable treatment of noncombatants. These are matters of great significance, and mark McMaster as a clear improvement over Flynn’s overheated rhetoric and exclusive focus on the aforementioned radical Islamic terrorism to the exclusion of a host of other national security concerns.

But he hardly has a blank check. Trump’s first choice for replacing Flynn, retired Vice Admiral Robert Harward, turned down the post, reportedly because he would not have been allowed to choose his own staff—he would have been dependent on subordinates hand-picked by Steve Bannon. In an administration that already has a reputation for backstabbing, one can hardly blame Harward’s reticence. Whether McMaster takes office under similar constraints remains to be seen, but there are promising signs early on. After writing an entire book on the evils of shutting the Joint Chiefs out of the decision-making process, McMaster was surely unhappy with Trump’s decision last month to remove the Chairman of the Joint Chiefs and the Director of National Intelligence from the National Security Council, and early rumors hint that McMaster will try to convince the White House to reverse that decision.

Even if he extracts this concession, he is entering an administration riven by internal fighting between the James Mattis and John Kelly faction on the one hand, and the Steve Bannon, Keith Kellog, Michael Flynn faction on the other. McMaster’s selection to replace Flynn is a decided victory for the Mattis wing, as the Secretary of the Defense and the new National Security Adviser have worked closely in the past and see the world in similar terms. There is good reason to hope his hire will lead to a more consistent foreign policy from an administration that has sent mixed-messages to our allies. But Bannon continues to wield enormous influence with the president and a vital constituency that put him in the White House. McMaster’s refusal to sugarcoat the truth or back down in the face of opposition is about to get the toughest test of his career. No one expects him to cave. Whether his tenure in DC will collapse is another question entirely.

Thomas Sheppard holds a PhD in military history from the University of North Carolina. He currently lives in Washington, DC and writes on U.S. politics and foreign policy. The views expressed here are solely his own.

Photo Credit: Then-Brig. Gen. H.R. McMaster, the Combined Joint Interagency Task Force Shafafiyat commander, visited the National Military Academy of Afghanistan on Dec. 7, 2011, to discuss the importance of military core values. U.S. Army Photo by Sgt. Tamika Dillard.