What makes a good spy? Is there such a thing? To what extent should spymasters turn a blind eye to crimes, even collusion in murder, committed by their informants or agents?

These important – perhaps increasingly important – issues are discussed in this valuable and thought-provoking book by Stephen Grey, the journalist whose first book, Ghost Plane, about US and UK involvement in the secret rendition of detainees in the “war on terror”, raises questions that remain unanswered.

The New Spymasters breaks new ground, not so much in revealing hitherto unknown cases of espionage, but in identifying and pursuing a number of cases – including that of MI6’s spies, who were never in Iraq before the 2003 invasion – where British and US security and intelligence agencies were deeply involved.

They include Steak Knife, pseudonym of the IRA member recruited as a British agent in Northern Ireland; a member of Eoka, the guerrilla group fighting British colonial rule in Cyprus, who spied for the British army (and later for British customs and police fighting the drug trade); and Omar Nasiri, pseudonym of a member of Algeria’s Armed Islamic Group (GIA), who spied both for French foreign intelligence and MI5.

The more active an agent is, working, even killing, for the enemy, the less likely he is to be suspected of being a double agent, providing information that would help save other lives. That, at least, is the spymasters’ argument. The case of the murdered Belfast lawyer Patrick Finucane illustrates the dangers of running agents inside terror gangs, Grey writes. As the third inquiry conducted by the former Met police commissioner John Stevens into collusion between loyalist paramilitary groups and British intelligence stated: “Informants and agents were allowed to operate without effective control and to participate in terrorist crimes.” This is part of the legacy of the conflict in Northern Ireland, which has left deep scars that are far from healed.

There are many people, as Grey says, who used contacts with British and other western agencies to their own advantage. He recounts the case of Rafid Ahmed Alwan al-Janabi, codenamed Curveball, who duped German, US and British intelligence officials with claims that Iraq possessed mobile biological weapons laboratories, in his efforts to see the end of Saddam Hussein.

“The really disturbing thing,” Grey writes, “was not the spinning of evidence or the imagined conspiracy, but rather that the intelligence itself was wrong.” MI6 succumbed to intense political pressure and allowed its Iraqi agents and contacts to spin the evidence. As Sir David Omand, Tony Blair’s former chief security and intelligence adviser, told the Chilcot inquiry, MI6 “overpromised and underdelivered”.

Intelligence chiefs indulge in wishful thinking, just as they ignore inconvenient information, a syndrome called “cognitive dissonance” in the trade. And if western spooks knew little about what was going on in Saddam’s Iraq, they knew even less about al-Qaida and what was going on in Afghanistan. The CIA fatally dropped its guard when it allowed itself to be convinced that a Jordanian, Human al-Balawi, whom it had never met, was a spy who could be trusted. In 2009, Al-Balawi was able to enter the large US base in Khost in Afghanistan unsearched, before blowing himself up along with seven CIA employees.

In their intelligence-gathering role, it is the task of MI5 (in Britain) and MI6 (abroad) to recruit agents and informers. It is much harder for them now than it was in Ireland and during the cold war. Young, ideologically motivated, extreme jihadists are not likely to trust a state’s spy agencies. Grey records that a friend of Michael Adebolajo, one of the two men involved in the brutal murder of fusilier Lee Rigby in Woolwich in 2013, has said Adebolajo was “well-known” to British intelligence. He was “being harassed by MI5”, the friend told the BBC.

Grey quotes Sir Richard Dearlove, head of MI6 at the time of the invasion of Iraq (who is expected to be strongly criticised by Chilcot), as saying that while the west occupied the moral high-ground at the end of the cold war, it was “not on it at the moment”. Dearlove was referring to “extraordinary rendition” – the CIA practice, in which both MI5 and MI6 colluded, of sending mainly Arab prisoners to secret jails where they were tortured. Curiously, though, Grey does not mention the clearest case of MI6 involvement in rendition – the abduction in 2004 of Abdel Hakim Belhaj and Sami al-Saadi, two prominent Libyan dissidents, to Tripoli, where they were tortured by Gaddafi’s security police.

British and US intelligence agencies have had some successes: Morten Storm successfully infiltrated al-Qaida in the Arabian Peninsular (AQAP) in Yemen for the CIA, and MI6 recruited a spy in AQAP in a joint operation with the Saudis. The US succeeded in getting Taliban prisoners in Afghanistan to help identify targets for drone attacks.

MI6 officers have also engaged in activities that are not spying. With varying degrees of encouragement from their political masters, they have opened secret back channels hoping to pave the way for peace talks. Michael Oatley did so with the IRA. More recently, Alastair Crooke held talks with Palestinian militants and Hamas, though after being outed in the Israeli press, he was summoned back to London, handed an honour by the Queen and sacked.

Edward Snowden has revealed how America’s National Security Agency and its British partner, GCHQ, can indulge in mass surveillance and intercept private electronic communications. The Queen’s speech made plain that the new government intends to expand the intelligence agencies’ statutory powers for the bulk interception of the content of communications.

But Humint – “human intelligence”, old-fashioned spying by individuals – will still be needed, as the automatic electronic data-gathering will prevent the NSA and GCHQ from seeing the wood from the trees. So despite his omissions, Grey has provided a good manual for the spy cadets of the future, the dangers they face and the traps they may well fall into – but also the potential rewards.

• To order The New Spymasters for £16 (RRP £20), go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min. p&p of £1.99.