A Department of Immigration and Border Protection employee resigned last year after he waved a knife with an eight centimetre blade at a workmate.
The "unprovoked" incident is outlined in a document released by Immigration in response to a freedom of information request.
The incident happened on an Australian Customs and Border Protection vessel in 2014 when the employee pointed the work-issued knife in a joking manner.
The man resigned after a code of conduct investigation but before a specific sanction against him had been decided.
Immigration's assistant secretary of integrity and professional standards, Kaylene Zakharoff, described the man's actions as a "silly thing to do" and said the officer acknowledged it was inappropriate and understood why someone would take exception.
She said the fact it was a joke was irrelevant.
"The community expects standards of us," Ms Zakharoff said.
The case was one of four finalised in the year to October 2015 in which code of conduct breaches had been confirmed and the person was sacked or had resigned before a sanction could be applied.
One was sacked after inappropriately accessing the visa processing system while another was fired for submitting fraudulent medical certificates to claim sick leave.
The fourth employee was sacked for viewing inappropriate material on a work computer.
The Australian Public Service Commission last week published a guide to remind the federal bureaucracy's workforce of the need to uphold APS values, principles and code of conduct.
The commission reminded public servants of the Fair Work Commission's stance that the community expects a standard of behaviour that allows employees to go to work each day and do their jobs without having their personal dignity diminished.