Al-Qaeda infiltration: A glimpse into a shadowy world
The infiltration of an agent into the ranks of al-Qaeda in the Arabian Peninsula provides a rare insight into the shadowy world of counter-terrorism and the problems for both intelligence agencies and al-Qaeda in knowing whom to trust.
The Yemen operation was carried out amid the highest levels of secrecy, according to officials, and the exact details of the individual's identity remain obscure.
But he appears to have been run by the Saudi intelligence in conjunction with the CIA. Other countries may also have been involved although British officials declined to comment.
The individual has been described by some as a "double agent". In fact, it seems more likely that he is a straightforward undercover agent who infiltrated the group and not a double agent whose loyalties shifted or who told both sides he was working against the other.
The agent managed to convince the Yemen-based al-Qaeda group that he wanted to carry out an attack but then took the device he was given - an underwear bomb impossible to detect by most airport security - and somehow ensured it was delivered it to those it was meant to target.
One report says he is now safe in Saudi Arabia - a key concern over the emergence of the story into the public domain will be whether it compromises his security or those of anyone he knows.
The device is now being analysed at an FBI laboratory and may provide valuable insights into the nature of the device and how it had been improved from the 2009 underwear device that failed to explode.
Crucially, it may help establish whether there is some way of picking up this device through airport security - the lack of metal parts means metal detectors will not find it and even body scanners might miss an underwear bomb if it is well hidden.
As well as handing over the device, the agent is reported to have also passed on other valuable information. This is likely to be details of personalities and operations within al-Qaeda in the Arabian Peninsula - thought to be the most potent branch of al-Qaeda at the moment and one determined to strike the US.
That information may also have contributed to the strike that killed Fahd Al-Quso on the weekend - an al-Qaeda operative who had been linked to the 2000 bombing of the USS Cole and who had become a senior figure in the group - although the exact linkage is unclear.
There is likely to be concerns over the emergence of details of this operation in the US media. Intelligence agencies never like their secrets becoming public.
As well as dangers to the agent, the concern will be that it might make it harder to run similar operations again although al-Qaeda has long been concerned about agents being sent to infiltrate it.
In the past, it often demanded extensive references and other checks before someone would be admitted to training camps to prevent just such an outcome as occurred in this case.
The physical dangers and psychological pressures on an agent working undercover are huge; it requires a remarkable show of nerves with the danger that a wrong word could lead to being discovered and killed.
The operation is in many ways the mirror of the kind of entrapment operations the FBI has run in the US.
In those cases, an individual keen to take part in jihad approaches what he think is a real al-Qaeda linked group and is provided with what he thinks are real bombs or guns. In fact, the group is linked to the authorities and the weapons are inert.
In this case, an agent working with Western intelligence approached a real group and received a real device.
There may even have been concerns over which side the agent was really on, which might explain why airport security was ramped up, including in Europe in recent weeks.
The perils of knowing who to trust were in evidence in December 2009 when an agent the CIA thought was leading them to the highest ranks of al-Qaeda turned out to be working for al-Qaeda all along and killed a number of CIA officers in a suicide attack in Khost, Afghanistan.
That incident - and this latest one in Yemen - show both the potential successes and dangers involved in running agents and working out who to trust.