The recent financial crises, especially the debt crisis in Asia, have led to questions su ch as: what are their causes, what is an excessive debt and how vulnerable is an economy to external shocks? We develop an economic model of international finance and debt based upon two sources of uncertainty: the productivity of capital and the real int e rest rate. We use stochastic optimal control-dynamic programming to derive the: optimal consumption, foreign debt, capital, the growth of net worth and the current account. The objective is to maximize the expectation of the discounted value of the utilit y of consumption over an infinite horizon.Crises - and associated social unrest - occur when the unanticipated shocks produce a significant decline in the utility of consumption. We relate our optimality conditions to the vulnerability of the economy to crises. The major conclusions are as follows. (1) We derive explicit and implementable closed form equations for the optimum debt/net worth, which maximize the expectation of the discounted value of utility over an infinite horizon. (2) The derived debt/net worth ratio also maximizes the expected growth of net worth, given any fixed consumption/net worth ratio. (3) The vulnerability of an economy to shocks is positively related to the variance of the utility of consumption at any time. We derive a risk-exp ected return tradeoff. When the debt exceeds the optimum, there is inefficiency. The expected growth of the utility of consumption can be increased, and the vulnerability of the economy - measured by the variance of the utility of consumption - can be decreased by decreasing the debt/net worth ratio.