Pretty sure even if parties agree to something in writing, if it contains provisions that would require you to knowingly commit a crime or be complicit in criminal activity, those provisions are not enforceable in court.