Every night, as the evening call to prayer ends its slow passage across the dusty Afghan army training centre on the outskirts of Kabul, hundreds of Afghan army recruits tread a weary path from the drill fields to the prefabricated barrack houses where they sleep.
Once inside, a senior Afghan National Army (ANA) officer goes from dormitory to dormitory locking the doors. From the outside.
The soldiers, who spend 10 weeks undergoing basic training before being posted into service, are sealed inside their barracks to try to stop them slipping off during the night.
It's all part of the frantic effort by NATO-led forces to bolster the ranks of the ANA in the lead-up to the withdrawal of most Western military troops by 2014.
Yet this lockdown lays bare the many uncertainties and contradictions underlying the confident rhetoric of Western political leaders that they are building up the Afghan army to be the primary bulwark against ''re-Talibanisation'' of Afghanistan.
And it suggests a worrying disconnect between the public statements of the generals who lead the International Security Assistance Force (or ISAF, as the Western coalition in Afghanistan is dubbed) and the realities on the ground of an increasingly unpopular and vexed war.
For Australia, fresh soul-searching about the price, and worth, of our presence was triggered by the loss of three Australian soldiers on Wednesday night at the hands of a newly recruited Afghan army soldier at a base in Oruzgan's Baluchi Valley.
The pain of those losses was made worse when a US helicopter crashed the next morning in neighbouring Helmand province, killing two Australian commandos.
But it is the increase in so-called ''green on blue'' attacks that is shaking ISAF to its core.
''Green'' is the shorthand designation for allied Afghan forces and ''blue'' for NATO forces.
Leading opponents of the war ask why, if our presence is so resented by those we are meant to be training, are we planning to string our presence out until 2014 (the deadline announced by the US President, Barack Obama, and followed by the Australian government).
Several senior ISAF officers in Kabul have recently confirmed to the Herald that the issue of ''insider threat'' is the top priority for international forces during this fighting season.
All combat deaths are
harrowing, but those caused by firefights and the now infamous improvised explosive devices do not sap morale in quite the same way as attacks from the people who are meant to be on your side.
What is worrying seasoned observers is that insider attacks are seemingly the latest tactic of choice for the Taliban, which cannot prevail against the better-equipped Western forces in conventional combat.
Last year green-on-blue attacks claimed the lives of 35 foreign soldiers under ISAF command.
This year there have been 48 such deaths - and there are still four months of the year to run.
ISAF claims less than a quarter of those attacks are inspired by the enemy, with most triggered by personal or ''cultural'' grievances.
Yet the evidence is mounting that the spike in green-on-blue casualties is part of a deliberate strategy by the Taliban, backed by its allies in Pakistan and Iran's intelligence services.
The leading defence and strategic analyst Professor Alan Dupont, a former army intelligence officer now at the University of NSW, says the use of Afghan soldiers to attack the West is a ''thought-through strategy and program'' by the Taliban.
''It is supported by the intelligence services of, I believe, Iran and Pakistan as a way of inflicting the most psychological and political impact on the Western forces there,'' Dupont says.
''And it's a clever strategy. There is no question that the Pakistani [intelligence service] is covertly supporting the Taliban and to some extent strategising and directing a lot of it.''
A former commander of British forces in Afghanistan, Colonel Richard Kemp, believes there is much more to come.
''It's a horrible thing to say, but it's just another insurgency tactic,'' he told ABC Radio yesterday. ''I think they [green-on-blue attacks] will increase. [The Taliban] are determined to make sure that we appear to leave with a bloody nose.''
As well as driving a wedge in the relationship between ISAF and Afghan allies, the insider attacks also raise serious questions about the readiness of Afghan security forces to assume control of the country.
When the Herald visited Afghanistan earlier this year, it found a coterie of the most senior ISAF generals determined to sell the image of a war slowly but surely being won, and an Afghan security force evolving into an independent and effective entity.
But it is becoming increasingly difficult to argue that the Afghan army is progressing with anything like the speed ISAF desires.
Recent data published by the Pentagon suggests the attrition rate in the ANA in the 12 months to November was a staggering 32 per cent, of which the overwhelming majority were soldiers deserting their posts.
And while the Afghan army has a listed strength of about 175,000 and must reach 300,000 soldiers by 2014, senior officers in Kabul suggest the reality is there are probably about 100,000 Afghan soldiers on duty.
Gary Owen is a former US soldier and aid worker who has spent the past three years working in Afghanistan. In a report for the Afghan Analysts Network he claims the US Defence Department (DoD) and ISAF command are ''spinning ANA success'' by changing the standards for measuring Afghan readiness.
He bases his assessment on a biannual report issued by the Pentagon, called the 1230 Report, which, in part, outlines the evolving US view of the ANA. And he says the US defence department ''keeps changing how it defines success''.
His view is supported by a US Government Audit Office report from July which found, in some cases, that the US was lowering its standards for measuring success.
''What the DoD has to say … makes it clear that what ISAF says about the ANA, in most situations, while technically true, is spin,'' Owen writes.
''It seems clear to me that this spin is intentional, phrased in such a way to paint what is actually a false picture of how well the mentoring of the ANA is going.''
Professor Clive Williams, another former defence intelligence analyst, now with Macquarie University, is sceptical about the likely success of endeavours to build up the Afghan national forces to the point where they will be able to prevent the ''Talibanisation'' of Afghanistan.
''It's not going to be the case that the Afghan National Army will be able to take over in Oruzgan by the end of 2014,'' he says. ''There is no way they will be that good by then.''
Williams, who has made several visits to Afghanistan, most recently in April, is also scathing about the motives and allegiances of those who would be left in charge of Oruzgan once Australia departs. (Australia will take over the lead security role in the province later this year.)
He says the governor, Mohammad Akhundzada, is '' well-known for corruption'', while the local police chief, Matiullah Khan, is paid by Australia to protect its convoys coming into Oruzgan province.
But, says Williams, what Khan does is ''pay some of the money to the Taliban to protect our convoys, so he is to some extent in league with the Taliban''.
''So neither of the people that we could hand over to in that province, who are the local strongmen, are at all desirable characters.''
A former deputy head of the Defence Department, now with the Australian National University's strategic studies centre, Professor Hugh White, is also sceptical about the stated mission of the Gillard government to ''stabilise'' Oruzgan sufficiently to hand over to Afghan national forces by 2014.
''As long ago as 2009 it became clear to everyone that the Western mission in Afghanistan is not going to succeed. And that we were therefore marking time until we could graciously leave. And that's what we are still doing,'' he says.
Twice in her press conference on Thursday, the Prime Minister, Julia Gillard, talked of Australia's mission in Afghanistan being a ''war with a purpose and … a war with an end''.
To that White responds tartly, ''It is not a war with a purpose - it has no purpose except to wait till the end point which has been arbitrarily determined by other people. She is in a position where to justify the fact that we are hanging around waiting for the end, she has to pretend that there is a purpose.''
White and Williams say the government is afraid to enunciate the real reason Australia is still on the ground in Afghanistan, which is to remain in lockstep with the US timetable for withdrawal as part of our continuing investment in the American alliance.
But Dupont argues that it's too early to write off the grand plan of handing over Afghan national security to the Afghans.
''Even though the strategy is a flawed one, there is no alternative,'' he says. He believes that even though the end result might be a weak government under US-backed President Hamid Karzai holed up in the cities, the ANA might have a good chance of fending off a wholesale Taliban takeover if the West continues to provide logistical, intelligence and other support.
''That outcome would be less worse than before,'' he says.
Dupont also believes neighbouring states, including Pakistan and Iran, might have their own reasons for not wanting to see the Taliban completely back in the box seat.
''Pakistan, India and Iran want to see a divided, weakish Afghanistan where they can exercise influence for their own national purposes,'' he maintains.
Dupont also believes a key lesson from the Afghan campaign might be for politicians, in future, to let the military bury its own and not make every combat death an occasion for a prime ministerial press conference or high-profile ministerial appearance.
''No matter how shocking it is at a personal level, it magnifies the death of every soldier to a level that is disproportionate,'' he argues.
''It's counterproductive; it hands the Taliban the psychological and political impact they seek.''
White says Canberra is having difficulty articulating a convincing strategy in Afghanistan when it is obvious the real agenda is following an exit timetable set in Washington.
He is particularly scathing about the rhetoric deployed by military and political leaders who talk of progress on the ground for local Afghans, couched in terms of women and girls who might be making small, but most likely temporary, gains in areas such as attending school.
''There are five [Australian] families today who have lost a son and you are meant to say to them, that was worth it because five little girls go to school? There are things for which it's worth sending soldiers to die but that is not one of them.''
But a former senior officer says soldiers need to give themselves a values-driven narrative in the field to keep up their morale.
''Originally we went there to kill the Taliban, then it changed to nation-building and counter-insurgency and then it became the military thinking things like 'these kids and women need a bit of a hand','' he says.
''Sometimes, telling yourself you are making a difference to individuals is the only way you can cope with some of the things you see.''