Washington (CNN) CIA Director Gina Haspel visited Afghanistan this week to discuss a number of issues including maintaining and possibly expanding the US intelligence presence in the country, according to sources familiar with the visit.

Haspel's visit comes as the Trump administration remains actively engaged in peace talks with the Taliban and just days after three US service members were killed by an improvised explosive device near Bagram Air Base. The Taliban claimed responsibility for the attack. Seven US service members have been killed in Afghanistan this year.

Haspel met with Afghan government officials including President Ashraf Ghani and the country's intelligence chief, Masoom Stanekzai, according to sources familiar with the visit.

The US intelligence footprint in Afghanistan is intimately tied to the US military presence in the country and US bases there provide protection for that intelligence presence. Maintaining that presence, or expanding it, if the US military does begin to draw down, would require the CIA committing more resources to the country. It's also a national security priority to collect intelligence on terrorist groups operating in the area, including ISIS's regional offshoot, especially along the Afghan-Pakistani border.

A CIA spokesperson declined to comment, saying they do not discuss the director's schedule.

Earlier this year, there was a Taliban attack on the compound that is home to Afghanistan's intelligence agency. That attack left dozens of Afghan agency personnel dead.

Peace talks in trouble

President Donald Trump said that the bilateral peace talks between the US and the Taliban "are proceeding well" earlier this year. But in the last few months, those talks have led to divisions between the Trump administration and the Afghan government.

Tensions erupted when Afghan national security adviser Hamdullah Mohib unleashed on US special representative Zalmay Khalilzad, who is leading the US talks with the Taliban. He said Khalilzad has personal political ambitions in Afghanistan and was leaving the Afghan government in the dark on the talks that are taking place in the Qatari capital Doha.

"We get bits and pieces of information," Mohib told journalists in Washington. "We don't have the kind of transparency that we should have. There isn't proper access to information. The last people to find out are us."

After the blow-up, the White House sought to clarify that the Afghan government is a vital player when it comes to securing an agreement with the Taliban.

"It is urgent that we convince the Taliban to sit down with the Afghan government and other Afghans and engage in a political process," explained a senior administration official. "Any settlement just simply won't be sustainable unless the Taliban agrees to sit down with other Afghans and work out a political settlement."

Khalilzad also spent a few days in Kabul earlier this month. He met with current Afghan government officials like Ghani and former officials like President Hamid Karzai.

It is possible that the US, the Taliban and Afghan officials sat down at the table together for the first time this month, according to sources familiar with the planning.

Haspel promised during a hearing on Capitol Hill earlier this year that "a very robust monitoring regime" would be necessary if there were to be a peace accord established with the Taliban in Afghanistan. She also emphasized the need to "maintain pressure" on terrorist groups in Afghanistan and act against them if needed.

Haspel is not expected to be directly involved in the talks with the Taliban herself, but she called Khalilizad's efforts "very intensive" when she spoke to the Senate Intelligence Committee in January.

Skeptics of engagement with Taliban

Yet there are still plenty of skeptics of the Trump administration's engagement with the Taliban. Some Afghan government officials aren't only worried that they are being left in the dark -- they also see the Taliban as equivalent to a terrorist group, and they do not want to be rushed into giving them legitimacy.

"You cannot get a cat to guard your milk. The Taliban and terrorism -- it's one DNA," Mohib said earlier this year. "We're protecting our values, our freedoms and we will not allow someone -- an individual's rushed agreement -- to put that in jeopardy."

In bulking up the intelligence presence, which Haspel discussed during her visit, the US would have a more robust backstop should it start to withdraw US troops.

But the timeline for the US military withdrawal from Afghanistan, which Trump repeatedly promised during his presidential campaign, remains unclear. Despite expectations that a drawdown would have begun by now, US contractors for the Defense Department have continued to see their contracts renewed this year.

A defense official told CNN in December that Trump decided to withdraw about half of the 14,000 troops deployed to Afghanistan at the same time he ordered the military to pull out of Syria. But acting US Defense Secretary Patrick Shanahan, during a trip to Afghanistan earlier this year, said that he had no orders to "step down our forces in Afghanistan."

Sources tell CNN, however, that the US is preparing to substantially draw down its diplomatic footprint in the country by 2020.