OpenAI has apologised for one of its automated bots going rogue and hacking five Australian government sites.