Just a short info: when you set the can_force_invade attribute to false for all invasion decisions, the AI won't do those silly attacks on the player anymore that are dependent on peace time, etc.

You probably already figured that out, but I thought it might help somebody.