Attacks on Russia. Soccer games with refugees. Lively chats about human rights with Bono.

Browse through Nikki Haley’s Twitter feed long enough and you’d be forgiven for forgetting she’s a high-ranking official in the Trump administration, where the president pointedly refuses to do the first one of those and would consider the last two to be political suicide.

President Trump selected Haley early on in the formation of his Cabinet, settling on her as his ambassador to the United Nations before picking Rex Tillerson for secretary of state or James Mattis for secretary of defense. But she was a surprising pick then, and remains so today.

A popular twice-elected governor of South Carolina, she’s an experienced GOP politician in an administration packed with outsiders. As the daughter of Indian immigrants, she stands out in an administration run chiefly by white men. Telegenic and poised, she has a knack for the limelight that stands in sharp contrast to the administration’s tendencies toward the rumpled (former press secretary Sean Spicer) or reclusive (Tillerson).

But in her first seven months at the helm of the US mission to the UN, Haley’s differences have gone far beyond optics. Trump campaigned on a foreign policy platform of “America first” — the idea that the US should avoid getting involved in unnecessary conflicts overseas and focus narrowly on national security interests over promotion of democracy and human rights abroad.

But Haley has pursued the opposite course. From her stern criticism of Moscow to her championing of human rights to her calls for Syrian regime change, she’s routinely diverged from, or outright contradicted, Trump’s stance on the biggest foreign policy issues of the day.

Sen. Lindsey Graham, one of the most hawkish Republican senators in Washington, told the New York Times recently, “She sounds more like me than Trump.”

Haley’s stances may reflect more than just policy differences. Many in the GOP worry that Trump may not survive four years and that those who’ve served in his administration may be tainted by association if he resigns or is impeached. Haley appears to be one of the few administration officials with the potential to survive the Trump years — and could be positioning herself for a presidential campaign of her own.

Haley has gotten a lot out of what could’ve been a throwaway job

When Trump first nominated Haley as his pick for UN ambassador, it appeared that she could be doomed to irrelevance. Trump had spent his entire campaign railing against the idea of international cooperation and contributing to the advancement of human rights or democratic ideals — the very issues that an ambassador to the UN is tasked with handling. It seemed he was giving Haley a fluffy throwaway job and perhaps even using it as an opportunity to add some diversity to his heavily white and heavily male team.

But Haley has been far from a marginal voice in the administration’s foreign policy team.

The most striking feature of Haley’s appointment was that Trump decided to keep the UN ambassador post as a Cabinet-level position, as it was under President Obama. That’s unusual for recent Republican presidents — under both George W. Bush and George H.W. Bush, the ambassador to the UN was stripped of Cabinet rank. Democrats, more inclined toward robust diplomacy and cooperation with the international community, have preferred to keep the position at the Cabinet level.

Given all of Trump’s isolationist language on the campaign trail, UN watchers were surprised by Trump’s decision to have Haley in the Cabinet.

“The Trump administration’s rhetoric around ‘America first’ and general disdain for multilateral diplomacy was contradicted by the very fact of breaking with [recent Republican] precedent and establishing ambassador Haley as a full-fledged member of the Cabinet,” Rob Berschinski, senior vice president for policy at Human Rights First and a former senior adviser to UN Ambassador Samantha Power, told me.

This wasn’t simply Trump being magnanimous; Haley successfully negotiated for the Cabinet-level rank for her position. Being a member of the president’s Cabinet gives her more authority at the UN and more sway over the president during Cabinet-level deliberations.

Haley is also a member of the National Security Council’s top decision-making body, the Principals Committee. That means she’s a regular contributor to the president’s most important forum for considering and making decisions about the country’s pressing national security and foreign policy matters, along with the rest of his senior national security advisers and Cabinet officials on the committee.

Haley’s entry into the Principals Committee in April elevated her position in the administration and marked a victory for establishment GOP thinking. She was added to the group at the same time former White House strategist Steve Bannon was ejected from it, at the request of National Security Adviser H.R. McMaster. Bannon was a key advocate of the America First worldview and argued against intervening in Syria after its president, Bashar al-Assad, used chemical weapons against civilians. But just days after the reshuffling of the committee, Trump went ahead and struck Syria with cruise missiles, and Haley was the administration’s foremost public defender of the surprising attack.

