In 2003, a young woman paid a call to Rita Allison, asking whether she might have a future in the Republican Party. The question, like the visitor, seemed to come out of nowhere. “Miss Rita,” as she was known around the South Carolina state capitol, was a platinum-haired southern lady, one of the few who had found political success in a state that at the time ranked dead last in the number of women serving in elected office. The young woman was familiar to her only as an employee of Exotica, a clothing boutique out in the suburbs of Columbia. “If you were looking for something very original or different,” Miss Rita recalled recently, “it was a nice shop for that.”

Exotica was a family business. The young woman kept the books in the back office for her mother, Raj Randhawa, who ran the place. Her older sister, Simmi, worked on the sales floor, as did her husband, Michael Haley.

Nikki Haley was 31 years old and the mother of two young children. She’d never been involved in student government or taken so much as a single political-science course at Clemson University, where she’d studied accounting. And yet she had the notion that she might run for public office. “She talked to me about women running and the hurdles you had to jump over,” Miss Rita told me as we sat in her office where she serves in the South Carolina legislature. Miss Rita advised Haley that many women start off at the local level — as a candidate for school board, say, or city council. But Haley had bigger plans. She was thinking, she said, about a seat in the state house of representatives — one occupied by a long-tenured Republican, a member of an old southern family.

Miss Rita told her she would face an uphill battle, but Haley wasn’t discouraged. “She was very driven, I think,” Miss Rita said, “about where she was going to go, and what she thought she could do for the state, and where she fit in.”

Although a native of South Carolina, Haley is a child of Indian immigrants. None of the established campaign consultants in Columbia would work for her. Voters in her semirural district, they said, would never go for a candidate whose father wore a turban. (Though she, like her husband, is a practicing Methodist, her parents are Sikhs.) But that fall, Haley attended an inspiring speech by Senator Hillary Clinton, who said that women should “dare to compete” in politics. She went out and began canvassing neighborhoods, armed with boxes of Krispy Kreme doughnuts. Voters opened their doors to a smiling, chestnut-eyed woman, whose dark features were striking but did not immediately identify her as an outsider. Her opponents tried to raise the issue, taking out a newspaper ad that pointedly referred to her by her given name, Nimrata, even though she has always gone by Nikki. But it didn’t matter. She appealed to other suburban moms and charmed conservative farmers.

“She was just very confident about it — very confident,” Miss Rita said. “That’s her personality. She did not grow up in the South.”

Miss Rita saw me raise my eyebrows.

“I mean — she grew up in the South. But I think her family influence would be a little different from someone who had maybe southern parents and that kind of thing. How they brought her up, and gave her that confidence that she has, I see it every day. I saw it in the governor’s office, and I see it when I watch her speak as an ambassador.”

All her life, Nikki Haley has been the different one. In a small southern town where divisions were a matter of black and white, she grew up as neither. In a state where men held almost all the positions of power, she rose from her mother’s shop to the governor’s mansion in a scant six years. In a party that, of late, has been gripped by the reactionary forces of white nationalism, she became a star by presenting herself as an avatar of the “New South,” with an appealing personal story of immigration and assimilation. Once a fierce critic of Donald Trump’s divisive policies, Haley is now ambassador to the United Nations, perhaps his most presentable emissary to the world: the diplomatic face of a profoundly undiplomatic presidency. One former adviser to George W. Bush calls her “the most normal thing the president has done in foreign policy.” Haley doesn’t seek to reconcile these contradictions. She just breezes past them, on her way to a more important destination.

In an administration filled with political neophytes, many of them plucked from Trump’s business Rolodex or the ideological fringes, Haley is the rare figure — Vice-President Mike Pence is perhaps the only other — who possesses both a personal power base and the ambition to use it. Her intention to run for president one day is widely presumed by everyone, from her friends to the man she serves — for now. “Knowing Nikki Haley,” a confidante from South Carolina predicted to me earlier this year, “she’ll do exactly what she has to do to have her fingerprints on nothing and take credit where she can.”

