A new California law appears to be one of the first to actually criminalize the torture of artificial intelligences. Here are a few excerpted portions of the new law criminalizing the sale of violent video games to minors:
(1) "Violent video game" means a video game in which the range of options available to a player includes killing, maiming, dismembering, or sexually assaulting an image of a human being, if those acts are depicted in the game in a manner that does either of the following: ...
(B) Enables the player to virtually inflict serious injury upon images of human beings or characters with substantially human characteristics in a manner which is especially heinous, cruel, or depraved in that it involves torture or serious physical abuse to the victim.
(2) For purposes of this subdivision, the following definitions apply: ...
(E) "Torture" includes mental as well as physical abuse of the victim. In either case, the virtual victim must be conscious of the abuse at the time it is inflicted; and the player must specifically intend to virtually inflict severe mental or physical pain or suffering upon the victim, apart from killing the victim.
This portion of the law appears to be impotent until such time as someone develops a virtual victim with enough intelligence to be considered to be "conscious".