We introduce an adaptive importance sampling method for the loss distribution of credit portfolios based on the Robbins-Monro stochastic approximation procedure. After presenting the subtle construction of the algorithm, we apply our adaptive scheme for calculating the risk figures of a typical medium-sized credit risk portfolio with 2000 obligors. Simulating the tail of the loss distribution, we can improve significantly the variance reduction and outperform other recently proposed importance sampling approaches that are based on deterministic methods providing asymptotically optimal importance sampling distributions. Furthermore, the simple structure of the algorithm not only allows a straightforward implementation, but also offers a lot of flexibility for extensions to more complex models. Therefore, our numerical results motivate interesting future research paths for the application of stochastic approximation methods in risk management.Keywords