Sure enough, over the past few months, as war clouds have gathered and Trump has lambasted both allies and adversaries, Haley has deftly explained away the president’s careless words while helping him transform his outbursts into action. At the U.N., she has aggressively built the case for a potential war with North Korea, which is building nuclear weapons, while working to scuttle a multilateral pact designed to keep Iran from following suit. In the process, she has maneuvered her way into a central role in the administration — outshining her supposed boss, Secretary of State Rex Tillerson — while mostly avoiding the wrath of a president who hates it when anyone steals his limelight. “That’s some fine footwork,” marvels a Republican foreign-policy expert.

Trump’s foreign policy has been defined by infighting among factions of right-wing nationalists, former generals, family loyalists, and a secretary of State who has reportedly referred to the president as a “moron.” In late November, news reports emerged that Trump plans to replace the embattled Tillerson with CIA director Mike Pompeo. Though the president dismissed the rumors as “fake news,” Pompeo has been actively recruiting experienced hands to work for him at State. Haley, who was reported to be in the running for the job, has publicly stated that she doesn’t want it, and sources familiar with her thinking insist that isn’t just spin. “She’s very content with staying at the U.N. and is actually happy that Pompeo inserted himself into the situation,” says one person in contact with Haley’s team. “Anyone who gets too close to Trump’s orbit gets burned.”

In internal debates, Haley has been aligned with Pompeo, often forming a hawkish alliance with national-security adviser H. R. McMaster. “She becomes the vessel for them,” says a former official who deals with the administration on foreign policy. Unlike Tillerson, Haley has skillfully managed her most important bilateral relationship: the one with Trump. “Her gut instincts are very similar to those of the president, which is probably why they have been so in sync,” says a senior administration official. “She has been lock-stock committed to the things that people want her to do.”

Yet Haley has also managed to keep a measure of political distance from Trump and the chaos he creates — an impressive diplomatic feat. “She’s playing a double game,” says Stephen Schlesinger, a Century Foundation expert on the United Nations. “With the Trump people, she wants to make sure she’s one of the soldiers marching to his tunes. At the same time, for her own political future, she wants to look like she’s an independent spirit.” Her current position at the U.N. should advance her career aims in the long term, provided that she uses her influence to help the world avert disaster in the short term, which is proving to be a grave challenge.

Last July 4, as Americans set off fireworks, North Korea successfully tested a new intercontinental ballistic missile capable of hitting American territory. The following morning, the U.N. Security Council held an emergency session. The council’s chamber, originally a gift from the government of Norway, is a spare, carpeted room decorated with blond wood, white marble, and a soft-toned mural depicting symbolic scenes of uplift. It is a place of ice, not fire. But Haley, like the president she represents, has little time for the muted language of the U.N.

“I must say that today is a dark day,” Haley proclaimed, “because yesterday’s actions by North Korea made the world a more dangerous place.” If the Security Council failed to react in a “serious way,” by adopting new trade sanctions, she warned, the United States was “prepared to use the full range of its capabilities,” including “our considerable military forces.”

China rebuffed her, and Russia denounced her “provocation and warmongering.” Even within the White House, there was considerable skepticism that Haley could persuade the Security Council to take serious action. But after weeks of intense negotiation — and a second North Korean missile test — Haley prevailed, winning a unanimous vote for harsh sanctions. Trump called her up afterward to offer his highest compliment, saying she’d made a great deal.

Yet Trump’s gut instinct for confrontation is impossible for anyone, including Haley, to calm for long. A few days after the sanctions vote, in an apparently improvised remark, Trump threatened to unleash “fire and fury like the world has never seen” if North Korea dared further provocation. Since then, he has repeatedly derided efforts to resolve the crisis through negotiation. “The general diplomatic view is that Haley has succeeded on a lot of issues in translating Trumpism into workable policy at the U.N.,” says Richard Gowan, a U.N. expert at Columbia University. “But she cannot control the beast.”

