When the Ninja travel back in time during the mega-weapon debacle, Zane is the one who suggests that they kidnap Nya themselves to preserve the timeline. In Skybound, Zane states that his programming prevents him from violating the law. This suggests one of three things:
1: Zane’s programming did not initially preclude criminal activity but at some point after Ourobouros (his post-rebooted rebuild, for example) it was updated with this caveat
2: Zane’s programming not only precludes him from violating the mortal laws of Ninjago but also those of time itself and is able to prioritise abiding by the laws of time over the laws of Ninjago specifically
3: Kidnapping is legal in Ninjago

