The UK's safety is uncertain following the withdrawal of Western forces from Afghanistan, the foreign secretary has admitted to ITV News.
But the military stands ready to launch self-defence attacks against terrorists such as ISIS-K, should it be necessary, Dominic Raab added.
The senior Tory minister, speaking to ITV News after evacuations from Taliban-controlled Afghanistan were completed, said the number of Britons left in the country was down to "low hundreds", but he conceded the number of Afghan allies still there could be a lot higher.
He said the UK government had been given "direct assurances" from the Taliban that people who want to leave will be given safe passage to escape to third countries, but added he's "sceptical" about promises made by the Islamic State group.
Mr Raab suggested the Taliban should be given chance to uphold assurances it has made about Afghanistan, which includes a commitment to ensure terrorism is not allowed to flourish now Western forces have left the country.
But, when asked if Britain was safer or less safe following its departure, the foreign secretary said: "It's very difficult to say."
He continued: "Over the last 20 years we haven't seen a terrorist attack from inside Afghanistan, we've got to work with all of our partners and hold the Taliban to their promise to never let that happen again."
Asked again by ITV News Political Correspondent Carl Dinnen if the UK might now "be less safe", Mr Raab said: "I think it's very difficult to judge at this stage, it's very fluid, obviously we're concerned. We've seen the ISIS-K attack on Abbey Gate by the airport."
But, he added, "in relation to military matters, we retain the right to exercise self-defence, including against terror groups".
He pointed to comments by Air Chief Marshal Sir Mike Wigston that the UK could launch airstrikes on ISIS-K, an Islamic State splinter group based in Afghanistan.
“Ultimately what this boils down to is that we’ve got to be able to play a global role in the global coalition to defeat Daesh, whether it’s strike, or whether it’s moving troops or equipment into a particular country, at scale and at speed,” he told the Daily Telegraph.
“If there’s an opportunity for us to contribute I am in no doubt that we will be ready to – that will be anywhere where violent extremism raises its head, and is a direct or indirect threat to the UK and our allies.
“Afghanistan is probably one of the most inaccessible parts of the world, and we’re able to operate there.”
Mr Raab also denied claims from the US that the UK’s evacuation plan may have contributed to the risk of a terror attack at Kabul airport.
The foreign secretary said it was “just not true” that the UK called for the airport’s Abbey Gate to be left open for part of its exit operation, which then contributed to an attack, that left more than 170 dead.
The explosion, which killed 13 US service members, has led to a transatlantic blame game, with US sources suggesting the gate that was attacked was kept open to facilitate the British evacuation.
According to leaked Pentagon notes obtained by Politico, Rear Admiral Peter Vasely, the commander of US forces in Afghanistan, had wanted to close Abbey Gate but it was kept open to allow UK evacuees into the airport.
On Tuesday, Mr Raab denied that the UK was "pushing to leave the gate open".
He told Sky News: “We co-ordinated very closely with the US, in particular around the ISIS-K threat which we anticipated, although tragically were not able to prevent.
"It is certainly right to say we got our civilians out of the processing centre by Abbey Gate, but it is just not true to suggest that, other than securing our civilians inside the airport, we were pushing to leave the gate open."
Mr Raab said the UK had in fact warned people in the airport area to leave as a result of the terror threat.
The foreign secretary added that he had an “excellent working relationship” with the US secretary of state Antony Blinken.
US forces finally withdrew from Afghanistan on Monday, a day ahead of the deadline set by Joe Biden, bringing to an end a deployment which began in the wake of the September 11 terror attacks two decades ago.
The end of the Western military presence – the UK pulled out its remaining troops and diplomatic personnel on Saturday – also concluded the airborne evacuation effort from Kabul, leaving Afghans wanting to escape the Taliban facing an uncertain future.
Mr Raab said 15,000 people were evacuated from Afghanistan in the last two weeks of August and would continue processing people for resettlement in the UK from third countries neighbouring Afghanistan.
Downing Street said it is increasing staff in neighbouring countries in order to help evacuate the remaining people left behind.
Boris Johnson's spokesman said: "We are beefing up the number of staff in neighbouring countries, Foreign Office and other staff, to support that.
"That's something that we're in the process of arranging, these surge staff."