to avoid doing anything wrong or illegal
Oxford100% of films
Please make sure that Johnnie keeps his nose clean. It will be done, sir.
Definitions from the Oxford Advanced Learner's Dictionary, 9th edition