Another option is to move your heir into a castle, it seems to increase the chance that the assination will fail.

I lost my only heir to a Ninja. I cheated and reloaded to find that he was killed again by the ninja. I did this a few times, and he got killed everytime. In desperation I moved him into a castle, and the ninja failed.

Not sure if this is always the case or if I just got lucky, maybe someone else knows?