The name of the killed soldier has not been released.
The ambush occurred in southern Afghanistan, U.S. military officials said in a statement without being more specific.
"An American role will be important in this, but we can't run the peace talks, we can't settle this from the outside", Pompeo said, according to a transcript of his remarks.
"The strategy sends a clear message to the Taliban that they can not wait us out", he said.
An insider attack would indicate one carried out by a member of the Afghan security forces.
A US service member was killed and two others wounded after what officials are calling an "apparent insider attack" in Afghanistan. No other details of the attack were available.
Maciel, an infantryman assigned to Fort Benning, Georgia, had been in the Army for two years and in Afghanistan since February, the 3rd Infantry Division said in a statement. It was claimed by the Taliban.
Afghan security forces, supported by global troops, are now trying to oust Islamic State militants from their strongholds the eastern province of Nangarhar.
Radio Free Europe reported that Pompeo's visit to Afghanistan "coincides with what could be a final operation to clear fighters from the IS group and other insurgents in a remote district in the eastern Nangarhar Province".
The latest incident comes as Lieutenant General Scott Miller is set to become the next commander of USA and North Atlantic Treaty Organisation forces in Afghanistan. ISIS is seen as an invading foreign force, its Afghan branch part of a major active threat to American and European security. Efforts to impose a ceasefire in the region have been mostly unsuccessful.