We study the gain of an insider having private information which concerns the default risk of a counterparty. More precisely, the default time τ is modelled as the first time a stochastic process hits a random barrier L. The insider knows this barrier (as it can be the case for example for the manager of the counterparty), whereas standard investors only observe its value at the default time. All investors aim to maximize the expected utility from terminal wealth, on a financial market where the risky asset price is exposed to a sudden loss at the default time of the counterparty. In this framework, the insider's information is modelled by using an initial enlargement of filtration and τ is a stopping time with respect to this enlarged filtration. We prove that the regulator must impose short selling constraints for the insider, in order to exclude the value process to reach infinity. We then solve the optimization problem and we study the gain of the insider, theoretically and numerically. In general, the insider achieves a larger value of expected utility than the standard investor. But in extreme situations for the default and loss risks, a standard investor may in average outperform the insider, by taking advantage of an aggressive short selling position which is not allowed for the insider, but at the risk of big losses if the default finally occurs after the maturity.Keywords : asymmetric information, enlargement of filtrations, counterparty risk, optimal investment, duality, dynamic programming.MSC 2010 : 60H30 91B28 91G40 93E20 * This research is part of a project of Europlace Institute of Finance. We thank