SEOUL — Even before he was elected South Korea’s president eight months ago, Moon Jae-in was vowing to take the “driver’s seat” in global efforts to deal with North Korea.

But as the inter-Korean talks have shown this week, it’s clearly Kim Jong Un who’s steering, although Moon could fairly claim to be riding shotgun. It’s Kim who’s decided when the Koreas will talk and what they will talk about.

As for President Trump? Well, he could be said to be in the back, going along for the ride.

As South Korea presses ahead with efforts to bring a large North Korean delegation to the Winter Olympics in PyeongChang next month, it is willingly agreeing to North Korea’s demands. 

But Trump, a former businessman who prides himself on being a masterful negotiator, is claiming — and getting — most of the credit for the sudden burst of Olympics-related diplomacy between the two Koreas.

During a Jan. 4 phone call in which the South Korean leader briefed the American president on the plans for talks with North Korea, Trump asked Moon to publicly give him the credit for creating the environment for the talks, according to people familiar with the conversation. 

(In these conversations, Trump calls his counterpart “Jae-in” — an unimaginable informality in Korean business etiquette. Moon calls Trump “Mr. President.”) 

Later that night, Trump tweeted that the talks wouldn’t be happening “if I wasn’t firm, strong and willing to commit our total ‘might’ against the North.”

At a news conference six days later, Moon agreed Trump deserved “huge credit” for the talks. 

Moon is trying to manipulate Trump into effectively undermining his own policy: putting pressure on North Korea, said one former official, asking for anonymity to protect officials still in government.

“Kim Jong Un is setting the agenda here,” the former official said. “His purpose is to use these talks to show the world that he’s okay and to make the sanctions effort lose steam.”

Since taking office last May, Moon has repeatedly made overtures to North Korea but Kim consistently rebuffed them all — until New Year’s Day, that is. Then, just weeks after declaring that his nuclear weapons program was complete, the North Korean leader called for “detente” with the South. 

This prompted a flurry of activity in the South, including getting Trump to agree in that Jan. 4 phone call to postpone joint military drills until after the Olympics, to avoid antagonizing North Korea.

Further evidence of Kim’s agenda-setting: The first item for discussion this week involved the performances of a North Korean propaganda orchestra known for numbers such as “Our Comrade Kim Jong Un.” Then came the inclusion of a 240-member cheering squad known as an “army of beauties” because these squads have previously been made up entirely of attractive young women — and have been immensely popular in the South.

The South Korean government also agreed to combine the two Koreas’ women’s ice hockey teams — against the strong objections of the Southern team — and agreed to send Southern skiers to train on far inferior slopes in the North over the next few weeks.

The concessions to North Korea have angered many South Koreans, with some publicly wondering whether they’re the PyeongChang or the Pyongyang games. 

More than 31,000 people have signed an online petition calling on the president’s office not to combine the hockey teams. “Politics should not be involved in sports. Is this a fair process, a just result?” wrote one signer.

Realmeter poll published Thursday found that half of respondents thought the two Koreas should march separately under their own flags, while 40 percent supported this week’s agreement that they should march together under a flag showing a unified Korean Peninsula.

 High-ranking officials will come to South Korea as part of the Olympic delegation — including perhaps North Korea’s de facto No. 2, Choe Ryong Hae. If he comes here, which would require his being removed from South Korea’s sanctions list, Moon would hope to meet with him, according to aides.

The Moon administration is trying to build trust with the North in the hope this will lead to talks about its nuclear weapons program — although Kim’s regime has made it clear that this is not an inter-Korean issue.

That process has gained extra urgency as Trump and his aides have talked increasingly about using military options to teach North Korea the error of its ways.

“When our government has talked to the Trump administration, we have always emphasized that the Olympics can be an excuse for North Korea to come out for talks,” said Kim Hong-gul, the son of former South Korean president Kim Dae-jung, who won the Nobel Peace Prize for meeting Kim Jong Il in 2000. Kim Hong-gul met the current North Korean leader at Kim Jong Il’s funeral in 2011 and is an influential voice on inter-Korean relations in the ruling Democratic Party.

 “Our government has even more reason than ever to talk to North Korea because the stakes are now so much higher,” he said. “We need to make sure war doesn’t break out.”

That could also be the reason for Kim Jong Un’s change of heart, said Cheong Seong-chang, an expert on North Korea’s leadership at the Sejong Institute near Seoul.

“Kim Jong Un bragged about the nuclear button on his desk but he can’t rule out the chance that the United States will resort to military options, so he might be trying to buy some time,” Cheong said.

But it could also be because international sanctions are starting to hurt. Regular visitors to North Korea say China has cracked down on border trade to a surprising extent, conducting thorough inspections of all goods going into and coming out of North Korea.

In the short term, this has made life better for the elite of Pyongyang: They are eating fresh fish and enjoying 24-hour electricity thanks to the bans on seafood and coal exports.

There are signs of stresses in the economy, including temporary blips in foreign exchange rates, the visitors say. 

There are plenty of ways Moon’s efforts could go off the rails.

Immediately after the Olympics, South Korea and the United States are set to begin their postponed military drills, which in recent years have included practicing decapitation strikes on North Korea’s leadership.

Chun Yung-woo, a hawkish national security adviser, said this short-term reprieve could lead to longer term problems.

“Once all the diplomatic options have been exhausted,” Chun said, “Moon will have even fewer options left for dealing with North Korea.” 

That, analysts say, could embolden Trump aides like national security adviser H.R. McMaster, who argues that time for dealing with North Korea is running out. And it will be much harder then for Moon to flatter Trump into thinking otherwise.