April 24: Meeting with top U.N. ambassadors, Trump jokes that Haley “could be easily replaced.” Photo: Jabin Botsford/The Washington Post/Getty Images

To get to Bamberg, South Carolina, you exit Interstate 26 and hang a right at a street named for Senator John C. Calhoun, the infamous godfather of secessionism, and drive along a country road past miles of cotton fields, swamps, and boiled-peanut stands. At the border of the town, population 3,600, there’s a proud sign reading HOME OF NIKKI HALEY.

As I walked into the county-council building, CNN was on a wall-mounted TV, and commentators were discussing North Korea’s claim that the world was at the “brink of a nuclear war.” Trent Kinard, a member of the council, offered to show me around town. A Democrat and former highway patrolman, he was a childhood classmate of Haley’s.

“We all were real good friends,” Kinard told me, putting a pinch of dip in his lip as he got behind the wheel of his Cadillac. He drove a few blocks to the brick ranch house where Haley grew up. “Little modest home,” Kinard said, adding that her parents “had a temple in there, I remember that. That was the neatest thing ever.”

Haley’s parents moved to Bamberg in 1969. As the first Indians to take up residence in town, the Randhawas were figures of local curiosity. But they strove to be accepted. Haley’s father, Ajit, who taught biology at a nearby historically black college, became a turbaned fixture in the local newspaper, constantly promoting civic initiatives. A 1979 issue featured a smiling photo of the four Randhawa children under the headline FUTURE CITIZENS OF TOMORROW. Haley’s mother, who wore a sari, opened the first location of Exotica on the main road through town, selling imported gifts and trinkets. The Randhawas organized an annual International Festival, bringing ethnic foods and music and dance performances to Bamberg.

Still, in her autobiography, Can’t Is Not an Option: My American Story, Haley described feeling alienated at times as a child. Bamberg is divided by a railroad track. “On one side lived the black residents, on the other the white,” she wrote, recalling that the Randhawa family “didn’t fit either category. We weren’t dark enough to be black or pale enough to be white.” According to a story that has become part of Haley’s political lore, she was once disqualified from a beauty pageant that crowned both a white and a black queen, because the organizers didn’t know where to place her in the competition.

Haley is Trump’s most presentable emissary to the world: the diplomatic face of a profoundly undiplomatic presidency.

“Have you read her book yet?” Kinard asked. “Bullshit!” Kinard, who is white, claimed that Haley was anything but a misfit. “Everybody loved little Nikki,” he said. He pointed to a swimming pool surrounded by a tall fence topped with barbed wire — a private club established during desegregation. “The old white guys, which was normal back then, they all said the hell with this, we’ll build our own pool,” Kinard said. “Nikki became the first person of color to ever swim in here.” Haley attended high school at one of the private “segregation academies” that white families had founded to avoid the impoverished public-school system, then went to Clemson on a scholarship. Her first weekend there, a friend introduced her to a boy named Bill Haley. She preferred his middle name, Michael, so now he goes by that.

When Haley first became prominent in South Carolina politics, many people had no idea she was Indian-American. A black state legislator later said, in a comment that Haley attacked as racially offensive, that voters saw her as a “nice conservative woman with a tan.” In her book, Haley wrote that growing up in Bamberg made her “adept in the art of finding common ground,” which in practice often meant downplaying her ethnicity. Much as Barack Obama positioned himself as a “post-racial” Democrat, Haley made the case that Republicans could appeal to an increasingly diverse electorate. Instead, the rise of Trump, and his politics of racial discontent, has placed her in awkward company.

The same day I toured Bamberg, Haley stood shoulder to shoulder with Trump and Tillerson outside the president’s club in Bedminster. Her face wore a stricken expression as the president talked about launching a war that could cost millions of lives. I recalled that her husband had served a tour in Afghanistan as an officer in the South Carolina National Guard. Later that evening, scrolling through Twitter, I saw the first reports from Charlottesville, where white supremacists were marching by torchlight.

