Journalists will be jailed. It might take a year, or two, or even longer. But journalists and whistleblowers will face prison as a result of the first tranche of national security legislation that was passed in the Senate late on Thursday.

And they laughed as they did it. As the Coalition, Labor and the Palmer United party voted in favour of this bill, which dramatically expands the powers of intelligence agencies while creating new offences for disclosing information about the operations they will undertake with these new powers, there was a jovial air in the chamber.

It’s a bill that makes many broad changes to our intelligence gathering apparatus. It introduces a class of “special intelligence operation” for Australian Security Intelligence Organisation (Asio) missions where intelligence officers can gain immunity from using force or committing other offences.

Reporting of these operations, which could foreseeably lead to situations where a public disclosure would be in the public interest, could land journalists and whistleblowers in jail. And not just journalists, but any person who shares or republishes this material. In addition, harsher penalties are put in place for intelligence whistleblowers who take documents or records and disclose them, partly as a response to the disclosures made by NSA whistleblower Edward Snowden.

So how would these laws work? We have many examples of intelligence reporting that could be caught within the scope of such an offence. Say, for instance, the bugging of East Timorese leaders during their negotiations with Australians were to happen today. If it were declared a ‘special intelligence operation’ – a process which only involves approval from the attorney general – reporting of the fact this bugging occurred, the details around it, the nature of the surveillance, could be caught within the scope of this offence. The same could equally apply for reporting the Indonesian president’s phone was targeted by Australian intelligence agencies, if it were declared a special operation.

Among Asio’s other new powers is the ability to obtain massive warrants for effectively the whole of the internet. They also create new powers for Asio to conduct “optical surveillance” without a warrant. There are many other small expansions that lead to a general widening of the powers of our intelligence agencies.

These are serious changes and they warrant serious scrutiny. But the passage of the bill has been all too easy. After it was initially introduced into the Senate it was quickly referred to the parliamentary joint committee on intelligence and security. This committee is dominated by Coalition and Labor senators – the Greens senator Scott Ludlam and independent MP Andrew Wilkie lost their places after the last election.

As a result of this, the committee’s recommendations were weak. It made just 17 recommendations – remarkably, only seven of these actually suggest changes to the bill itself. Four were changes to the explanatory memorandum, while the remainder were suggestions surrounding oversight by the inspector general of intelligence and security – oh, and one was a helpful reminder that the government should re-appoint an independent national security legislation monitor, an office they initially planned to scrap.

The catch-all disclosure offence for special intelligence operations remained, with some minor suggestions for change. There was a recommendation to clarify that “recklessness” is the mental element required to commit the offence. A note was also suggested in the explanatory memorandum that the public prosecutor needed to consider the public interest before commencing a prosecution. This should be little comfort to any of us, when the options existed to have a real public interest defence, or simply not have the offence at all.

Earlier this week the Senate began debating the bill. The government’s amendments sailed through. Labor capitulated almost entirely on these enhanced powers – and, disappointingly, on the disclosure offence as well. Despite the shadow attorney general, Mark Dreyfus, initially saying the government would “need to make changes to remove that consequence” if journalists could face prosecution, the fact is the consequence still potentially exists.

Scott Ludlam fought hard to keep the debate going, and moved a series of amendments that would have protected journalists and whistleblowers, wind back some of the broad new computer warrant powers and increase oversight of Asio.

“I simply do not believe and cannot in good conscience vote, particularly in the climate that we’re in, for continued and relentless expansion of powers for these agencies at a time when the only person who the Australian government had established … to investigate whether the laws that we already have are necessary and proportionate has said in many cases they are not,” he said.

Ludlam spent considerable time questioning how the laws would work and whether they were appropriately crafted – what the limits of the computer warrant powers were, how the disclosure offences would apply – and he was accused of filibustering by the attorney general. Independent senator Nick Xenophon and Liberal Democratic senator David Leyonhjelm also raised many serious questions about the scope of the powers being granted.

But in the end the bill passed. Only the Greens, Leyonhjelm, John Madigan and Xenophon refused to support the amended laws.

Brandis, in a late night third-reading speech, said: “What we have achieved tonight is to ensure that those who protect us, particularly in a newly danger age, have the strong powers and capabilities that they need.”

Really, we can only blame ourselves. Could all journalists, collectively, have done more than throw together a handful of submissions? Most major news organisations in Australia raised concerns about the bill and the new offences. But there was no concerted campaign, no unified push to stop these disclosure offences succeeding. We’re now stuck with these laws, probably until someone is made an example of to spur journalists into action.

There is a small comfort in all of this and that is that the laws simply won’t work as a deterrent. They won’t discourage whistleblowers. And they won’t discourage fearless journalists from reporting on our intelligence agencies when it is in the public interest to do so. The disclosures by whistleblowers like Edward Snowden and Chelsea Manning – and the reporters who told these stories – have shown us that people are willing to take extraordinary actions, at great personal risk, when they believe it is necessary to do so.

It will just mean that some of them will go to jail.