We study a principal-agent setting in which both sides learn about future profitability from output, and the project can be abandoned/terminated if profitability is too low. With learning, shirking by the agent both reduces output and lowers the principal’s estimate of future profitability. The agent can exploit this belief discrepancy and earn information rents, reducing his incentives to exert effort. The optimal contract controls information rents to improve incentives by distorting the termination decision. Our results capture the transition from a young, financially constrained firm to a mature firm that pays dividends. For young firms, poor performance permanently raises the termination threshold, as doing so lowers information rents. Mature firms pay smoothed dividends and have a fixed termination threshold. Dividend smoothing occurs because earnings surprises are used to adjust financial slack in line with profitability. When profitability only reflects the agent’s private ability, a simple equity contract is optimal.