September 18: On his first day at the U.N., he praises delegates for making Trump World Tower “a successful project.” Photo: Doug Mills/The New York Times

In September, North Korea tested what it claimed was a hydrogen bomb, a massive leap in its nuclear capabilities. Two weeks later, Trump went to the U.N. to address its annual General Assembly. The speech was expected to be antagonistic, given the president’s desire to slash U.S. contributions to the U.N.’s budget and his previous criticisms of the organization (“just a club for people to get together, talk, and have a good time”). The hall, filled with visiting heads of state, was eerily subdued as Trump shuffled to the podium. A North Korean official, seated in the front row, stormed out in silent protest.

The speech began incoherently, alternating between internationalist bromides and America First rhetoric. But when Trump turned to North Korea, the tone took a sharp turn. “The United States has great strength and patience,” he declared. “But if it is forced to defend itself or its allies, we will have no choice but to totally destroy North Korea.” Watching the speech from a balcony above the hall, I could hear a collective gasp, then murmuring in dozens of languages, as delegates exchanged disbelieving looks.

“Rocket Man,” Trump continued, “is on a suicide mission for himself and for his regime.” Haley, listening in the hall, stared ahead stone-faced. The next day, though, she was all over the talk shows, praising the president’s “blunt, honest approach,” and his genius for branding.

“Do you think it’s appropriate to use a term like ‘Rocket Man’ to talk about a leader of another country who’s got nuclear weapons?” George Stephanopoulos asked.

“Well, I’ll tell you, George, it worked,” Haley replied. “I was talking to a president of an African country yesterday, and he actually cited ‘Rocket Man’ back to me.”

Haley’s visibility is a key component of her power. “What the ambassador has going for her is, she’s very good on TV,” says Jason Miller, a Trump campaign spokesman who has known Haley for years. “It’s not an administration for people who are wallflowers or who are shy about addressing opponents.”

The contrast, implicitly, was with Tillerson, whose public reticence and cautious positions — take it slow with North Korea, don’t trash the nuclear deal with Iran, don’t allow the Saudis to upend the power balance in the Middle East — run counter to the president’s bilious instincts. The schism has created internal chaos. “When there’s no other mechanism,” says Aaron Friedberg, an adviser to Vice-President Dick Cheney, “then the palace intrigue becomes the policy.”

Tillerson’s imperious management has sparked a rebellion among the State Department’s foreign-service professionals, but Haley has shown a softer touch. Her motto, she told her U.N. staff, is “Kick ’em with a smile.” While the approach has charmed many of her fellow ambassadors, it doesn’t appear to have worked on Tillerson. (“He fucking hates her,” a senior administration official told The New Yorker.) There is a natural dynamic of competition between their offices: Though the U.N. ambassador technically works for the State Department, Haley has an equal seat in the Cabinet. The friction has been exacerbated by Trump’s willingness to let his underlings spar in public. “In any other administration, that would not be tolerated,” says a Republican foreign-policy adviser who served in a previous administration. “My impression is that Trump likes having different people out there articulating different points of view. It’s partly how he decides what he’s going to be for — he sees how different ideas are received.”

Trump, famously, hates being guided into decisions. But Haley has been adept at discerning where he wants to go and then helping him to find a way to get there. “She doesn’t wake up thinking about, ‘How do I outmaneuver Tillerson?’ ” says the former official who still talks to Haley. “She just does it.”

September 19: Arriving for his speech to the General Assembly, where he threatens to “totally destroy North Korea.” Photo: Bebeto Matthews/AP Photo

One of Haley’s political gifts — perhaps the most important, given the burden of sexism — is her ability to present herself with disarming modesty. She wears her obvious ambition in the genteel fashion of the South, where a woman will say “Bless your heart” when she wants to convey the sentiment “Fuck you.” “She is definitely driven, and she will run over people to get there,” says a woman who played a key role in Haley’s rise. “Like a very driven man would.”

