Re: "Until you go to court how do you know it's illegal?"
This is safety critical software. Nothing goes in to the software design without extensive review and sign off from senior management.
Engineers do not make those decisions. No engineer can sneak code in, there will be extensive code reviews and testing before management sign off that the code is doing what it is designed to do.
I hope that VW honour whatever arrangement they came up with for this guy because he's kept a lot of nervous senior management out of the court's firing line.