Businesses can reduce risk by having their business entity set up correctly and having the entity governed by shareholder agreements or operating agreements that foresee those risks. Another way to cut risk is to have contracts you use for entering relationships with your customers drafted and reviewed by an attorney.
The goal of a contract is to be written in a way that is fair to the parties and is clear that nobody has to sue anybody down the road. If a lawsuit does occur, the goal would be that once the client is in a good enough position, they don’t have any unpleasant surprises.