In the last few days, two national newspapers – the Times and the Mail – have suggested that the Guardian has been wrong to publish material leaked by Edward Snowden on the specific grounds that journalists cannot be trusted to judge what may damage national security.

Ignore for a moment the vexing sight of journalists denouncing their own worth. Set aside too the question of why rival newspapers might want to attack the Guardian's exclusives. Follow the argument. Who should make the judgment?

The official answer is that we should trust the security agencies themselves. Over the past 35 years, I've worked with a clutch of whistleblowers from those agencies, and they've all shared one underlying theme – that behind the screen of official secrecy, they had seen rules being bent and/or broken in a way which precisely suggested that the agencies should not be trusted. Cathy Massiter and Robin Robison, for example, described respectively MI5 and GCHQ pursuing politically motivated projects to spy on peace activists and trade unionists. Peter Wright told of MI5 illegally burgling its way across London "while pompous bowler-hatted civil servants in Whitehall pretended to look the other way". David Shayler exposed a plot both lawless and reckless by MI5 and MI6 to recruit al-Qaida supporters to assassinate Colonel Gaddafi.

All of this was known to their bosses. None of it should have been happening. But the agencies in whom we are invited to place our trust not only concealed it but without exception then attacked the whistleblowers who revealed it.

Would we do better to trust the politicians who have oversight of the agencies? It's instructive to look back from our vantage point, post-Snowden, to consider what was happening only two years ago when the government attempted to introduce new legislation which came to be known as the snooper's charter. If the oversight politicians are as well-informed as they claim, they must have known that this was in part a cynical attempt to create retrospective legal cover for surveillance tools that were already secretly being used, but they said nothing. And when parliament refused to pass that law, clearly indicating that there was no democratic mandate for those tools, they still stayed silent.

Politicians fall easy victim to a political Stockholm syndrome which sees them abandon their role as representatives of the people in favour of becoming spokesmen for the spooks. It was there in the 1970s when the New Statesman bravely exposed security lapses and financial corruption in GCHQ, only to face a prosecution orchestrated by a Labour attorney general; there again with Jack Straw describing in his autobiography how MI5 had spied on him and his family since he was 15 but declaring that he was "neither surprised nor shocked – this was the world we lived in"; and there again, of course, in the foreign secretary William Hague's bland presumption that "if you have nothing to hide, you have nothing to fear" from the systems of mass surveillance exposed by Snowden.

So what about journalists? I suggest our track record is better. In a film muddied by fictional detail, the new Spielberg production Fifth Estate's portrayal of the Guardian's work with Wikileaks is accurate in describing the running dispute between journalists who wanted to redact documents to make them safe and Julian Assange who wanted no such restraint. We ran dozens of stories, based on the biggest ever leak of military and intelligence material. We caused plenty of political embarrassment but we did so without jeopardising anybody's safety or damaging any nation's security.

I spent most of June with a handful of colleagues in a secure and airless room in the Guardian combing through GCHQ documents provided by Snowden. We did so knowing that the pressure to avoid damaging national security was not only moral but political, that the security agencies and their political friends were poised to attack our work with their standard smear – that we were aiding the enemy. So we were careful. Repeatedly, we disclosed the outline but held back the detail. We had specialist reporters to advise us, and they in turn took advice from specialist outsiders. We talked to the government and invited it to show us if we were in danger of causing harm: it puffed and protested but failed (as they continue to fail) to come up with a single example of our making a dangerous disclosure. Its greatest angst was reserved for the possibility that we might name the phone companies that have allowed GCHQ to tap into the transatlantic telecoms cables – nothing to do with damaging national security, everything to do with protecting the companies from accountability to their customers.

And reading those documents, I was struck by two things. First, that GCHQ is much cleaner than it used to be, that it has now adopted internal procedures which are designed to ensure it complies with the law – and that surely can be seen, at least in part, as the achievement of those earlier whistleblowers. Second, that there is still ample reason to worry. Critics of the Guardian's Snowden stories insist that the power of GCHQ is used only to deal with terrorism and serious crime, but the signs of mission creep are there. As a single example: is migration from sub-Saharan Africa a serious crime? The Snowden material shows it has been targeted by GCHQ. Perhaps that is to be defended as essential for the UK's economy. Perhaps it is another example of a politically motivated project.

Which brings me back to the Daily Mail and a cautionary tale from the experience of the former MI5 officer Massiter. When first she tried to sound the alarm internally about the service's targeting, for example, of the Campaign for Nuclear Disarmament, her bosses told her (with a gentle combination of sexism and Stalinism) that she was just being emotional and needed to see MI5's approved psychiatrist, which she did. When later she blew the whistle, MI5 used a compliant Tory MP as messenger to carry the wretched smear that she'd been treated for mental illness. You'll guess which newspaper put that on its front page.