  This work studies the dynamic risk management of the risk-neutral value of
the potential credit losses on a portfolio of derivatives. Sensitivities-based
hedging of such liability is sub-optimal because of bid-ask costs, pricing
models which cannot be completely realistic, and a discontinuity at default
time. We leverage recent advances on risk-averse Reinforcement Learning
developed specifically for option hedging with an ad hoc practice-aligned
objective function aware of pathwise volatility, generalizing them to
stochastic horizons. We formalize accurately the evolution of the hedger's
portfolio stressing such aspects. We showcase the efficacy of our approach by a
numerical study for a portfolio composed of a single FX forward contract.
