Last week, ABC News reported that ASIO officers had retrieved a huge cache of confidential documents from ABC offices — the so-called Cabinet Files. Those documents were used to report stories that in our view, were unequivocally in the public interest and did not threaten national security. Under current law, no matter how upset the government may be, the journalists did not risk jail for doing their job.

Also in the news last week: two Reuters journalists continue to languish in a Myanmar jail for receiving classified documents from police. They could face up to 14 years in jail — though they didn't even get to write a story. Supporters of democracy and human rights around the world are rightly outraged at this blatant attack on the media attempting to research terrible atrocities by the Myanmar government.

We comfort ourselves with the thought that it would never happen in Australia. But if proposed changes to national security legislation are passed, it could happen in Australia. What's more, journalists could be jailed for researching or reporting stories that have nothing to do with national security.

Restrictions on reporting and research

In December the Prime Minister announced three new bills he said are intended "to counter the threat of foreign states exerting improper influence over our system of government and our political landscape". They're intended to stop the leaking of sensitive government information, ensure better disclosure of foreign lobbyists and stop foreign donations to Australian political parties. Few Australians would quibble with that.

But the changes are wide-ranging and complex and were drafted without any consultation with key affected institutions in the law, universities and the media.

Submissions and evidence to the parliamentary committee reviewing the legislation claim it is so broadly worded and all-encompassing that the effect would be to stifle academic and media freedom.

The Electoral Funding and Disclosure bill, for instance, is intended to prevent foreign influence on political debate. Universities claim that in an era when research is increasingly international in operation, funding and personnel, normal academic research and advocacy will be deemed "political activity" and will be subject to onerous restrictions.

For the media, the potential impact of the espionage bill is on another level. If a Commonwealth worker or contractor reveals or even discusses information that is either security classified or deemed by the Government to be otherwise harmful to Australia's interests, the journalist as well as whistleblower could be subject to up to 20 years in jail.

For the first time the whole reporting process and everybody involved in it, from research to publication, is potentially criminalised.

The intent seems to be: If we can't stop the whistleblower, we'll stop the reporter.

The stories that could be illegal

The range of information captured is unprecedented. It goes well beyond intelligence and national security operations, which the Government cites as "inherently harmful", to canvass any conduct the Government believes could "cause harm to Australia's interests". Among a list laid out by the bill, that conduct includes anything seen as harming or prejudicing relations between the Commonwealth and a state or territory government.

Examples in recent years of stories that could have attracted criminal sanctions include the conduct of operations by the Navy or Border Force interdicting asylum seekers; unlawful killings by Australian soldiers in Afghanistan; and the bugging of East Timorese negotiators during the Timor Gap negotiations.

But the wide scope of the legislation means that reporting an almost limitless range of stories on trade, diplomacy, or even Commonwealth/state relations could be criminalised if the recipient simply receives or deals in any other way with confidential Commonwealth information. And that includes simply having a conversation without any document on hand.

The government denies that the intent of the various bills is to limit academic freedom or a free media.

It points to academic exemptions and a public interest defence in relation to reporting that is "fair and accurate".

But that defence is highly subjective and still allows for the possibility of malicious prosecutions and intimidation.

Courts now take public interest into account in civil actions against the media, but having to prove public interest in a criminal action prior to publication has never occurred before.

Public interest is a key concern

The right to independently make judgements of public interest is absolutely fundamental to freedom of the press. This legislation takes away this fundamental freedom and transfers it to the government and the courts, with the onus of proof on the media.

This is a genuinely new development and will have a chilling effect on public interest reporting.

We have already had a taste of what will happen. In 2014 the government made reporting of ASIO and other intelligence operations a criminal offence. In subsequent years journalists have been tipped off about operations gone wrong, misbehaviour, and other potential stories of genuine public interest. Many haven't been pursued.

Responsible media organisations such as the ABC will not sanction its reporters committing criminal offences, and most journalists don't want to go to jail for doing their job. Many stories that would easily pass a reasonable test of public interest will never see the light of day.

Stifling dissent through censorship

There is a sorry history in Western democracies of using national security to restrict the media and stifle dissent. Even in the US, the First Amendment offered little protection from waves of political censorship that began during the civil war and reached their peak during World War I.

It was only the excesses of censorship by the Wilson administration, and a concerted campaign by lawyers, activists and media proprietors, that finally led the US Supreme Court in the '20s and '30s to interpret the First Amendment to give the press genuine protection.

As the ABC's coverage of The Cabinet Files demonstrates, the Australian media, both public and commercial, has a good record of reporting national security issues responsibly.

This legislation is trying fix a problem that doesn't exist.

In the process it risks weakening the democracy it's trying to protect.

As those reporters in Myanmar can attest, there is great danger in turning embarrassing stories into criminal offences.

Mark Maley is manager of editorial policies for ABC News.