That MI5 is ranked at all represents significant progress for the agency - for gay men and women were prohibited from working at MI5, MI6 and GCHQ until 1992.

British domestic spying agency MI5 has been named the UK's fourth best LGBT employer in the UK by Stonewall, in the charity's annual Workplace Equality Index.

The list, topped by law firm Pinsent Masons, also features the British Army, Lloyds Bank, homeless charity St Mungo's, Newcastle council and the Welsh government. Rankings are based on consideration of 10 areas of employment policy and practice, and staff at each organization also complete anonymous surveys on their experiences of diversity and inclusion in their workplaces.

READ MORE: MI5 Avoided Recruiting Black Spies in the 60s, Citing 'Security Risk' — Reports

The fourth-place ranking actually represents a fall for MI5, having topped the list in 2016 . Then, agency Director General Andrew Parker said diversity was "vital".

"Much of MI5's work keeping the country safe goes on by necessity out of view. So I'm delighted we can be publicly recognised as such an inclusive and welcoming place to work. MI5's success in protecting the country depends on our staff's commitment to the mission and to our enduring values of teamwork, professionalism and innovation. People can only give the best they can give when they feel supported, valued, and treated with respect by their colleagues. This accolade is a great acknowledgement of continued progress we have made over recent years in ensuring we draw on the widest possible pool of talent in our vital work," he explained.

In response, Stonewall Chief Executive Ruth Hunt said the agency had made "fantastic strides in creating an inclusive workplace".

March of Progress

The British security services' long-running aversion to employing LGBT individuals partially stemmed from a widely-held belief they were susceptible to blackmail, and could easily be compromised by 'honey trap' operations. However, simple homophobia also played a significant part — Bletchley Park's venerated codebreaker Alan Turing lost his security clearance simply for being convicted of 'gross indecency' (legal code for having a homosexual relationship) in 1952. He committed suicide two years later.

Moreover, concealed homosexuality was often used as leverage by UK intelligence services. For instance, Jeremy Wolfenden, Daily Telegraph correspondent in Moscow in the early 1960s, was the victim of a KGB honey trap — the Soviet Union's spying appartus knew he was gay, and the Ministry of Foreign Trade's barber was dispatched to seduce him, a hidden camera documenting the resultant tryst.

The KGB then threatened to pass on the photographs to Wolfenden's employer if he did not spy on the Western community in Moscow — Wolfenden reported the incident to the British embassy, but rather than extracting him from the country, they suggested he become a double agent, leading the KGB along and continuing to report back to MI6.

The stress of his double-life drove Wolfenden to alcoholism, and he tried to end his career as an unwilling spy, marrying a British woman he met in Moscow and arranging a transfer from Moscow to the Daily Telegraph's Washington bureau. However, the spy game is not easily left behind — after encountering his old MI6 handler at a British Embassy party in Washington in 1965, he was again compelled to carry out clandestine intelligence work.

His alcoholism progressively worsened, and he died aged-31 in December 1965 from a cerebral hemorrhage caused by a fall in his bathroom. Perversely, Wolfenden's life as a spy produced little useful material for either side in the Cold War — his British colleagues gave him no worthwhile information as they'd been warned he was talking to the KGB, and the Soviets had foreseen the risk of him becoming a double agent and offered him nothing of value either.

Ironically, the Cold War amply demonstrated straight individuals were highly susceptible to honey traps. For instance, Markus Wolf — the long-time head of East German intelligence — crafted an extensive honey trap operation that helped insert his agents into the highest echelons of West German society.

In the early 1950s, Wolf recognized the number of eligible bachelors in Germany had been sharply reduced by World War II, meaning more and more German women were entering government, commerce, and industry. As many were single, Wolf began recruiting handsome, intelligent officers — "Romeo spies" — who were charged with seeking out powerful, unmarried women in Germany, and extracting their secrets.

The operation was so successful East German agents penetrated most levels of the West German government and industry, with spies inside NATO and the private office of West German chancellor Helmut Schmidt.

The scheme only unravelled when West German counterintelligence realized Stasi officers could be identified through their haircuts — practical "short back and sides" dos.

"They were sharp operators who realized that a lot can be done with sex. This is true in business and espionage because it opens up channels of communication more quickly than other approaches. As long as there is espionage, there will be Romeos seducing [targets]. I was running an intelligence service, not a lonely-hearts club," Wolf wrote in his autobiography.