Checking up here on a question that appeared on workplace.stackexchange.com: Someone signed a contract saying "If you leave the assignment without giving 15 days prior notice you will be liable to pay these days.". This is in the USA in an at-will employment state, which means the employer can fire the employee at any time without notice, and without these terms the employee could quit at any time without notice.
So the question is: In a US state with at-will employment, are contract terms enforceable that say the employee has to pay the employer if they leave without giving notice? (Extra question: Would it be enforceable if the contract just says that the employee has to give 14 days notice, and would it be enforceable if both employer and employee agreed that 14 days notice are required for each side?) Or does the state law that anyone can cancel an employment contract at any time without reason override this?
(Probably should have mentioned: In this case the OP posting on workplace had just started a low-paid job, figured out that for medical reasons she couldn't do it, wanted to quit, and then found this term in the contract. So Inaki's answer is very useful in general, while user662852's answer is most helpful in this particular case).