Shanahan will meet President Ashraf Ghani, who has warned against rushing into any deal with Washington. This follows major talks between US and Taliban officials in Qatar last month which negotiators hope could herald a breakthrough in the 17-year conflict.
US President Donald Trump is pushing to end US involvement in Afghanistan, where 14,000 American troops are still deployed, raising Afghan fears that Washington could withdraw before securing a lasting peace between the Taliban and the Kabul government.
Shanahan assured reporters that he had no instructions from Washington to begin a withdrawal.
"I have not been directed to step down our forces in Afghanistan," Shanahan said.
"I think the presence we want in Afghanistan is what assures our homeland defence and supports regional stability."
He said it was crucial Kabul, whose representatives were not at the talks in Qatar, was involved in discussions over the future of Afghanistan.
"The Afghans have to decide what Afghanistan looks like in the future. It's not about the US, it's about Afghanistan," Shanahan said.
"The US has significant -- significant -- investment in ensuring security, but the Afghans decide their future."
Shanahan met General Scott Miller, the top US and NATO commander in Afghanistan, before visiting Camp Morehead where Americans train Afghan special forces.
Zalmay Khalilzad, the US special envoy leading the talks, has expressed hope at finding a deal before Afghan presidential elections scheduled for July, but has emphasised that any troop withdrawal would depend on conditions on the ground.
Khalilzad is set to lead a large delegation on a six-nation tour, including Afghanistan, to boost the peace process and seek to bring all Afghan parties to the table.
Constructive talks, but without Kabul
The months-long push by the US to engage the Taliban has ostensibly been aimed at convincing them to negotiate with Kabul, which the insurgents consider a US puppet government.
Ghani spoke last week with US Secretary of State Mike Pompeo, who also stressed the importance of the Afghan government being at the centre of the peace process.
But the insurgents, who ruled Afghanistan from 1996-2001, have steadfastly refused.
Instead they met directly with US negotiators in Doha last month for peace talks described by US President Donald Trump as "constructive".
The US is expected to commence a second round of talks with Taliban officials on 25 February in Qatar, where they have their political office.
Separate talks go ahead in Moscow
The militants, who were toppled by US-led forces in 2001, last week held separate talks in Moscow with a senior delegation of Afghan politicians -- including chief Ghani rivals.
The two-day talks were the Taliban's most significant engagement with Afghan leaders in years, and saw former president Hamid Karzai, among others, dining and praying with the insurgents -- though without the involvement of the government it was unclear what impact the talks will have.
Ghani -- who has vented frustration as his friends and enemies were pictured negotiating the future of his country -- has described the Moscow talks as "nothing more than fantasy".
The Taliban have outlined their vision for Afghanistan, proposing an "inclusive Islamic system" of governance and demanding a new Islam-based constitution for the country.
Both parties released a statement at the conclusion of the talks promising to advance negotiations at a later date.
Shanahan was elevated from deputy defence secretary to the Pentagon's top spot January 1, after Jim Mattis quit amid long-running disagreements with President Trump.
Fear of further civilian deaths in Helmand airstrike
His visit to Afghanistan comes as the United Nations said it was investigating "credible" reports of Afghan civilian deaths and injuries from an airstrike over the weekend in Helmand, a Taliban stronghold.
The UN Assistance Mission in Afghanistan (UNAMA) said late Sunday it would share its findings once an inquiry into the "aerial operations" in Sangin district was completed.
Civilians continue to pay a disproportionate price in the fighting.
The Taliban are responsible for about half of civilian casualties, but a UNAMA report said the number killed by aerial bombings from January until October 2018 reached a record high.