Does more leverage always worsen the debt agency problem? This paper presents a unified analysis that accounts for both risk-shifting and under-investment debt agency problems. For firms with positive marginal volatility of investment (defined as the change in cash flow volatility corresponding to a change of investment scale), equity holders' risk-shifting incentive will mitigate the under-investment problem. This implies that, contrary to conventional views, the total agency cost of debt does not uniformly increase with leverage. This model further predicts that, for high growth firms in which the under-investment problem is severe, the optimal debt ratio is positively related to the marginal volatility of investment. Empirical results support this prediction.