We study the problem of portfolio insurance from the point of view of a fund
manager, who guarantees to the investor that the portfolio value at maturity
will be above a fixed threshold. If, at maturity, the portfolio value is below
the guaranteed level, a third party will refund the investor up to the
guarantee. In exchange for this protection, the third party imposes a limit on
the risk exposure of the fund manager, in the form of a convex monetary risk
measure. The fund manager therefore tries to maximize the investor's utility
function subject to the risk measure constraint.We give a full solution to this
nonconvex optimization problem in the complete market setting and show in
particular that the choice of the risk measure is crucial for the optimal
portfolio to exist. Explicit results are provided for the entropic risk measure
(for which the optimal portfolio always exists) and for the class of spectral
risk measures (for which the optimal portfolio may fail to exist in some
cases).