Punishments for foreign interference crimes range from 10 to 20 years in prison.

Some security experts argue the laws are overdue, and necessary for an age when Russian hackers can undermine American democracy without going near a voting booth, and when China’s mingling of economic and political interests is redefining geopolitics.

“It’s a big deal,” said Peter Jennings, executive director of the Australian Strategic Policy Institute. “It modernizes our intelligence laws at a time when the government’s saying that the spying threat is extremely high.”

But the laws have met with opposition since they were proposed six months ago.

The Chinese government has responded coolly, canceling visas for Australian business leaders and suggesting that the country’s politicians are motivated by xenophobia and racism.

Lu Kang, spokesman for the Chinese Foreign Ministry, said in response to a question this week about the new Australian laws that China does not interfere in other countries’ affairs.

“We hope that all countries could cast off Cold War mind-set and strengthen exchanges and cooperation on the basis of mutual respect and equal treatment,” he said.

Some experts worry that Australia is neglecting or even undermining traditional diplomacy by focusing on covert activity that security officials tend to hint at but do not fully explain.

“No compelling evidence has been offered to show why these laws are really needed,” said Hugh White, a prominent defense strategist. “We have been asked to take that on trust, but there is a risk that we are jumping at shadows.”