As close as 50 feet to the beach... which means just outside the surf zone on most beaches.
And yes, you are correct, sharks can go anywhere they pretty much want to go... but how likely are they to go into small bays and inlets.
Of course that said... where I keep my boat, it is quite near a huge bait barge... where all the seals gather... talk about "homing beacon."
Needless to say, I am not doing my usual mile long rough water swims this season... D'oh! That particular beach has already been closed a couple of times... The pool looks just fine this year.