Diplomacy With AI?

Is this works? I remember AI changed teams sometimes.Can 2 AI ally each other?