I'm pretty sure creating and distributing a destructive computer virus is a crime
IANAL but as far as I know there are not really any laws against malicious code directly. You can be held liable for any damages you do though, at least if it was intentionally, since you are the creator and/or distributor.
Which brings us to the main problem: currently no one is legally responsible for an action an AI does