Using a unique data set with detailed information on the derivative positions of upstream oil and gas firms during 1996-2008, we find that hedging intensity is positively related to factors that amplify chief executive officer (CEO) entrenchment and free cash flow agency costs. There is also robust evidence that hedging is motivated by the reduction of financial distress and borrowing costs, and that it is influenced by both intrinsic cash flow risk and temporary spikes in commodity price volatility. We present a comprehensive perspective on the determinants of corporate hedging, and the results are consistent with the predictions of the risk management and agency costs literatures.