Secretary of Defense Jim Mattis is about to face one of his biggest challenges since joining the Trump administration: handling incoming National Security Adviser John Bolton.

Mattis and Bolton are diametrically opposed on the two biggest national security issues facing the United States — North Korea and Iran. Mattis wants to keep the US in the Iran nuclear deal; Bolton previously advocated for bombing the country and removing the US from the agreement. And Mattis argues diplomacy is the best way to curb Pyongyang’s nuclear program, while Bolton warns against negotiations and last month advocated for striking North Korea.

But it gets worse for Mattis. Experts tell me Bolton is a seasoned bureaucratic infighter who has the skills to press forcefully for his views — and that could keep Trump from hearing Mattis’s advice. “There is an open question about whether he will allow multiple views to be aired in front of the president,” Evelyn Farkas, a former senior Pentagon official, told me. “His reputation is not good when it comes to how he has treated his colleagues in the past.”

And Mattis has already lost some leverage within Trump’s team. President Donald Trump fired a key Mattis ally, Rex Tillerson, as his secretary of state two weeks ago, and it’s rumored Chief of Staff John Kelly may soon head out the door. Mattis helped Kelly remove outgoing National Security Adviser H.R. McMaster, in part because they fought over how to deal with North Korea. But now, ironically, Mattis has to contend with an even more pugnacious rival in the White House.

“I expect even more internal drama and choppy waters ahead for the Pentagon,” Derek Chollet, a former top National Security Council (NSC) and Pentagon official, told me. “The tensions that existed with the NSC under McMaster are likely going to get exponentially worse.”

Mattis has faced a lot of obstacles in his storied military and brief political career, but Bolton’s appointment ranks high among them.

“This will be a huge test for Mattis,” Chollet told me.

Advantage: Bolton

Matthew Waxman, a former senior official in the George W. Bush administration, wrote in Lawfare on Friday about why Bolton could be a formidable force in his new role.

“Yes, Bolton is militantly aggressive about wielding American military and economic power,” Waxman says, “[b]ut what I saw in him also was an operator who was relentlessly effective in implementing — or stymying — policy, at least in the short term.” It’s worth recalling that Bolton learned from the best: He’s a protégé of former Vice President Dick Cheney, a master bureaucratic pugilist.

Bolton also spent years in Republican administrations learning the ins and out of how to navigate the US capital. In his book Surrender Is Not an Option, he spends page after page self-servingly detailing his contempt for government agencies and career officials, and how he eventually outsmarted them all to make them adopt his points of view. (However, he is honest about how the Bush administration marginalized him while he served as the ambassador to the UN, preventing him from severing America’s ties to the diplomatic body.)

Bolton has another big advantage over Mattis: He will likely hold multiple Oval Office meetings each day with Trump to discuss key issues from North Korea to Iran to Syria to Afghanistan. That will help him crowd out dissenting voices, including Mattis’s.

Mattis, meanwhile, has very limited political experience. Joining Trump’s Cabinet is his first foray into setting American foreign policy or navigating official Washington. That said, Mattis retired as a four-star general, which means he proved he can fight a good bureaucratic battle on his own — troops don’t achieve four stars unless they know how to deal with Washington’s egos.

But Mattis famously formed a united front with Tillerson to push back against the president’s worst foreign policy impulses — angering Trump along the way — and lost again and again. Here’s just one example: Trump still plans to move the US Embassy in Israel to Jerusalem over Mattis’s and Tillerson’s objections.

The New York Times reports that Mattis told colleagues he’d have trouble working with Bolton. But Dana White, the Pentagon’s top spokesperson, told me “Secretary Mattis will work well with anyone the president selects for his team.”

Mattis remains in Trump’s good graces, and there is no indication the secretary will leave the administration anytime soon. Yet Bolton will likely form a mind meld with the president right away — they share similarly hawkish views — and try to bend the national security bureaucracy to his liking.

But here’s the thing: Mattis and Bolton’s first skirmish may come sooner than you think.

The first potential Mattis-Bolton showdown is just weeks away

Trump brought in Bolton now in part to have his national security team set ahead of two critical events: the decision about whether to remove the US from the Iran deal, and a potential summit with North Korean leader Kim Jong Un.

Bolton is crystal clear about his feelings toward both countries. “Bolton’s strong policy views are well-known, and he will be a forceful proponent of them in the Situation Room,” William Inboden, a top NSC staffer in the George W. Bush administration, told me.

During the early months of the Trump administration, then-White House senior strategist Steve Bannon approached Bolton as part of a plan to get around Cabinet members, like Mattis, who opposed withdrawal from the Iran nuclear deal.

Bolton then drafted a five-page memo detailing his proposal for tearing up the deal, which he then published in National Review after Bannon departed the White House.

And on February 28, Bolton published an op-ed in the Wall Street Journal arguing that the US needed to solve the nuclear standoff with North Korea by force.

“Pre-emption opponents argue that action is not justified because Pyongyang does not constitute an ‘imminent threat.’ They are wrong,” Bolton wrote. “It is perfectly legitimate for the United States to respond to the current ‘necessity’ posed by North Korea’s nuclear weapons by striking first.”

As of now, all signs point to Trump removing the US from the Iran agreement on May 12. The problem is Trump plans to meet with Kim later that month. Breaking America’s commitment to the nuclear deal could make it much harder for the US to have a successful summit with North Korea, experts say.

“If I were the North Koreans, and Trump pulled out of the deal with Iran, why should I make an agreement?” Frank Rose, a top arms control official at the State Department from 2014 to 2016, told me.

But that won’t stop Bolton from encouraging Trump to follow his instincts on Iran and possibly scuttle any meeting with Pyongyang.

The question is if Mattis will be able to contain Bolton’s most dangerous instincts. If he doesn’t, Trump’s best Cabinet member will find himself marginalized when he’s needed most.