This paper studies how credit markets respond to policy constraints on household leverage. Exploiting a sharp policy-induced discontinuity in the cost of originating certain high-leverage mortgages, we study how the Dodd-Frank “Ability-to-Repay” rule affected the price and availability of credit in the U.S. mortgage market. Our estimates show that the policy had only moderate effects on prices, increasing interest rates on affected loans by 10-15 basis points. The effect on quantities, however, was significantly larger; we estimate that the policy eliminated 15 percent of the affected market completely and reduced leverage for another 20 percent of remaining borrowers. This reduction in quantities is much greater than would be implied by plausible demand elasticities and indicates that lenders responded to the policy not only by raising prices but also by exiting the regulated portion of the market. Heterogeneity in the quantity response across lenders suggests that agency costs may have been one particularly important market friction contributing to the large overall effect as the fall in lending was substantially larger among lenders relying on third parties to originate loans. Finally, while the policy succeeded in reducing leverage, our estimates suggest this effect would have only slightly reduced aggregate default rates during the housing crisis.