It depends on the length of the prison sentence the agent aboard the Enterprise would receive.
TOS appeared to establish that there are no prison sentences in the future (except with barbaric primitives like Klingons). Just enough time spent in an insane asylum that you get cured of your urge to re-commit this specific crime, after which you can go on with a life of your own choosing.
It would have been a shame to have a Trek movie contradict that fine piece of weird science fiction...
...And a treat to see Chekov emerge from the asylum all reformed, joining our heroic crew once more. Especially if he had previously been pointing a gun at Kirk's head or something.