Ministers have been banned from having sex with staff members after a strident Malcolm Turnbull made changes to the ministerial code of conduct.
The prime minister said Barnaby Joyce's "shocking error of judgment" in having an affair with his former staffer Vikki Campion and ensuing scandal had prompted the move.
"I have today added to the standards the very clear and unequivocal provision that ministers, regardless of whether they are married or single, must not engage in sexual relations with a staff member," Mr Turnbull told reporters in Canberra on Thursday.
"Doing so will constitute a breach of the standards."
Mr Turnbull said while ministers were entitled to personal privacy they also occupied "positions of great responsibility and public trust".
"Ministers should be very conscious that their spouses and children sacrifice a great deal so they can carry on their political career and their families deserve honour and respect," he said.
The prime minister said sexual relationships with staff was "very bad workplace practice".
"You know what attitudes in the corporate world and elsewhere are to this kind of thing. It is about time that this change was made. Probably should have been made a long time ago," he said.
The deputy prime minister is taking leave and Mr Turnbull told Mr Joyce to consider his position after his affair.
"He has set off a world of woe for those women and appalled all of us," Mr Turnbull said.
Earlier this month, the US House of Representatives passed a resolution banning members from sex with their staff.
Independent MP Cathy McGowan suggested last week that Australia follow suit, but Mr Turnbull rejected the idea.
He changed his tune after a painful week for the government as Mr Joyce's conduct came under increased scrutiny.
Shadow attorney-general Mark Dreyfus said Mr Joyce had already breached ministerial standards and should be sacked.
"A deputy prime minister with real judgement would have resigned days ago," he said.
In 2017 the AFL sacked two senior executives who had affairs with subordinates, while companies around the world have dealt with growing numbers of scandals involving powerful men sleeping with staff.
Shine Lawyers employment law expert Will Barsby said the change brought the government into line with most Australian businesses.
"These kinds of bans on relationships or policies on workplace affairs for senior executives is not new for many public and private companies in Australia," he told AAP.