Last time I was in St Petersburg I sent passport details to the private tour company and they provided a document that waived the need to carry my passport ashore.
I suppose it meant that they were responsible for me whilst I was there for a couple of days.