In the state legislature, which she joined in 2005, Haley made her mark as a young reformer, tilting against what she called the “good ol’ boy system” that dominated state government. “She was always fighting against something,” says Karen Floyd, a former chairwoman of the South Carolina GOP. When Haley tried to force the legislature to openly record how members voted on bills — her signature issue — the house speaker put her in her place by removing her from an important committee.

“She came to me in tears,” recalls Ashley Landess, president of the South Carolina Policy Council, a nonprofit group that advocates transparency. “I took her home, poured a couple glasses of wine, and told her this was going to work to our advantage.”

As a junior legislator, Haley was an ally of the state’s then-governor, Mark Sanford, a parsimonious libertarian who feuded with the pork-barrel conservatives who controlled appropriations. Sanford helped to build Haley’s reputation and introduced her to his campaign strategist, Jon Lerner, who became her most trusted adviser. In 2009, Lerner began to position Sanford to run for president in the midst of the tea-party rebellion. The governor groomed Haley to be his successor, but the association became a liability after it emerged that Sanford had been carrying on a scandalous affair in Argentina, via the Appalachian Trail.

In the governor’s race, Haley’s opponents took to calling her “Mark Sanford in a skirt.” She lagged far behind the front-runner, Gresham Barrett. “I guess you could say I was the epitome of the Establishment,” Barrett says. “I had the Lab retriever. I’d worked on a farm. I had all the pedigree.” As a member of Congress, though, Barrett had voted for the bank bailouts during the 2008 financial crisis, and the tea party flocked to Haley. Sarah Palin, then at the height of her influence, appeared at a rally and gave her a key endorsement. Haley roared ahead in the race. “This Trump wave,” says Barrett, who is now an evangelical pastor, “it started with her.”

As Haley gained momentum, her opponents attacked her on two fronts: race and sex. One state senator — a self-described “redneck” — called Haley a “raghead.” A former political consultant to Haley, who had gone into business as a gossipy blogger, went public with a claim that they’d had an affair. Haley rejected the allegation as a “disgraceful smear” concocted by her opponents. She has never gotten over the way the press chased the story. “In a matter of days,” she wrote, “I had gone from no one caring about my campaign to having a pack of salivating wolves following me everywhere.”

Once in office, Haley lost some of her crusading zeal, governing as a pro-business conservative. She focused on attracting major manufacturers like Boeing to her anti-union state. She championed Republican causes, resisting Medicaid expansion under Obamacare and banning abortions after 20 weeks. “Nikki ran as a real reformer,” Landess told me, echoing the disappointment of many early supporters. “But there’s no doubt she was positioning herself.” Above all, Haley served as a relentlessly upbeat promoter of the state’s business-friendly environment. In an order issued to all state employees, she instructed them to answer the phone, “It’s a great day in South Carolina.”

Then, on the evening of June 17, 2015, hate struck. Dylann Roof, a white supremacist, killed nine people as they attended a Bible-study session at the Emanuel African Methodist Episcopal church in Charleston. As soon as she was informed, Haley called the church’s pastor, Clementa Pinckney, who was also a much-loved state senator. It turned out that Pinckney was among the dead. The next morning, Haley took a state plane down to Charleston to visit the crime scene.

When she returned to Columbia, Haley told her advisers she wanted to make a bold statement. The following Monday, surrounded by most of the state’s political leaders, Haley proposed to remove the Confederate flag from the grounds of the state capitol. For decades, the flag — originally raised in defiance of desegregation — had remained a toxic issue, inspiring protests and unsatisfying attempts at compromise. But the tragedy had presented Haley with a political opening, which she knew might be fleeting.

