Every political generation must learn how to use the media of its moment. Those who learn fastest generally finish first. Benjamin Franklin — who once asked that his gravestone read “printer” — mastered political pamphleteering, Franklin Delano Roosevelt pioneered radio, John F. Kennedy beat Richard Nixon thanks to a televised debate, and Ronald Reagan rode the 24-hour news cycle. In our era of social media, the race is on to see who can most skillfully exploit this medium’s potential.

Social media is different from traditional media in crucial ways. Twitter and Facebook don’t just broadcast messages from public officials; they also invite and publish reactions — ranging from praise and support, to polite or impolite counterarguments, to insults, threats, and abuse. Social media also gives public officials the same tools as the rest of us to block or mute messages and speakers they do not wish to hear.

But the First Amendment imposes certain obligations on public officials, and the rules of the road for how public officials should navigate their social media accounts are only beginning to become clear. Pennsylvania Lt. Gov. John Fetterman learned this the hard way recently, when he responded to and then blocked two men who commented on a tweet about his wife. The men threatened to sue for defamation, and Fetterman eventually unblocked them.

There is an early consensus from the courts on at least one point: public officials who block people from their official social media accounts based on viewpoint are violating the First Amendment. That is what two federal courts held in a case brought by the Knight First Amendment Institute at Columbia University, where I work, after President Donald Trump blocked seven individuals from his @realDonaldTrump Twitter account because they criticized him.

As more political discourse moves to social media, clarifying rules of the road will benefit both public officials and citizens seeking to engage with them. If you’re a public official, how can you reap the benefits of social media without running afoul of the First Amendment? If you’re an individual interacting with officials, what are your rights to speak in social media forums?

Here are a few pointers for public officials, designed to protect the First Amendment rights of individuals to participate in these 21st-century town halls:

Don’t block people from your official account based on viewpoint. If you use a social media account for official purposes, don’t block people from your official social media account, or delete or hide their comments, because of their views.

If you want your account to remain “personal,” don’t use it for official purposes. You’re free to have a social media account and block people from that account if you wish, but you should keep it personal. If you routinely use an account to inform the public and seek input about your official duties or use government staff or equipment to post on your account, then courts are likely to consider it an official, not a personal, account.

Have a social media policy and make it public. If you use a social media account for official purposes, you may come up with reasonable, viewpoint-neutral rules to moderate comments on your account — for example, reasonable limits on permissible topics of conversation, or on the number of comments a single user may make in response to each of your posts. Make sure to publish your policy, so people know what they can and can’t do.

If you moderate comments in your account, be reasonable, viewpoint-neutral, and consistent. If, for instance, you limit what topics people are allowed to address on your account, those limits must be reasonable and viewpoint-neutral, and you must enforce your policy scrupulously, against supporters and critics alike.

You don’t need to allow true threats, but be prepared for criticism. It’s OK to ban “true threats” of physical harm to yourself or your family from your account, but otherwise, as a public official, you must tolerate even sharp personal attacks. Since the founding, our constitutional tradition has reflected “a profound national commitment to the principle that debate on public issues should be uninhibited, robust, and wide-open, and that it may well include vehement, caustic, and sometimes unpleasantly sharp attacks on government and public officials.”

Be open and reasonable in moderating. Penalties for violating your policy should be proportionate; it is almost never appropriate to block someone from your account indefinitely. Instead, give the person a warning and try temporary blocks or muting functions as less severe penalties. If you want to block or delete a comment, say why, and allow the person a chance to correct the problem.

For a more detailed guide, see Social Media for Public Officials 101.