British intelligence agent Dr Gareth Williams’ last mission before he was “unlawfully killed” was to infiltrate and report on US hacker meetings, evidence given at his inquest this week has indicated.

Williams appears to have been one of a team of intelligence officers and agents sent to penetrate hacking networks in the US and the UK.

At first sight he appears to be more Austin Powers than James Bond, but Williams is the first spy geek to be publicly unmasked, in sadly sensational circumstances.

His naked and decomposing body was found in the foetal position inside a sports holdall in the bath of his central London flat on 23 August 2010, one week after he had failed to turn up for work at SIS - aka MI6 - headquarters in Vauxhall Cross, London.

Coroner Dr Fiona Wilcox said yesterday that she was satisfied that a third party had placed the bag with his body into the bath and had also, “on a balance of probability”, padlocked it shut.

According to pathologists and escapologists who testified during her enquiry, the padlock on the almost airtight enclosure sealed his fate, stupefying and then killing him within minutes from CO2 poisoning.

His death was “was unnatural and criminally mediated”, she said. It was not suicide.

Gareth Williams

Who shut the lock on the holdall is a question that the coroner said could not be resolved with the evidence available. “Most of the fundamental questions in relation to how Gareth died remain unanswered," she said.

The compelling answer is a sex date a week before – somebody he had invited in to play bondage games and who may have panicked and fled when Williams lost consciousness, or sadistically locked the bag and left him to suffer.

Whoever he or she was, they did not leave enough DNA or forensic traces for detectives to have made progress to date. But the police forensic examination team, who checked through Williams' Mac laptop and iPhone collection, seem to have been blithely unaware of how many digital traces they may have missed or how much more may still be out there.

Williams’ last espionage targets were participants in the Black Hat and Defcon 18 hacker and security conferences held in Las Vegas in July 2010. His SIS manager told the enquiry that Williams was one of a “group” of agents tasked to attend the conferences.

The inquest was told about the unique Defcon 18 badge that had been found in his flat. The gimmick features a reflective display and an embedded digital signal controller that geeks were invited to manipulate.

Previously, as an operational officer, Williams had met two SIS agents working in the field in Britain, although not as their case officer or handler. Had he had not become cheesed off with SIS, the inquest was told, he would have been assigned abroad as a British secret agent. A few months before his death, he asked to go back to GCHQ.

Williams' working life, after graduating with a first in mathematics in 1996 aged 17, was spent in Cheltenham at GCHQ, Britain’s signals intelligence agency. He joined in 2001 after completing a PhD in computer science at Manchester University. His final role in GCHQ had been designing "practical applications for emerging technologies".

In 2007, he applied to become a secret agent by transferring to SIS, the UK's human intelligence agency responsible for spies and spy recruitment. He was put through a series of aptitude and skill tests. He failed. He also attended Black Hat 16 the same year, according to an SIS witness, presumably also then staying on to attend Defcon.

In 2008, he tried again to join SIS, and this time passed the tests. He started in spring 2009 after moving to London, and took part in five SIS training courses before embarking on "active operational work" within UK.

To spy on geeks, you need to hire a serious and thoroughly convincing geek.