Research suggests that employees work harder under penalty contracts than under economically equivalent bonus contracts. We build on this literature by examining how the motivational advantage of penalty contracts depends on a common aspect of real-world contracts: payoff ambiguity. With payoff ambiguity, employees provide effort without knowing how much pay they will receive for a given level of performance. According to our theory, this ambiguity opens the door for employee optimism, which has contrasting effects under each contract frame. Results from an experiment support this theory, with an increase in ambiguity leading to less employee effort with penalty contracts (as employees optimistically expect small penalties) and more effort with bonus contracts (as employees optimistically expect large bonuses). We also find that these effects are stronger for more dispositionally optimistic employees. Overall, our results suggest that bonus contracts may be more motivating and penalty contracts less motivating than previously thought.