The agreement is called a non-competitive agreement.  It has to be reasonable in terms of geographic proximity, scope and duration.If it is overbroad and is the subject of a legal challenge, a court can modify it by limiting its geographic proximity, scope and duration.