Trump wants to keep things warm with Russia. Haley doesn’t.

Haley has left her unique mark on many of the Trump administration’s most prominent foreign policy challenges — the most conspicuous one being Russia.

Right away, Haley seemed prepared to embrace traditional hardline GOP rhetoric and policy stances about the threat posed by the Kremlin. During her confirmation hearing, she accused Russia of carrying out “war crimes” in Syria.

“I don’t think we can trust [the Russians],” she said. “They have certainly done some terrible atrocities.”

It was in stark contrast to Tillerson’s much gentler language on Russia during his own confirmation hearing — he declined to say whether he believed Russian President Vladimir Putin was a war criminal, for example — and it clearly suggested she could be at odds with Trump’s well-established agenda to warm ties with Russia. And indeed, that is exactly what’s played out.

During her first appearance at the UN Security Council in February, Haley strongly condemned Russia for its meddling in eastern Ukraine and for its annexation of the Ukrainian territory of Crimea.

“Until she spoke, there was no clarity on where the Trump administration was going on Russia and Crimea,” Richard Gowan, a UN expert at the European Council on Foreign Relations, told me. “She set the direction for the administration by saying, ‘No, the occupation of Crimea remains illegal.”

Haley’s comments came just days after a chummy phone call between Trump and Putin in which Ukraine was only mentioned in passing. According to CNN, one unnamed source said Haley did not receive sign-off from the White House on her remarks, and according to Gowan, "There were very credible rumors at the UN that Haley's strong line over Crimea was not cleared with senior officials at the White House.”

Haley’s ferocity toward Russia has continued, both at the Security Council and beyond. When Assad used chemical weapons against Syrian civilians in the spring, she accused Russia of leading the “cover-up” and taunted the Russians as “nervous” about international reaction.

Haley has also said that Russia “certainly” meddled in the 2016 election, in contrast to Trump’s agnosticism on Russian interference (“nobody knows” is his signature phrase on the matter). And she enthusiastically endorsed special counsel Robert Mueller’s investigation into potential collusion between Trump’s associates and Russia during the election — a probe that Trump considers a “witch hunt.”

Haley is simply not a Trump Republican

But Haley’s departures from Trump’s positions go well beyond Russia.

In February, Haley proclaimed that the US would stand by a two-state solution on Israel-Palestine — just 24 hours after Trump waffled on the issue.

On the issue of refugee policy, Haley has projected a very different set of values than her boss. Trump used his opening months in office to try to ban refugees from entering the US and proposed a budget that would slash foreign aid dramatically and cut diplomatic and overseas programs by a third.

But when Haley met with Syrian refugees at the Zaatari refugee camp in Jordan in May, she promised that the US was “not going to stop funding” aid programs for Syria, telling them, “We want you to feel like the US is behind you.”

At the UN, Haley hasn’t just emphasized human rights; she’s actually broken precedent in the way she’s called attention to them. While presiding over the UN Security Council in April, she directed the first-ever “thematic debate” over human rights.

“This was the first time there has ever been a Security Council meeting solely dedicated to the concept that human rights and peace and security are inextricable from one another,” Berschinski says. “It reflected Ambassador Haley’s genuine interest and belief that there is a direct link between how a government treats its own people and international peace and security.”

Haley also became the first US ambassador to the UN to address the UN’s Human Rights Council. Though she criticized the group for its constant criticism of Israel, she also said — to the surprise of many — that the US would remain a member of it for now. George W. Bush boycotted the council, which was formed in 2006, and the US joined it under Obama.

Haley’s reaction to Syria’s use of chemical weapons against civilians in the spring sounded considerably more neoconservative than “America first,” with its sharp focus on human suffering and advocacy for military intervention in order to mitigate it.

After Trump fired cruise missiles at Syria for its use of chemical weapons, Haley said that the administration considered ousting Assad to be a “priority” of the administration.

“We don’t see a peaceful Syria with Assad in there,” Haley told CNN’s Jake Tapper just days after the Syria strike. She described regime change as inevitable “because all of the parties are going to see Assad is not the leader that needs to be taking place for Syria.” That stance was the most aggressive one coming out of the administration, and at odds with Trump’s stated disinterest in taking actions to topple the Syrian leader.

