It's likely that they are fungus gnats. I find these to be a pain in the neck. The only harm they could do is to cause a bit of stress to the salamanders, if the gnats are present in large numbers.
It would help to change the substrate, but it's likely the gnats will be back within a couple of weeks. If you want to eradicate them for longer, you would have to sterilize everything going into the tank, and then keep the tank covered with a snugly-fitted piece of cloth (like the kind of cloth from an old bedsheet). I do this with my terrestrial tubs and it sometimes keeps the gnats from getting in for a long time. But once they are inside, the cloth becomes pointless.