When a bill to remove the flag ran into resistance in the state legislature, where one pro-flag lawmaker referenced “the War of Northern Aggression” in his floor speeches, Haley addressed a closed-door meeting of Republican legislators. “I grew up being an other,” she told them. “I don’t talk about race and I don’t talk about challenges because it doesn’t get us anywhere.” But on this occasion, Haley recounted a story from her childhood about watching the proprietor of a produce stand call the police on her father because he was wearing a turban. “Every time we pass that produce stand, I think of that girl that loved her dad, but saw that they saw something different,” Haley said, her voice choking up. Then she turned to the issue of the flag. “I know you’ve prayed over this, I know you’ve hurt over this, and I know you’ve seen polls,” Haley told the legislators. “What I hope at the end of the day is: Think of those kids riding by, and make sure they don’t feel any pain.”

The bill passed. “Only a Republican could get the Confederate flag taken down, and probably only a Republican like Nikki Haley,” says the conservative commentator Erick Erickson, a longtime supporter. Afterward, many opinion-makers in Washington, including some liberals, swooned for Haley. South Carolina held a key early presidential primary, and the Republican contenders competed for her endorsement. She looked like an ideal running mate for whichever candidate emerged to challenge Hillary Clinton.

Meanwhile, though, Donald Trump was building a grassroots movement with a message diametrically opposed to Haley’s. When he called for a “total and complete shutdown” of Muslims entering the country, Haley called the proposal “absolutely un-American” and “unconstitutional.” When Paul Ryan and Mitch McConnell invited Haley to give the Republican rebuttal to Obama’s final State of the Union speech, she took aim directly at Trump. “During anxious times, it can be tempting to follow the siren call of the angriest voices,” Haley said. “We must resist that temptation.”

After a long courtship, Haley ended up backing Marco Rubio. The politician who had called her a “raghead” endorsed Trump and organized a rally for him on her home turf of Lexington County. At the event, Trump revealed the surprise endorsement of Henry McMaster, Haley’s lieutenant governor. But even after Trump won the primary in a landslide, Haley continued to campaign against him. Her political strategist, Lerner, worked on behalf of Rubio and other clients all through the spring, trying to mobilize a “Never Trump” resistance. Trump fought back with typical ferocity. Responding to one attack, he tweeted: “The people of South Carolina are embarrassed by Nikki Haley!”

Less than 30 minutes later, Haley tweeted back: “Bless your heart.”

Haley ultimately attended the GOP convention and halfheartedly supported the nominee. “She was much more introspective than most people would have expected her to be at the time, trying to figure out why there was this angst and anger fueling this,” Erickson says. At the same time, if Trump lost, which seemed inevitable, there would be an opening at the top of the party for a telegenic woman with executive experience. “That was her plan,” he says. “And it was not just her idea, but other Republican leaders were pushing her to be that person to provide a contrast to Clinton.” Haley’s staff had booked her to appear on talk shows like Meet the Press right after the election, in what was expected to be the first volley in a TV blitz. She watched the results at the governor’s mansion with her inner circle. By the next day, Haley’s appearances were canceled, and her political future was unclear.

Despite her previous opposition, Trump’s advisers saw Haley as a potential asset to the administration. The week after the election, at a meeting of Republican governors in Orlando, she huddled with Mike Pence. While there, Haley received a call from Reince Priebus. The president-elect wanted to meet with her at Trump Tower. Haley flew straight up and was brought in through a back entrance so she didn’t have to pass the press stakeout in the atrium. Word nonetheless leaked that Trump, as a conciliatory signal, was shortlisting her for secretary of State. Removing Haley from South Carolina would also repay the early endorsement of Henry McMaster, who would succeed her as governor.

When Trump asked Haley if she wanted to be considered for the job, however, she shot down the trial balloon. She wasn’t interested in a public audition, and she told Trump her lack of foreign-policy experience would hamper her in a department as large and complex as State. So transition officials came back with a firm offer: U.N. ambassador. For Haley, the job offered an opportunity to earn foreign-policy credentials and burnish her profile without becoming enmeshed in the craziness that was bound to surround Trump in Washington. “She is kind of away from the eye of Sauron up there at the U.N.,” says a former State Department official who informally consulted with the Trump transition.

