As startup culture has spread to more U.S. cities, a growing number of law firms are offering specialized services to startups, including midsize and boutique firms that are tailoring their business models to entrepreneurs’ needs.

But there’s a reason Silicon Valley fetishes both success and failure: For every breakthrough venture, many more companies fizzle out in early stages, are acquired or operate successfully for a time before encountering financial troubles and going out of business. And that means special risks for their outside counsel.