They only attack if they can. The same logic applies to them as to the player.
For instance, if you firewall is greater than theirs, they can't hack it and steal your money.
The best tactic against the AI controlled servers (in single player) is to use them for bounces/cash until you get to an unhackable server, then destroy them.
I'm getting spammed by AI attacks in level 1 as well. I'm not sure what you mean about 'getting to' an un-hackable server: if the AI really follows the same rules as the player they can launch EMP and DOS attacks to wear you down regardless of your firewall level or links, which is exactly what is happening.
I also compared my run through with the sample video on the Duality website. In the video the AIs have an attack count-down of about 231 seconds, and they launch their attacks against other severs rather than the player. On my attempt (set to easy level) they had a countdown of 160 seconds and attacked me every chance they had. There was no chance to finish the level before getting destroyed.