On many foreign-policy issues — particularly the humanitarian ones outside Trump’s interest — Haley has charted a course similar to her predecessors. She’s stressed human rights, shedding tears over children caught in civil war during a recent trip to Africa and pointedly visiting a camp for Syrian refugees. When the administration’s nativist faction recently persuaded Trump to pull out of a U.N. compact on migration, Haley was reportedly a lonely dissenter. But serving as the president’s public messenger has required her to recalibrate some of her stances. In her first days on the job, many career officials in the U.S. Mission were disheartened when she defended Trump’s Muslim travel ban as a security necessity. She now rationalizes the president’s taunts and tweets, insisting that his unpredictability has strategic benefits, and takes care to remain aligned with Trump on the big foreign-policy issues.

Nowhere has this been more evident than in the debate over whether to continue to honor the nuclear deal with Iran. Over the summer, according to Politico, as Trump raged against the deal to Tillerson, who favored staying in it, Haley met with the president and offered to “lay a foundation” for withdrawal. She followed up with a public speech outlining a scenario in which Trump could “decertify” Iran’s compliance and kick the issue over to Congress. Tillerson was reportedly furious, but the president ended up following Haley’s course. Ron Dermer, the Israeli ambassador to the United States, credited Haley with “helping to translate his gut desire to take an action into a policy.”

It would be unfair to view Haley’s hawkish tendencies as mere bureaucratic positioning. She may be kinder than Trump, but she is not exactly gentler. In April, at the Security Council, she held up gruesome pictures of Syrian children killed in a chemical-weapons attack, shortly before Trump launched cruise missiles in reprisal. She has accused North Korea of “begging for war.” She has said the administration is “taking names” of nations that “don’t have our back” on its foreign-policy agenda, which has repudiated international agreements on everything from trade to climate change. And she has been an unstinting defender of Israel, inveighing against Hezbollah and Hamas and publicly supporting the recognition of Jerusalem as the Israeli capital long before Trump announced his decision on the matter.

Ideologically, though, Haley is less like Trump than like another moralistic, self-confident, interventionist former governor: George W. Bush. Neoconservative intellectuals, shut out by Trump, see her as a friend inside the administration. “Trump has talked against nation-building and doesn’t tend to use ‘human rights and democracy’ language,” says one former Bush-administration official who talks to Haley. “She’s obviously made a conscious decision to jump into that gap and try to fill it. Since she’s a good politician, it seems she’s made a judgment that it will help her, not hurt her.”

In October, Haley traveled across midtown to the Time Warner Center for a conference on “The Spirit of Liberty,” sponsored by the George W. Bush Presidential Center. Bush himself sat in the front row as Haley took the stage along with two former secretaries of State, Condoleezza Rice and Madeleine Albright. “I’m really glad you are where you are,” Rice said, addressing Haley. Then, with exquisite politesse, she and Albright laid out a stinging bipartisan critique of the way Trump has undermined NATO, free trade, and human rights. The president’s rhetoric, Rice suggested, has reinforced what she called “the four horses of the apocalypse: populism, nativism, isolationism, and protectionism.”

Haley responded as if she were speaking from an alternate universe, where America’s leader was an orthodox conservative, not a demagogue who, that same day, was raging against the family of a U.S. soldier killed in Niger. “The country needs to believe that everything’s okay,” Haley said. “They need to know there’s stability.” She claimed that America wouldn’t be “tearing up” any trade deals. She struck a confrontational tone on Russia. “When a country can come interfere in another country’s elections, that is warfare.”

After Haley left the dais, President Bush gave a speech decrying the “casual cruelty” of the current political moment. “We know that when we lose sight of our ideals, it is not democracy that has failed,” Bush said. “It is the failure of those charged with preserving and protecting democracy.” But Haley was already gone, back to work for Trump.

