IN opposition, Tony Abbott and his Coalition colleagues were great defenders of press freedom, fighting off with ferocity Labor’s attempts to introduce new media laws.

In government, the same Coalition politicians are using the terrorism threat to justify measures that will hamper journalists in their investigative, watchdog role.

New anti-terror laws have aroused concerns that journalists could go to jail for doing their most important job: holding those in authority to account. And on the most vital of issues — national security.

On top of that, plans to increase the range of communications data that can be accessed by authorities, and the time for which it is stored, would add to difficulties already faced by reporters in the digital age.

Journalists need to shield the identity of confidential sources. Otherwise whistleblowers will not come forward. But protecting sources is becoming almost impossible because our contacts and movements can be so closely monitored by our digital trail.

Legislation that passed the Senate on Thursday makes it an offence, with a 10-year jail term, to disclose or publish information on “special intelligence operations”. Declaring a covert operation “special” would give ASIO officers immunity from criminal or civil liability as long as there is no conduct involving death or serious injury, torture, sexual offences or significant damage to property.

Only a narrow range of covert operations would come into that category. They would require authorisation from the Attorney-General, George Brandis. But obviously there is plenty of scope for such power to be abused. Incompetence by security agencies could have enormous consequences where officers have clearance to act outside the law.

Brandis needs to make it clear that a journalist who exposed such abuse or incompetence would not go into the slammer. The Government would like us to think that our security agencies are infallible and beyond reproach, but they have been involved in some celebrated bungles over the years.

One of the most spectacular was the botched Australian Secret Intelligence Service training operation at a Melbourne hotel in 1983. Interestingly, that was classed as a “special operation”. It involved a mock hostage rescue by junior ASIS officers. But they neglected to get permission from, or even inform, the hotel management.

When intruders used a sledgehammer to break down a door on the 10th floor, the hotel manager called police. Masked ASIS officers emerged from a lift and menaced staff with pistols and submachine guns as they dashed through the foyer and kitchen to two waiting getaway cars. The occupants of one car were arrested, but refused to provide any ID.

Spooks, like others with power, need to be held to account if they do the wrong thing. Yet this legislation leaves an impression that could have, in the words of the Australian Lawyers’ Alliance, “not just a chilling effect but a freezing effect” on national security reporting. The proposals to compel telecommunications companies to retain so-called metadata for two years and to include information from online communication sites as well are also being sold as necessary to help the identification and tracking of terrorism suspects.

And they present big challenges for public interest journalism. The ability of authorities to access such information impacts on all investigative reporting in areas unrelated to national security.

The Government says metadata does not reveal the contents of communications, only who we communicate with, when, for how long and the location of caller and recipient. That is not reassuring for journalists or their sources.

In the US, government lawyers have told journalists there is not much need to subpoena reporters and demand they name sources. That’s because information from phone and email metadata, internet activity, credit cards, airline bookings and the like, including location details from mobile phones, make fingering a source so much easier.

There was an outcry in America last year when it was revealed federal investigators engaged in a leak hunt had obtained a subpoena that allowed access to details of thousands of news-gathering calls by more than 100 Associated Press journalists over two months.

In Australia there would be no need for a subpoena. Here enforcement agencies can get metadata without a warrant as long as it is for the purpose of enforcing the criminal law or a law that imposes a pecuniary penalty or is for the protection of the public revenue. And the power is used to hunt journalists’ sources on issues with no national security connection at all.

A few years ago, after I reported on a Cabinet document that embarrassed the government over a bungled petrol price monitoring plan, people I’d spoken to on my mobile got a knock on the door from the wallopers. Fighting terrorism is obviously important. Vitally so. But accountability journalism is important too.

The Government should be pushed to frame anti-terrorism laws in a way that minimises the infringement on press freedom.

LAURIE OAKES IS THE NINE NETWORK’S POLITICAL EDITOR