Check ingredients. You want 100% silicone, no additives for mildew or algae prevention, no colors. There are a couple of brands that will work---I've used Dap, but don't recall the specific name (sorry!).
The bottle I had said 100% clear silicone, with no mildew or mold protection. But it still said not to use it in aquariums. I gusee I will have to keep looking.
I have been told (FWIW) that it is primarily a liability issue. The tube carries (or used to do so) the comment that the material is not tested or approved for food use, but neither are aquaria. When in doubt, bet on the lawyers.