Haley is careful, in public, to avoid any mention of her prior disagreements with Trump. Those closest to her, however, make sure to send the message that she has not backed off her warning about the “angriest voices.” Rob Godfrey, Haley’s spokesman as governor, told me proudly, “What she said was right then, and it’s right now.” At particularly low moments, Haley has even hazarded a few oblique criticisms. “I know all too well the pain hate can cause,” she tweeted after the white-supremacist violence in Charlottesville. She told CNN she had a “personal conversation” with Trump about his statement that “both sides” were to blame. She followed up with an email to her staff, which was immediately leaked. “Those who march spewing hate are few, but loud,” she wrote. “We must denounce them at every turn.”

As the most high-profile woman in Trump’s cabinet, Haley has also walked a careful line when it comes to gender issues, including the current barrage of sexual-harassment allegations against powerful men in media, entertainment, and politics. On Sunday, during an appearance on CBS’s Face the Nation, she said it was “for the people to decide” whether previous allegations against Trump are credible, while also emphasizing that “we should all be willing to listen” to his accusers.

“She still believes to this day,” says a former Republican Party official who knows her well, “that Nikki Haley and Marco Rubio’s style of politics represents the future of the party, not Trump’s.”

At the U.N., Haley has surrounded herself with a fiercely protective circle of young aides she brought with her from South Carolina. “The No. 1 person she listens to is Jon Lerner,” says a former State Department official. Haley’s longtime political strategist now serves as her deputy in Washington — a post traditionally occupied by a career foreign-policy specialist. A former Obama-administration official deemed it “legitimately crazy” that Haley would put a campaign operative in such a crucial policymaking role. But Lerner — a protégé of Arthur Finkelstein, the famously ruthless consultant responsible for the careers of Jesse Helms and Al D’Amato — has a long-term plan for Haley, and he is there to make sure nothing derails it.

“I certainly think she has presidential aspirations,” says Tom Davis, a South Carolina state senator who knows Haley and Lerner well. “George Bush had Karl Rove, and Obama had Axelrod. Nikki Haley has Jon Lerner.”

It remains to be seen whether Haley’s association with Trump will prove to be career-making or career-killing. If things continue to go badly, the mainstream Republicans who abet him may pay a reputational price. For now, though, she has managed to keep up the double game, serving without appearing to be servile. “Nikki is carving out a very unique space,” says Katie Packer Beeson, a GOP consultant who fought Trump during the primaries. “She’s somebody who the Bush-McCain-Romney Republicans really like, and she’s seen as a sort of sane, common-sense part of this administration. Down the road, when Trump is no longer running, she is going to be very formidable.”

For a politician with presidential hopes, Manhattan is a strategic perch. Haley’s role brings her in frequent contact with internationally minded philanthropists — the Council on Foreign Relations crowd — who also happen to be the kind of wealthy donors who finance presidential campaigns. Earlier this year, she talked foreign policy at a dinner held at the Park Avenue apartment of Andrew Tisch, a billionaire whose philanthropic causes include an organization to promote international aid. “She was there for two hours,” one attendee recalls. “And she didn’t say the words ‘Donald Trump.’ ”

Trump, no stranger to ambition, is said to be keeping a wary eye on Haley’s presidential aspirations. For her, the trick is to succeed without succeeding too much. At times, Trump has sought to reassert his dominance. In April, when Haley brought all the ambassadors on the Security Council to the White House for a lunch, the president made a heavy-handed joke. “Does everybody like Nikki?” he asked. “Otherwise, she could easily be replaced.”

But ousting Haley seems both unlikely and unnecessary, given how faithfully she is performing in Trump’s bellicose production. On November 29, after North Korea staged a test of its most powerful ballistic missile to date, Haley addressed an emergency session of the Security Council and parroted the terrifying line Trump used to shock the General Assembly just months earlier. “If war comes, make no mistake,” she declared, “the North Korean regime will be utterly destroyed.” Haley may have started off a long way from Trump, but the closer she comes to the power of the presidency, the less different she appears.

*This article appears in the December 11, 2017, issue of New York Magazine.