Just put a lip around the edge.

Or a lid of some kind.

So even if they can reach the edge, they can't get over it.