It is easy to assume Australia has a free press. Our squawky newspapers are filled with stories about the failings of government, acid-tongued columnists routinely lash our politicians, and until May last year the police hardly ever raided newsrooms or journalists.

On Wednesday, the High Court appeared to uphold the principle of press freedom when it ruled that the warrant the Australian Federal Police used to search News Corp journalist Annika Smethurst’s home in 2019 was invalid.

You might recall that the police raided her home (and searched through her underwear drawer) looking for the source of a story Smethurst had published in The Daily Telegraph more than a year earlier. Her story revealed the government was considering expanding the powers of our international electronic eavesdropping agency, the Australian Signals Directorate, so it could turn its sophisticated bugs on Australian citizens.

(The very next day, the AFP searched the ABC’s Sydney headquarters looking for the sources of another story – the Afghan Files – about Australian Special Forces in Afghanistan.)

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

Smethurst’s story was important because it revealed details of a shift in policy that affected all Australians. Regardless of what you think about the rights or wrongs of such a change, it is hard to argue it shouldn’t have been part of an open public debate.

At the same time, nobody has ever suggested national security suffered as a result of the story. It was a fine example of a free press doing its job by uncovering government actions that we all ought to know about.

News Corp went to the High Court to argue that the police had written the warrant so badly that it failed to explain why they were conducting the search and what they were looking for. In a unanimous slap-down for the police, all seven judges on the bench agreed the warrant “lacked clarity” and ruled it invalid.

A victory for journalism? Not quite.

News Corp also asked the court to order the police to either return or destroy any evidence collected during the raid. In a decision split 4:3, the judges rejected the request. This effectively allowed the police to still use the evidence for any investigation and prosecution.

The reasoning is complex and highly technical, but its overall effect is to undermine the already paper-thin protections for press freedom in Australia.

This is not the fault of the court. It was doing its job adjudicating on narrow points of law and police procedure, but it does underscore the urgent need for robust reform of our legal code.

Read more: To protect press freedom, we need more public outrage – and an overhaul of our laws

Australian journalists operate freely in spite of the law, rather than because of it. While the United States Constitution has its First Amendment and the UK has Article 10 of its Human Rights Act (to name just a few), the most we have is a hopelessly weak “implied freedom of political communication” that’s merely inferred in our constitution.

Without more explicit protections, we have seen a slew of national security laws undermining the ability of journalists to investigate government and keep their sources safe.

This matters because the ability of the press to act as a noisy (and nosy) watchdog is vital to the way our democracy works. Nobody is arguing for complete and unfettered protection for journalists. Much of the work of our security agencies, individuals’ private details and commercially sensitive information must be off-limits, but there are ways of striking a balance between those imperatives.

A host of organisations have already proposed a set of reforms. The Alliance for Journalists’ Freedom (which I represent) published a White Paper on Press Freedom in Australia three weeks before the raids. The AJF proposes:

protections for journalists’ sources

the chance for news organisations to contest warrants even before the police carry out their searches

an “exemption from prosecution”, so that when journalists are engaged in legitimate work, press freedom is assumed.

It would then be up to the police to show a judge why there is enough of a risk to national security to justify setting aside that principle and issuing a warrant.

It is impossible to reform every corner of our statute books, though, so we also need a Media Freedom Act that enshrines the principle of press freedom in our legal code. That way, every court up to and including the High Court has to take it into account in every case that threatens to undermine media freedom.

Together, those kinds of protections would give comfort to journalists and their sources: as long as they are not violating clear and strictly set-out rules on national security and privacy, and are otherwise acting in accordance with the law, they should not be subject to prosecution. It would also help the police avoid being accused of launching politically motivated inquiries.

Our press might look free and fearless, but without significant reforms that remains a dangerously fragile illusion.