Since the 18th century the word “slap” was used figuratively as well as literally to mean an attack, slur, censure or reproof, either written or spoken.
The Oxford English Dictionary traces the phrase “slap on the wrist” to 1914 and defines it as “a mild rebuke or criticism.” So a slap on the wrist is a nominal or token punishment which may or may not be appropriate for the crime committed.
All you can do is cross your fingers and hope that if you get a slap on the wrist, it will be because you got caught red-handed with your hand in the cookie jar.