Circle path
You can give your object Copy Location constraint with Empty as a Target and Limit Distance constraint from another Empty with Distance as the radius of you circle. Copy Location tries to move the object to the location of your empty but Limit Distance wont let it. Now you can move another empty as you wish and the object tries to get it but will stay with the circle. Also Limit Distance Clamp Region needs to be On Surface.
You don't need the circle. Just your object and two empties.
Square/Rectangle path
To make to object follow a square or a rectangle you still need your object and two empties. First you have to Copy Location of the empty you want to follow. Next give your object a Limit Distance constraint with Clamp Region Outside a Distance that is greater then the farthest point of your rectangle. Last give your object a Limit Location constraint with minimum Minimum x and y and Maximum x and y that give you the size of your rectangle¨.