There are many ways of handling that. But you are never safe from a lawsuit, especially in the United States. You can sue a ham sandwich as the saying goes here.
When you build a bike for someone, it's good practice to have a disclaimer in with your build spec sheet and other information that they need to sign off on. Many bike builders don't even do that! They collect some money and start building. Bad idea.
All you can do is your best when building, using quality parts, and have good training behind you, and then have a disclaimer signed, and carry good insurance for your business.