That question is simultaneously very simple and very complex to answer. We'll tackle the simple answer first. Generally, a covenant not to compete is enforceable under Texas law when it complies with Section 15.50(a) of Texas Business and Commerce Code which provides:
“[A] covenant not to compete is enforceable if it is ancillary to or part of an otherwise enforceable agreement at the time the agreement is made to the extent that it contains limitations as to time, geographical area, and scope of activity to be restrained that are reasonable and do not impose a greater restraint than is necessary to protect the goodwill or other business interest of the promisee.”
So when is a covenant not to compete "ancillary to or part of" an otherwise enforceable agreement? That's the complex answer.
In 1994, the Texas Supreme Court took a stab at answering that question when it decided the case of Light v. Centel Cellular Co. of Texas. In Light, the court established a two-pronged test:
"(1) the consideration given by the employer in the otherwise enforceable agreement must give rise to the employer’s interest in restraining the employee from competing; and
(2) the covenant must be designed to enforce the employee’s consideration or return promise in the otherwise enforceable agreement."
Under Light, an employer's promise to provide confidential information and trade secrets to its employee contemporaneously with the signing of a non-competition agreement would be enforceable as a covenant ancillary to an otherwise enforceable agreement. On the other hand, under Light, if the employer does not promise to provide confidential information or trade secrets as part of the agreement (even if the employee later actually does receive such confidential information or trade secrets!), the covenant would not be enforceable because at the time the contract was signed it was a unilateral contract - the employer could fire the at-will employee the next day and never provide such confidential information or trade secrets, so the parties didn't have an "otherwise enforceable agreement."
Since 1994, the Texas Supreme Court has slowly backed away from its very narrow reading of Section 15.50(a) of the Texas Business and Commerce Code in Light.
In 2006, in Alex Sheshunoff Management Services, L.P. v. Johnson, the Texas Supreme Court removed Light's restrictions on enforcing executory unilateral contracts. Hence, a covenant not to compete made by an employee in exchange for an employer's confidential information or trade secrets may now be enforced so long as such confidential information or trade secrets are actually delivered to the employee during the course of his or her employment, even if the employer was not contractually obligated to provide such information at the time the agreement was signed.
In 2011, in Marsh v. Cook, the Texas Supreme Court further liberalized the holding in Light, thereby further expanding the types of agreements which could give rise to an enforceable covenant not to compete. In Marsh, the court ruled that the grant of stock options to an employee could be sufficient to support a covenant not to compete. The court reasoned that the grant of stock options to the employee was reasonably related to the employer's legitimate business interest in protecting its goodwill. The Marsh court thus rejected the Light court's requirement that the otherwise enforceable agreement must "give rise" to the employer's interest in enforcing the covenant not to compete and replaced it with a requirement that the otherwise enforceable agreement "reasonably relate" to the employer's interest.
Although determining the enforceability of any particular covenant not to compete under Texas law continues to be challenging and fact-specific, there is recent trend at the Texas Supreme Court toward making such covenants easier to enforce.