Your first example is illegal in most places. The second is perfectly normal practice - it's in most contracts and stands to reason - if you're introduced to a client by your employer and you jump ship to work for them, it represents a breach of trust.