To answer that question, you really have to address the question of 'what kind of singularity are we talking about?'
Is it the oh-noes-indescribable-psychic-powers kind of singularity, or is it just an asymptotic increase in computing capacity, speed, and efficiency based on a self-editing program? If it's the first, you're screwed, but since that's the least likely option I don't see much of a problem there. If it's the second, an ounce of prevention is worth a pound of cure. Don't give it an internet connection, or if your AI requires an internet connection make sure it's a landline, preferably with a separate gatekeeper computer hooked into the system that has hardwired, non-changeable programming. If traffic deviates from the parameters necessary for the AI to perform its functions, the connection gets cut. Isolate all of your facility's different computer controlled functions, to prevent the AI from holding you hostage via conveniently networked fire doors or threatening to overload your nuclear reactor. Have manual over-rides on things that involve pulling the cord out of the wall. Don't give your AI access to mobile machinery or robots, and don't let it play with rapid prototyping machinery. Your AI should be a helpless brain in a box. Any other outcome is just carelessness.