I know that the AI does check the planets for defenses, because I had created a colony in an enemy system and immediately built some WPs... AI wouldn't attack, but as soon as I removed them to upgrade them... he was all over the planet, and needless to say, glassed it.