It would be nice to be able to grant political asylum to your allies/friends if they are totally getting owned.
Here are some general outlines before the ai would be willing to accept an asylum offer.
1. Relationship would have to be close or allied.
2. The number of settlements is down to one, or zero.
3. The faction would have to be at war with one or more people.
If the enemy accepts the Asylum offer these things happen
1. They suffer a reduced broken spirit penalty, say 15 percent.
2. You suffer a permanent negative diplomacy modifier with the other faction(s) that were at war with the sov you offered asylum to.
The nice thing is the mechanics are already inplace with the surrender treaty so you can just tweak it to make this viable. And this way I wont have to declare war on a faction because I want to save their leader.