We present a simple model of an economy with heterogeneous banks that may be funded with uninsured deposits and equity capital. Capital serves to ameliorate a moral hazard problem in the choice of risk. There is a fixed aggregate supply of bank capital, so the cost of capital is endogenous. A regulator sets risk-sensitive capital requirements in order to maximize a social welfare function that incorporates a social cost of bank failure. We consider the effect of a negative shock to the supply of bank capital and show that optimal capital requirements should be lowered. Failure to do so would keep banks safer but produce a large reduction in aggregate investment. The result provides a rationale for the cyclical adjustment of risk-sensitive capital requirements.