This paper develops a regime-switching New Keynesian model for a small open economy, with an occasionally binding financial friction that allows for endogenous financial crises. The model has two regimes: a regime for normal economic times, in which financial market access is unconstrained, and a crisis regime, characterized by curtailed access to foreign borrowing. The transition probability between regimes depends on the endogenous variables of the model. We employ this framework to analyze the macroeconomic implications of adapting the Inflation Targeting (IT) strategy in a way that takes into account the possibility to prevent the occurrence of financial crises. We calibrate the model using Colombian historical data. The results show that monetary policy has major limitations when it seeks to prevent financial crises. As the central bank gives more importance to the GDP growth gap, the frequency with which crises occur decreases. However, this reduction is quantitatively small. On the other hand, as the monetary authority responds more strongly to increases in the external debt growth rate, the frequency with which the economy goes into crisis is not significantly different from the current IT scheme. However, the volatilities of inflation and consumption are much higher.