The killing of 17 people by Taliban insurgents in Musa Qala, the deaths of 10 Afghan army personnel in a separate, large-scale assault in Helmand, and the killing of two US soldiers by an Afghan national army recruit could be dismissed as just another bloody day in Afghanistan.

Alternatively these gruesome events, taken together, might sensibly be seen as another urgent warning to neglectful western politicians that their policy of gradual, go-slow withdrawal is rapidly unravelling. It is a warning they may ignore at their peril.

Barack Obama and David Cameron have set a departure date for Nato forces of 2014. But the deteriorating security situation, the rank unreliability or underperformance of large sections of the Afghan army and police, and the fearful persistence of the Afghan and Pakistani Taliban may yet force their hand, turning ragged retreat into slow-motion rout.

Western leaders would prefer to ignore Afghanistan. It hardly features in the US presidential contest between Obama and Mitt Romney.

In Britain, news of each soldier's death is received with muted official regret. President Hollande of France has already washed his hands of the affair. The war has become an embarrassment, a hangover from the Bush-Blair days. More pressing issues, closer to home, now dominate.

"Remember the war in Afghanistan?" asks Stephen Walt, professor of international relations at Harvard, in Foreign Policy magazine:

"You know: It was the 'good war,' fought in response to al-Qaida's attack on 9/11 and the Taliban's refusal to turn them in, and subsequently justified by (1) the need to prevent future terrorist 'safe havens,' (2) the desire to liberate Afghan women, (3) the imperative to bring democracy and modern governance to an underdeveloped tribal society, and (4) as always, the need to preserve American 'credibility'."

Walt suggests none of these objectives has been attained. Afghan policy is heading for the rocks, if it is not already wrecked on them, and there is scant chance that Nato will leave behind a functioning state, let alone a liberal democracy, Walt suggests.

If the politicians are asleep at the wheel, oblivious to the dangers, the American military is not. Hence the visit to Kabul last week of the Pentagon's top soldier, General Martin Dempsey, chairman of the joint chiefs. His meetings with President Hamid Karzai and other top officials focused on the massive upsurge in so-called "green-on-blue" attacks by Afghan soldiers or police on Nato personnel.

These "stab-in-the-back" attacks, allegedly orchestrated by Mullah Omar, the top Afghan Taliban leader, have reached epidemic proportions this year, with 42 foreign troops killed and dozens more injured. Eleven US soldiers have died in the past week alone. Dempsey is understood to have discussed counter-measures including an extraordinary plan for the Afghan security force, in effect, to spy on itself.

"Soldiers must feel that they are under the full surveillance of their leadership at all levels," the Afghan army chief of staff, General Sher Mohammad Karimi, said in an interview with the Washington Post after meeting Dempsey. "Initially, it will have a negative impact on morale, but we have to do something. We have to look seriously at every individual."

But Nato commanders cannot avoid evidence that the rise in such attacks may reflect a deepening, wider hostility to the continuing foreign occupation, anger at perceived cultural affronts (such as the Qu'ran burning episode earlier this year), and the continuing toll of civilian casualties caused by both Nato and the Taliban.

According to a 2011 Pentagon analysis, quoted by Bloomberg, only about 11% of the attacks are the result of Taliban infiltration:

"The majority had other causes, particularly disputes or grudges between coalition and Afghan forces … Among the causes identified in interviews with hundreds of Afghan soldiers and police officers was anger over everything from US convoy procedures, night raids and civilian casualties to widespread cursing and shooting of livestock. Even something as elemental as how to urinate while on patrol was a cultural flashpoint. US personnel, the same study found, had 'extremely negative' views of their Afghan counterparts."

Meanwhile, Karzai and his officials blame infiltration by agents acting for Pakistan and Iran for much of Afghanistan's security problems, including Taliban atrocities like the Musa Qala beheadings. They argue their neighbours' spy agencies are intent on undermining efforts to "stand up" the Afghan security forces, as part of a wider struggle for power and influence in a post-2014 Afghanistan.

Pakistan has its own Taliban problem, of course, as a recent attack on a military base at Minhas demonstrated. The Pakistani military is said to be preparing a big new offensive in North Waziristan, a base for militants operating in both Afghanistan and Pakistan. Such an offensive is likely to greatly exacerbate Afghan security problems, at least in the short term.

When they return from their holidays, western leaders urgently need to refocus attention on Afghanistan – before the situation spins fatally out of their control.