Airbnb is no longer fighting with states and cities only over the laws they will pass to regulate it: The company is fighting with cities over how they will enforce those laws, too. The blocking of a New York ordinance that required home-sharing services to hand over detailed information on listings and hosts offers local legislators a lesson in what not to do.

New York state regulated Airbnb early, and it regulated it restrictively: A rule prohibiting listings in most apartment buildings for stays shorter than 30 days without the host present means that many of the Airbnbs available in Manhattan and its surrounding boroughs are illegal. The stricture is understandably difficult for officials to enforce at scale without automatic access to host information, so the City Council wrote a law of its own demanding that Airbnb provide its records to enforcers every month. A judge has issued an injunction against that law.

Those who backed New York’s rule say they want to ferret out commercial operators who use Airbnb to run de facto hotels without any red tape, or taxes. This is a genuine problem: Airbnb was designed for everyday people to rent out their extra space, in part to help them afford living there in the first place. It was not designed for landlords to run informal and illegal hotels, and housing advocates are right that the practice could endanger affordability where supply is scarce.

But legislatures such as New York state’s have responded to this narrow quandary with broad and burdensome restrictions at the hotel industry’s behest. And now, localities threaten to supplement their overzealous laws with overzealous enforcement regimes. New York’s rule would allow the government to requisition an array of user information without any tailoring to enforcement purposes, or any suspicion of a violation.

The privacy conversation today focuses mostly on protecting users from companies. But users need to be protected from government intrusion, too. Such protection in turn would be easier to achieve if cities and states tried to work with disrupters rather than try to regulate them away.

Airbnb has proposed a compromise bill now pending in Albany that would alter the current regime and set up a registration system so legislators can get the information they actually need to police the platform. Other cities should pursue a similar approach; some, such as Seattle, already have. Different cities have different regulatory and enforcement needs, and figuring out what’s right will require careful rule making. But that’s the point.

FROM AN EDITORIAL IN THE WASHINGTON POST