Within the law, but run away all the same (5)

I believe the answer is:
legit
'within the law' is the definition.
(thesaurus)
I can't explain the remainder of the clue.
Can you help me to learn more?
(Other definitions for legit that I've seen before include "allowed by law, shortly!" , "Genuine" , "Right" , "Honest (abbr)" , "Authorised" .)
