libgdx position of a body in relation of it´s plattform?

i have a plattform with an enemy on top and i want him to move arround without falling from it, what is the best way to detect when he is getting both corners?