For federal public servants, sitting on your couch at night scrolling through Facebook or Twitter on your phone, “liking” posts critical of Malcolm Turnbull could spell trouble for you at work. Ditto if you send a private email criticising the government to a friend from your home computer.

But if you want to cheer on Turnbull on social media, no worries, that’s acceptable to the government — unless your Facebook friends and Twitter followers then vent their disagreement.

Under “new guidance” issued by the Australian Public Service Commission this week, federal government employees could be in breach of the public service code of conduct if they do not remove “nasty comments” about the Coalition posted by others on the employee’s Facebook page.

In short, it is not enough for public servants to self-censor; they need to censor the views of others, even after hours.

“The latest guidance continues a worrying trend of restricting the free speech of public servants,” says John Wilson, managing legal director of Canberra law firm, Bradley Allen Love Lawyers.

“This issue pits two competing and compelling considerations. On one hand, the government has a very legitimate interest in maintaining an impartial and effective public service, while on the other public servants are entitled to a private life like anyone else. This latest guidance, though, overreaches to such an extent that it is of questionable constitutionality.”

According to the commission, liking or sharing anti-government material on social media will generally be taken as an endorsement and in the same light as if the public servant created the material.

Stating the code operates “in effect” to limit an individual’s right to freedom of expression, the guidance warns public servants against posting criticism anonymously or criticising government policy in an email to a friend.

“There’s nothing to stop your friend taking a screenshot of that email, including your personal details, and sending it to other people or posting it all over the internet, Again, the breach of the code is not in their subsequent publication of your material but in your emailing that material in the first place.”

As for “nasty comments” made by others, it says: “Doing nothing about objectionable material that someone else has posted on your page can reasonably be seen in some circumstances as your endorsement of that material. If someone does post material of this kind, it may be sensible to delete it or make it plain that you don’t agree with it or support it. Any breach of the code would not come from the person making the post. It would come from how you reacted to it.”

Even if a social media account is limited to family and friends, the employee will be in breach of the code if an anti-government post was shared by a friend. “The breach of the code occurs at the time you made your post,’’ it says.

Public comment is defined as “anything that you say in public or which ends up in public”. “This can include something you’ve said or written to one person. If your comment has an audience, or a recipient, it’s a public comment.”

The government says a public servant’s capacity to affect the reputation of their agency and the public service “does not stop when you leave the office”. “The comments you make after hours can make people question your ability to be impartial, respectful and professional … at work. APS employees are required by law to uphold the APS values at all times.”

University of Adelaide law professor Andrew Stewart says the warning about private emails is “legally questionable”. He is also critical of the apparent lack of “even-handedness” in the government’s approach.

According to the guidance, criticising your employer is “almost always going to be seen as a breach of the code” but “this doesn’t stop you making a positive comment on social media about your agency, or using social media to explain the policy and services that it delivers”.

“That’s beginning to look like you are supposed to be above politics unless you are praising us,’’ Stewart says.

“The idea that you can’t intervene in political matters unless you are praising the government of the day seems to me to be highly questionable.’’

He says he believes it is also an “overreach” legally for the government to warn employees to remove negative comments made by others. “The idea you are now starting to have to take proactive steps to censor other people’s views when there is nothing to suggest you have personally endorsed those views seems to me legally to be getting into questionable territory,’’ he says.

“And, politically, it’s a terrible look.”

Community and Public Sector Union national secretary Nadine Flood says it is “completely unreasonable” for a worker to face disciplinary action over a private email or an act as benign as liking a social media post.

“Of course, there needs to be limits, but this policy goes too far,’’ she says. “The notion that the mum of a gay son who happens to work in Centrelink can’t like a Facebook post on marriage equality without endangering her job is patently absurd.” But while critical of the government’s “ham-fisted” approach, Stewart says he does not see a legal problem with public servants being warned about liking anti-Coalition posts.

“It seems to me that if you are going to have rules that say public servants are not supposed to get involved in political matters, liking a post surely means you are endorsing what is said in that post,’’ he says. “It’s reasonable to say there’s no difference between making a statement which you are not allowed to make under the code, and you publicly endorsing someone else making a statement you are not allowed to make under the code.”

Australian Public Service Commissioner John Lloyd says the guidance “sets out the risks public servants need to take into account when they consider what they say and how they say it’’.

He says public servants using privacy settings on social media is an “unreliable protection”, while posting anonymously does not miraculously sanitise “objectionable material”. “That argument is similar to a burglar arguing that charges should be dismissed because he wore a balaclava,’’ he says.

Stewart says a public servant dismissed for breaching the code of conduct can challenge the fairness of their dismissal in the Fair Work Commission.

In March last year, a Centrelink officer who called clients “spastics” and “whingeing junkies” on social media and said he was embarrassed to work for the Department of Human Services given its “disgraceful” processing times won his job back after making an unfair dismissal claim.

The public servant, using a username, “mmmdl”, contradicted the department’s social media unit over the time taken for processing youth allowance claims. The investigators appear to have trawled through thousands of posts through several years to identify the officer.

But while commission vice-president Adam Hatcher found the public servant’s “seriously inappropriate” conduct was a valid reason for his sacking, he found the dismissal harsh.

He said the penalty of dismissal was disproportionate to the gravity of the misconduct, given it bore no relationship to his actual work performance, caused no detriment to the department, was engaged in impulsively rather than deliberately, and consisted of a small number of widely interspersed comments across a period of years.

“It may be accepted that, in some cases, the public expression of political views by public servants in their private time might compromise their capacity to carry out their work functions impartially and this might, consequently, contravene (the code of conduct),’’ Hatcher wrote.

“This might happen if, for example, a departmental secretary, a policy adviser, a ministerial staff member or a senior diplomat publicly and emphatically criticised the government of the day. However, in the case of the vast majority of public servants who perform routine administrative tasks, it is difficult to envisage any circumstance in which the robust expression of political views and criticism of the government outside of work could have an impact on the performance of their duties.’’

Wilson says the law in this area is unsettled. “In 2003, the Federal Court found an official secrecy regulation unconstitutional for infringing the implied freedom of political communication when it was used to gag a union representative within Customs,’’ he says.

“On the other hand, in 2013, the Federal Circuit Court rejected the case of an immigration officer who was disciplined and lost her job for tweeting criticisms of the government’s border policy.

“We are still awaiting a definitive judgment from the High Court on the extent to which the government can intrude into the private lives of public servants and limit their free speech.”

Lloyd says termination of a public servant for misuse of social media would be rare.

Asked whether the guidance would require public servants to not like social media posts opposing the government’s same-sex marriage postal vote process, or whether employees should remove “nasty comments” about it from their social media platforms, Lloyd says: “Public servants should apply the principles of the social media guidance to this issue. All public servants should exercise judgment and discretion when commenting publicly on same-sex marriage. Like all Australians, public servants should engage with this issue respectfully and with courtesy. The appropriateness of specific social media activities will depend on the context in which they occur.”

Flood says his response is a “non-answer”, saying Lloyd is seeking to use the guidance to “scare people into not exercising the right they have to engage on social media and in public debate’’.

“You don’t have to actually act to enforce the guidance to have that chilling effect,’’ she says.