This paper provides welfare theoretic foundations for risk-adjusted capital flow regulations based on a standard class of macroeconomic models of financial crises that exhibit financial amplification dynamics. We show that during crisis episodes when such amplification effects are triggered, decentralized agents do not internalize that capital outflows are magnified through a systemic feedback cycle of depreciating exchange rates, tightening financial constraints, and declining aggregate demand, akin to Fisher's process of debt deflation. As a result, agents undervalue the social cost of repayments in crisis states and take on too much systemic crisis risk in their ex ante financing decisions. We construct an externality kernel that captures the state-contingent magnitude of systemic externalities of outflows. Constrained social efficiency can be restored by imposing Pigovian taxes on capital inflows that can be calculated as the product of the externality kernel times the state-contingent vector of payoffs of the respective type of financial instrument. We develop a sufficient statistics method to quantify the externalities imposed by different categories of capital flows. Using historical data from Indonesia, we find that optimal Pigovian taxes range from approximately zero for FDI flows to 1.54% for foreign currency-denominated debt.