A version of this article appeared originally in Strategies & Tactics.

Within days of the riot at the U.S. Capitol on January 6, 2021, reports began surfacing on social media of protesters who were spotted at the Capitol being fired by their employers.

Some of the dismissed workers appeared in TV news footage carrying nooses and Confederate flags or wearing clothing emblazoned with anti-Semitic messages as they breached police lines. Others came to their employers’ attention after posting incriminating “selfies” and boasting of their exploits on social media. In their telling, they were merely exercising their constitutionally protected free-speech rights, and their firings amounted to illegal retaliation by their employers.

Their employers saw something else—workers whose actions and hateful rhetoric were incompatible with corporate values and put their reputations and relationships with customers and other stakeholders at risk.

Whether companies were within their rights to terminate employees for activities outside the workplace depends on multiple factors, including the speech and conduct involved, the circumstances in which it took place, and state and federal law. A few years ago, such questions would have fallen squarely on a company’s HR department and lawyers to answer. No more. With workers becoming increasingly vocal and joining forces in growing numbers to drive social and political change online and offline, any misstep in dealing with activist employees is as much a reputational threat as a legal one, if not more so.

Despite this, companies are strikingly unprepared for the risks. Just 29% of communications professionals surveyed last year by the USC Annenberg Center for Public Relations said their companies had policies governing employee activism, and more than half admitted they didn’t know if their organizations supported employee involvement in activist groups.

How can an organization be sure to strike the right balance between treating workers lawfully, respecting diversity of thought, avoiding legal claims and protecting themselves from public cancellation?

Here are five things to think about:

Understand the Law

Despite what many believe, the First Amendment right to free speech only applies to restriction of speech by the government, not to actions by private employers. Generally speaking, private employers have wide latitude to discipline or dismiss employees for speech or conduct, whether on the job or off-duty, that is racist, sexist or otherwise discriminatory, is counter to the company’s values, business interests or policies, or is unlawful.

That’s not to say private employers have carte blanche to restrict all employee speech. Under federal law, private-sector employees have a protected right to discuss work-related issues such as wages, working conditions and safety concerns. Workers also can’t be fired for complaining about harassment, discrimination or other illegal conduct in the workplace. Laws in some states may also offer additional protections for lawful off-duty conduct and political expression.

Have a Plan

If current crisis plans don’t address risks related to employee activism and social and political issues, make it a top priority. Bringing the company’s HR, legal and reputation experts together before there’s a crisis will help ensure that they understand each other’s priorities and that the law and reputation both receive due consideration when issues do arise. Tabletop crisis “games” are a good opportunity to explore a company’s options for responding to such emerging threats and pinpoint areas where it is especially vulnerable so steps can be taken to prepare and proactively mitigate the dangers.

Create Policies and Guidelines

Employees need to fully understand their responsibilities and what is expected of them when it comes to political discourse at work. Policies should make clear that while consensual conversations about political issues are permitted, participants must be mindful of where they are taking place and any unintended audiences they might have. Policies should also provide guidance on topics like listening to politically charged content or posting political images in common areas and individual workspaces, using company email and messaging systems for political messages and similar activities that co-workers may find unwelcome or that potentially violate their rights.

Keep social media policies up-to-date to reflect the latest social platforms and how employees are using them. Be mindful of how social media policies and employee rights intersect, and have a lawyer review policies to be sure they don’t inadvertently “chill” employee speech that falls under the protection of federal or state laws.

Listen to Employees

Numerous companies that rushed to put out statements in response to the killing of George Floyd last May later found themselves being called out by employees for having done so not out of solidarity with the Black Lives Matter movement, but for fear of being “cancelled” if they remained silent. As organizations struggled and second-guessed themselves to the brink of paralysis over what to say publicly, many neglected to communicate with the very stakeholders who could best guide them—their employees.

Leaving workers to wonder where their employer stands on issues such as racial injustice, economic inequality and immigration is unlikely to end well. Instead, show that the company welcomes and values open dialogue on issues that affect employees, their families and the communities where they live and work. Seek out employees at every level to lead these discussions, and give them the time, space, resources and management support they need to do so. Then, get out of their way and listen. Employees will appreciate having a safe forum in which to express themselves, while the company will come away with a deeper understanding of the issues and how best to engage and be less likely to be blindsided by future crises.

Be Consistent

Policies should be applied equally, without regard for employees’ political leanings, personal characteristics or the causes they support.

Making a dress code exception to allow workers to wear Black Lives Matter masks while continuing to prohibit Blue Lives Matter gear exposes a company to a potential discrimination claim. The same holds for allowing some workers time off to attend rallies for some political candidates or issues but not others, or giving workers who support the CEO’s pet cause a “pass” for violating company policies while holding others strictly accountable.

With employees of all levels and backgrounds becoming increasingly vocal and visible in their pursuit of change, being ready for the risks, setting forth well-thought-out policies, and being consistent and using sound legal and reputation judgment to enforce them is the best way to keep companies out of the public spotlight and out of court at the same time.