Haley’s office denies that she’s not in sync with the president. “Whether it’s winning expanded sanctions on North Korea, denouncing Syrian dictator Bashar al-Assad’s chemical weapons use, fighting for the most efficient use of US tax dollars on UN programs, or in multiple other areas, Ambassador Haley is always reflecting administration policies at the UN,” a spokesperson for the US Mission to the United Nations told me.

It’s true that there are plenty of policy areas where Trump and Haley appear to be in lockstep. But the frequency with which they’re not is highly unusual.

“What Nikki Haley says doesn’t seem to be linked to administration policy — she’s freelancing much more [than her predecessors],” a former senior official at the US mission to the UN told me, speaking on the condition of anonymity because of ongoing relationships with the current administration.

In some instances, this is because the administration is understaffed and disorganized when it comes to policy decision-making and messaging, and Haley simply has more autonomy to operate amid the chaos. But Haley’s breaks on issues like Russia and Syria are of enormous consequence. Ultimately, all of her divergences make the most sense if they’re understood to be by design.

Haley is playing the long game

Haley’s departures from the Trump line aren’t the product of a lack of discipline or an inability to cooperate with others — she was well-liked and successful as her state’s first woman and first minority governor in the rough-and-tumble world of South Carolina politics.

Nor is it due to some especially deep set of convictions on international affairs — unlike most recent UN ambassadors, Haley is a novice on the foreign policy scene and learning as she goes along. Rather, her maverick stances seem to be about paving a path for the future.

“The fact that she’s been so much more critical of Russia than the rest of the administration allows her to get some distance from the administration — and that feels like something that’s quite calculated,” the former official said. “It seems like she’s positioning herself for a future run.”

Should the Trump administration actually unravel over ties to Russia, Haley will have bought herself insurance against it — she can always credibly claim that she never appeared beholden to Moscow. She’s also building a reputation among establishment Republicans — whether potential donors or pundits or lawmakers like Sen. Graham — as willing to be gutsy and principled in an administration that often values loyalty above all else.

“She’s doing wonders for her own profile, and staking out a pretty strong claim to be a serious voice of mainstream Republican foreign policy thinking,” Gowan told me. “She has her eyes on a bigger political horizon.”

Haley has denied any presidential ambitions, saying in April that she “can’t imagine running for the White House.” But her conspicuous maneuvering in the foreign policy world has fueled suspicions that she’s interested in the possibility.

Haley has even gone out of her way to distance herself from Trump on domestic issues. On Tuesday she told CNN that she had a "personal" conversation with the president about his controversial response to the white supremacist rally in Charlottesville, though she wouldn't provide any details.

“I know the pain that hate can cause, and we need to isolate haters, and we need to make sure that they know there is no place for them," she said, in what amounted to an implicit critique of Trump's comments.

Her quieter actions have raised questions as well. Haley selected Jon Lerner as her deputy ambassador — not an experienced foreign policy wonk to help her learn the ropes, but her longtime pollster and a strategist who played a key role in coordinating the NeverTrump campaign in 2016. Haley is also developing relationships with financiers in New York.

If Haley does want to pursue the White House — or at least keep the prospect alive — she has an awkward task.

She must act independently without coming across as defiant to a president who fixates on loyalty. She needs to insulate herself from accusations of deference to Russia, yet not undermine the president’s commitment to improving ties to Moscow. She has to execute Trump’s “America first” agenda, yet signal a more conventional internationalist outlook to Republican Party elites and pundits who would play a key role in her future odds as a contender for the White House.

There are risks involved in the process. In April, Trump made a joke about firing Haley that didn’t quite come across as a joke, and seemed to hint at his discontent with her rising profile.

“Now, does everybody like Nikki?” the president said at a White House event with UN Security Council ambassadors. “Otherwise she could be easily replaced, right? No, we won’t do that. I promise you we won’t do that. She’s doing a fantastic job.”

And in the spring, the State Department requested that she clear her positions on major issues with them in advance, in response to her freelancing. There is at least some unease in the administration over her boldness when she has the podium.

But Haley seems to have made the calculation that getting on Trump’s wrong side is worth the risk, or at least less of a risk than appearing to be a yes woman as he goes about leading one of the most controversial presidencies in modern history.

“Time will tell, but this job will either present opportunity or end a career,” says Chip Felkel, a South Carolina-based GOP strategist.