I agree with Trev, sometimes I do it even after a civ declared war on me... As it was the case in my actual game: I was in the middle of the industrial age (a period where I prefer to complete my railroad network and the "industrialation" of my cities than to wage wars), but the Portugese sneak-attacked violtating a ROP and taked one of my weakly defended city... BUT they had a MPP with the Ottomans (who where also my neighbor and had a huge army of (their UUs) Sipahis. If I directly striked back, the Ottomans would have attacked me and would certainly have made a lot of havoc. But in that special case the solution is simple : I also signed a MPP with the Ottomans, I did not attack the Portugese during this turn (I just put the bigger ganisons I could in the cities near the border) and of course I put a defendless worker just next to a Portugese riffleman... As expected they captured the worker, the ottomans declared war to them, and the portugese were wiped out in a few turns (I took as many cities as I could, just to avoid to let the ottoman empire growth to much)... I know it is a "classical method" but In that kinds of situations signing a MPP is very powerful and is almost the only thing doable...