constrained empty

how do constrain an empty to not go past a barrier like a circle. the empty should not past the line circle barrier for example.