In the US you can ask to see a restaurant’s oyster tags. All restaurants are required to keep these tags and to show them on request. If they don’t have them or won’t produce them, don’t eat the oysters. The tags identify when they were harvested, when they expire and where they were harvested down to a specific zone of a designated harvesting region. If there is a harmful bacterial outbreak and a recall is issued then they can only comply if they have their tags and can identify affected product. Every type of mollusk comes with such a tag. If the restaurant is buying them cooked (i.e. canned) then they will have to tell you as much.
EDIT: I now recall one place I’ve worked that carried canned oysters and each can came with a tag attached as well.
There is no such thing as a guarantee of safety of any kind. With no reliable way of detecting this bacteria until people start getting sick, the smart thing to do is to take advantage of regulation. Also oysters are too amazing to only eat for a third of the year. They taste best chilled on a hot summer day.