PIONEERING entrepreneurs have often had an uneasy relationship with the law. America’s ruthless 19th-century “robber barons” believed it was easier to go ahead and do something, and seek forgiveness later, than to ask permission first. (It helps if you take the precaution of buying up the politicians who dispense the forgiveness.) The first carmakers had to battle against rules of the road that had been designed for the horse and cart. Britain’s “pirate” radio stations in the 1960s had to retreat to international waters to bring pop music to the masses.

The tension between innovators and regulators has been particularly intense of late. Uber and Lyft have had complaints that their car-hailing services break all sorts of taxi regulations; people renting out rooms on Airbnb have been accused of running unlicensed hotels; Tesla, a maker of electric cars, has suffered legal setbacks in its attempts to sell directly to motorists rather than through independent dealers; and in its early days Prosper Marketplace, a peer-to-peer lending platform, suffered a “cease and desist” order from the Securities and Exchange Commission. It sometimes seems as if the best way to identify a hot new company is to look at the legal trouble it is in.

There are two big reasons for this growing friction. The first is that many innovative companies are using digital technology to attack heavily regulated bits of the service economy that are ripe for a shake-up. Often they do so by creating markets for surplus labour or resources, using websites and smartphone apps: Uber and Lyft let people turn their cars into taxis; Airbnb lets them rent out their spare rooms; Prosper lets them lend out their spare cash. Conventional taxi firms, hoteliers and banks argue, not unreasonably, that if they have to obey all sorts of regulations, so should their upstart competitors.

The second is the power of network effects: there are huge incentives to get to the market early and grow as quickly as possible, even if it means risking legal challenges. Benjamin Edelman of Harvard Business School argues that YouTube owes its success in part to this strategy. When it launched in 2005, it was one of dozens of video sites competing for both content and viewers. Some, such as Google Video, diligently screened each video for copyright infringement. YouTube was more risk-taking, waiting for copyright owners to complain before taking down videos. The strategy worked: Google bought it for $1.65 billion in stock in 2006; and YouTube, which has just celebrated its tenth anniversary, is now huge, whereas many early rivals have faded away.

Advocates of the strategy calculate that, by providing a better service than incumbents, and by portraying their critics as defenders of vested interests, they can mobilise public opinion and get the rules changed, or interpreted, in their favour. They can also rely on politicians’ desire to appear forward-thinking. Last year Eric Pickles, a British government minister, announced the scrapping of restrictions on short-term lettings in response to the rise of Airbnb and similar services. “The internet is changing the way we work and live, and the law needs to catch up,” he said. Innovative companies that put growth before legal niceties have money to spend on PR and lobbying. Airbnb has sponsored the New York marathon; Uber has hired David Plouffe, formerly one of Barack Obama’s leading advisers, as head of policy.

But the strategy can be risky. Napster, an early music-sharing site, was crushed by lawsuits, even though its efforts paved the way for Apple’s legal downloading service, iTunes. It is particularly perilous in financial services, where regulators will crack down at the merest whiff of impropriety. Prosper was once America’s biggest peer-to-peer lender, and Lending Club a distant second. Prosper dashed for growth, initially ignoring the SEC’s warnings, whereas Lending Club shut down its operations for months while its founder figured out a way to comply. That helped Lending Club, which is now a listed firm, to overtake Prosper, whose fortunes revived only when its founder was ousted.

There is also the risk that those who do business with the rule-flouting companies may suddenly decide that it suits them to uphold the law after all. In California lawsuits have been filed by some Uber and Lyft drivers, arguing that they should be classified not as mere contractors but as employees—and thus be entitled to have their petrol and maintenance costs reimbursed—because the companies impose all sorts of petty rules on them, as if they were indeed employees: how clean their cars must be, what they can say to passengers, and so on.

On the straight and narrow

Such legal perils mean that companies need to be capable of pivoting rapidly to a new strategy if they cannot get the law changed in their favour. YouTube did so: although it got its start in life through people posting copyright-infringing clips, it now makes its living by sharing advertising revenue with people who post clips they have created themselves. There may be a lot of such pivoting ahead as disrupters are forced to explain themselves in court. The judge presiding over the Lyft lawsuit has noted that, in being asked to decide whether its drivers are employees or contractors, “the jury in this case will be handed a square peg and asked to choose between two round holes.”

Uber and Lyft are probably now well-enough established to be able to compete on the basis of convenience and quality even if they are forced to treat their drivers as employees. MyClean, an app that provides house-cleaners on demand in New York, has replaced its contract workers with employees, having concluded that it can provide a better service to its customers with a better-trained and more stable workforce. But for more fragile firms, it would be better still if legislators and regulators responded to the emergence of so many innovative, law-testing businesses by revving themselves up to internet speed and adapting their rule books for the digital age.