Aside from this legal protection, you need to have some practical protection. The answer here is to make yourself a valuable part of the equation. If you aren't adding value, you will definitely need some protection. If however the client finds your involvement to be a boon, the legal parts while being a customary formality will not truly be needed.
You need to get a "Non-compete" agreement drafted by a lawyer. This will protect you a little bit. But I believe there's a time limit on these. I don't think you can legally bind someone for more than 12 months. I don't know for sure. Everytime I get one of these it's always for 12 months.
I would like to say that I really dislike this question as a start-up question from a number of angles. Here is why:
It sort of implies there are no founding partnerships, and no technical expertise in the core of the founding team. This is more the problem.
You should not have to be in a position where the question you ask here comes up. That is what I would encourage whenever possible as you are navigating your venture towards success.
Of course, I make many assumptions which can be wrong so if I didn't assume correctly, then nevermind, but honestly, if I did assume correctly, then what I had said becomes very important IMHO. :)
I agree, a contract for services is the way to go here. You cant be involved with every client on a personal basis. The contract cant stop them taking your work but it will give you a case to take the contractor to court if they do, therefore they are much less likely to do so.