In a perfect world, Australia would introduce constitutional protections for freedom of the press. But since the chances of that are next to zero, it might be more productive to look instead at what might be done to make the existing web of secrecy laws less repressive.

As a starting point, four laws in particular need reforming.

The secrecy of information law

Part 5.6 of the Criminal Code Act 1995 is headed “Secrecy of Information”. It defines two general categories of information that are to be regarded as secret:

inherently harmful information

information likely to harm Australia’s interests.

Inherently harmful information means any information that has a security classification attached to it, or belongs to one of the intelligence services, or relates to the operations of an intelligence service or a law-enforcement agency.

Information “likely to harm Australia’s interests” is not defined. It is an open-ended catch-all that is used to go after public servants who leak and the journalists who publish those leaks.

Read more: Media raids raise questions about AFP's power and weak protection for journalists and whistleblowers

The effect is to leave it open for the government to decide what information can be used to form the basis of prosecutions. This means the law is vulnerable to abuse through arbitrary enforcement of the kind that the Australian Federal Police has come to specialise in.

Journalists’ liability is set out in the same part of the Criminal Code as public servants’ liability.

It states that anyone who receives, deals with or publishes the classes of information described in the law are also liable to be prosecuted, along with the leaker.

That is a clear attack on the freedom of the press.

There is a defence of public interest, but how it works is very uncertain.

The law says it is a defence if:

the defendant was acting in the capacity of a journalist reporting news, presenting current affairs or expressing editorial or other content in news media, and reasonably believed that receiving and publishing the information was in the public interest.

This looks all right on the surface, but there are several pitfalls in it.

First, who is a journalist? Everyone engaged in doing news journalism, including bloggers and citizen journalists? Or only those employed by big media organisations?

Second, what is in the public interest?

Third, what constitutes a “reasonable belief”?

Finally, the onus is on the journalist to prove his or her innocence beyond reasonable doubt. That is the reverse of the usual practice in criminal law where the onus is on the prosecution to prove guilt.

The entire Part 5.6 of the Criminal Code Act needs to be rewritten, narrowing its scope to information that, if leaked, would present a clear, present and serious danger to the public good.

The public interest needs to be defined; the act needs to make it clear that anyone doing journalism is presumed to be entitled to the public-interest defence. “Reasonable belief” needs to be dropped, and the onus of proof should be laid on the prosecution.

National security laws

There is not space here even to scratch the surface of the repressions built into the 75 or so national security laws that Australia has enacted, the overwhelming bulk of them since the terrorist attacks of September 11 2001.

However, they need to be comprehensively reviewed against a set of principles concerning freedom of the press.

These principles should include, as a minimum:

that the press is entitled to a public-interest defence in every case

that the laws should be enforceable only in cases of clear, present and serious danger to national security

that the term national security refers to the sovereignty and safety of the nation and – for the purposes of press freedom – not more than that

that the performance of the security services should be just as much an object of public scrutiny as that of any other part of government.

that judicial supervision of any warrant system used for pursuing journalists or their sources should be in the hands of a judge of a superior court and no one else

that intention to harm national security should be the fault standard for any prosecution of the press, not mere accident or inadvertence

that the onus of proof rests with the prosecution.

Metadata laws

These are a subset of the national security laws and are contained in the notorious Telecommunications (Interception and Access) Amendment (Data Retention) Act, which caused such a public outcry when it was enacted in May 2015.

The act requires internet service providers to retain everyone’s metadata for two years, plus information about their telecommunications accounts and services.

Metadata tells anyone who looks at it who called whom, when, where, for how long and on what device.

Read more: Infographic: Metadata and data retention explained

The implications for journalists dealing with confidential sources are obvious.

Recognising this, parliament included in Division 4C of the act some window-dressing to give the impression there is some protection for journalists and their sources.

The protection applies to “a person working in a professional capacity as a journalist” or to an employer of such a person and their sources. Again, it is unclear if this includes bloggers and citizen journalists, and their sources.

The process for issuing a “journalist information warrant” is byzantine in its complexity.

In some circumstances, the director-general of security gets one through the minister in charge of the security services. If that minister cannot be reached, the director-general can try the prime minister, the foreign minister or the defence minister.

In an emergency, the director-general can issue a warrant to him- or herself.

In other circumstances, a law-enforcement agency can apply to a judge, magistrate, member of the Administrative Appeals Tribunal or a lawyer with five years’ experience.

The warrant can remain in force for six months. That is a long time in journalism.

These arrangements make a mockery of the concept of press freedom and show up the protective mechanism for the sham it is.

Clearly, the warrant system has to be placed in the hands of a superior court judge if it is to have any meaningful judicial supervision.

The scope of the law also needs to be limited to national security, narrowly defined.

Whistleblower laws

The Public Interest Disclosure Act of 2013 is meant to provide protection for Commonwealth public servants who disclose wrongdoing by government agencies.

Professor A.J. Brown, a distinguished legal and public policy academic who had a hand in drafting it, is reported to have called it “a dog”.

That is true, but the original version of the bill that he and the then Labor attorney-general, Mark Dreyfus, worked up into the present law was a genuine mongrel. It contained no fewer than nine hurdles a public servant had to jump if disclosure to the public was to be protected.

There is no specific provision in the present law to protect a whistleblower who goes to the media, even after they have tried and failed to get the wrongdoing fixed by reporting it internally.

Read more: Why the raids on Australian media present a clear threat to democracy

The consequences are being seen now in the prosecution of the Tax Office whistleblower, Richard Boyle, in Adelaide. He faces 66 charges and a possible 161 years in prison for revealing cruel and aggressive debt-collecting practices by the Tax Office.

And David McBride, a former Defence Department lawyer, is being prosecuted for revealing that some Australian troops in Afghanistan were alleged to have committed a war crime.

Justice John Griffiths of the Federal Court has reportedly described the law as “technical, obtuse and intractable”.

No one pretends that whistleblowing laws cannot be abused by people with personal agendas or vendettas to pursue. But the law as it stands makes the whistleblower the victim of vendetta.

It is a question of prioritising the public interest over the private interests of the bureaucracy in protecting itself from scrutiny, and from the risk that occasionally a rogue whistleblower will cause trouble.

This involves amending the laws to give explicit protection to whistleblowers who go to the media after having tried in vain to have the wrongdoing fixed internally, as both Boyle and McBride tried to do.

Australia has been sleepwalking into its present position, lulled by the largely bipartisan approach of the Coalition and Labor, the latter not wishing to seem soft on national security despite harbouring manifold reservations about some of these laws.

To make matters worse, among the “Five Eyes” intelligence-sharing countries – the US, UK, Canada, Australia and New Zealand – Australia alone has no constitutional or equivalent protection for the freedom of the press.