An MI6 worker who tried to sell secrets for £2 million was given a 12-month jail sentence today for his "act of betrayal".
But Daniel Houghton, 25, will be released almost immediately because he has already served half the term while on remand.
Houghton, a software engineer of Hoxton, east London, pleaded guilty to two offences under the Official Secrets Act at an earlier hearing.
He offered to hand over sensitive computer files containing information about intelligence collection and MI6 staff lists to agents from the Netherlands, the Old Bailey heard.
They at first thought it was a hoax but later tipped off their UK counterparts and Houghton was arrested after arranging a meeting at a London hotel in March.
Mr Justice Bean told him: "The effect on the SIS (Secret Intelligence Service) credibility and the morale of its officers of this kind of act of betrayal is a serious matter."
The judge said he did not know whether it was true, as Houghton claimed, that he was hearing voices that told him to do it but said he was a "strange young man".
The court heard that Houghton tried to sell two secret staff lists, one containing the names of 387 individuals and the other with the home and mobile telephone numbers of 39 individuals.
Piers Arnold, prosecuting, said: "It was a personal betrayal of these individuals with the potential if it had fallen into the wrong hands to compromise individuals' safety."
Houghton had worked for the Secret Intelligence Service (SIS), also known as MI6, between September 2007 and May 2009, the court heard.
During this time he accessed "a number of computer files" belonging to the British Security Service (MI5) relating to the work of both intelligence agencies - marked "secret" or "top secret".
They were described as "sensitive capabilities files, important tools developed by SIS staff for the gathering of intelligence for national security purposes".
Mr Arnold said Houghton "dishonestly" removed them from his place of work and in August 2009 tried to sell them to the Dutch Secret Intelligence Service.
After a series of telephone calls it was agreed that he would fly to Holland for a meeting in January this year, at which the Dutch agents were persuaded that he had worked for the SIS as he claimed, and they tipped off MI5.
Houghton later offered to sell the files, plus the staff lists, for £2 million but eventually a fee of £900,000 was agreed upon.
He said that he had copied the material onto a disc which he had taken home and copied in turn onto two memory cards stored at his mother's address.
Houghton handed over the cards to the Dutch at a London hotel on March 1 and was given a suitcase containing £900,000.
In the lobby he was arrested and handcuffed by plain clothes police officers after they wrestled him, struggling, to the floor.
An assessment carried out by SIS found that if the intelligence files he handed over had fallen into the hands of a hostile nation it would have posed "significant risk to future SIS operations", while MI5 faced similar risks.
Copies of the files were also found on a memory card and hard drive at Houghton's home - contradicting his claims to the Dutch agents that there were no other copies of the documents he handed over, Mr Arnold said.
David Perry QC, defending, said: "This was not an offence committed by a calculating ideologue to disclose material to a hostile sovereign state."
He said the Dutch agents contacted by Houghton "at first thought it was a hoax".
"They thought he was either a journalist or a swindler," Mr Perry said.
"The way he was described by one of the Dutch agents was as a naive young man who came across as a loner."
He said the offences were "incompetently executed" and it was clear that Houghton would be caught.
Mr Perry said he had used his own phone to approach the Dutch, and he had made no attempt to conceal his identity.
He also said Houghton, who had been a student at Exeter College in Devon, was employed at a relatively low level as a £23,000 a year software engineer.
Mr Perry said the defendant, who came from a "supportive" family, had no previous convictions and would go to live with his mother in Devon on his release.
The judge told Houghton: "You were employed by the security services and attempted to sell secret material for very large sums of money.
"In particular you attempted to sell staff lists which would have disclosed the identity and homes and whereabouts of agents whose identity must be protected almost at all costs.
"If the material had found its way into the hands of a hostile power it would have done enormous damage and put lives at risk.
"On the other hand, you are not an ideologue. If you had been intent on causing harm to this country's interests you would have chosen a different recipient than the Netherlands.
"These were unsophisticated offences. You made no attempt to conceal your identity."
The judge said he had been unable to resolve conflicting psychiatric reports about him.
He told Houghton: "You seem to be a strange young man. But whether you were hearing voices at the time, I don't know.
"If you were hearing voices they may have had a significant influence on your behaviour but they could not be said to remove your responsibility for your actions."
He said that since he had already served 184 days he could be released "as soon as the necessary formalities can be completed".