If interest rates (country spreads) rise, debt can rapidly be subject to a snowball effect, which becomes self-fulfilling with regard to the fundamentals themselves. This is a market imperfection, because we cannot be confident that the unaided market will choose the "good" over the "bad" equilibrium. We propose a policy intervention to deal with this structural weakness in the mechanisms of international capital flows. This is based on a simple taxonomy that breaks down the origin of crises into three components: confidence (spreads and currency crisis), fundamentals (real growth rate), and economic policy (primary deficit). Theory then suggests a set of circumstances in which a lender of first resort would be desirable. The policy would seek to short-circuit confidence crises, partly by using IMF support to improve ex ante incentives. Theory also illuminates the potential role of collective action clauses in reducing the risk of self-fulfilling debt crises.