A Yellow Dog contract is legal contract or agreement made between an employer and an employee, wherein the employer agrees to employ the employee, and in exchange the employee agrees not to join or associate with labor unions or craft unions. But Yellow Dog contracts are generally illegal.
In the United States, Yellow Dog contracts are illegal due to the Norris-LaGuardia Act, though right-to-work laws in several US states effectively defeat union formation, but through a different mechanism. 29 U.S.C. § 103(a)-(b) are about nonenforceability of yellow dog contracts.
Prior to the Norris LaGuardia Act (1932) it was legal for an employer to include a Yellow Dog contract, a union-free (unionists called them yellow dogs) provision in his offer of employment.
Any worker who accepted Yellow Dog contract offer of employment would thereby consent to abstain from any sort of union activity.
A law passed by Congress in 1898 made it illegal for employers to fire employees solely on the basis of their participation in labor unions.
The law essentially made the Yellow Dog contract illegal. William Adair, a representative of the Louisville and Nashville Railroad Company, violated the law by firing a locomotive fireman who had joined a union. - Adair v. United States 208 U.S. 161 (1908).
In 1913 the union conducted the great Dublin General Strike. The employers had determined to smash this ever-growing union by the Yellow Dog contract, lockouts of those workers who would not resign their membership.
Most of the Irish nationalist intellectuals supported the strikers against the capitalists. In the end they were forced back to work. But the union was not stamped out and the Yellow Dog contract was not enforced.