To be clear, are we talking about a metal or plastic sight?
For a metal one (and it should also work with plastic) the fix for a loose sight, (other than some kind of glue) you remove the sight and use a center punch on the bottom of the dovetail slot, raising a burr, which will make the sight fit the slot tighter when (Carefully) reinstalled. This method doesn't show.
Alternately you can stake the front sight in its dovetail from above. This definitely works, but does show. Bending the edge of the dovetail slot slightly also should work, but it needs be done carefully.