Keep it covered. The best way to keep unwanted visitors out of your sandbox is to keep it covered whenever it is not being used. A good cover will also keep your sand dry, which will prevent bacteria from growing in it. Many store-bought sandboxes come with covers.