After reading this question and the associated comments, I was left wondering: For what reasons did the US choose to completely hand over Bagram Air Base to the Afghan Security Forces? Was it primarily a political decision, and/or what are the other major/minor factors involved?
It was a Taliban demand that the US vacate all their bases in Afghanistan. So these were passed over to the Afghan Republic, sometimes with little protocol, in the case of Bagram, in particular. In return, the Taliban only promised not to attack US forces during their withdrawal, a promise that was basically kept. (The Taliban also demanded the withdrawal of all US/Western contractors from the country, actually all "non-diplomatic civilian [US] personnel". Reportedly some 18,000 contractors left (6,000 Americans), in addition to the troops. The Afghan Republic was also not officially part of the US-Taliban negotiations, they just had to accept the results. The Taliban's negotiating strategy was simply to refuse talks with the Afghan Republic representatives.)
Bringing only some of the troops home would have been [more] dissonant with the campaign promise to "end the forever wars in Afghanistan and the Middle East”.
The US still has some "over-the-horizon" counter-terrorism capabilities in the country, which may indeed be enough to deal with [more] isolated threats like the IS-K, e.g. in the aftermath of the Kabul airport bombing. (This counter-strike was reportedly conducted by a Reaper drone launched from a Middle East base.)