Depends on what kind of worm. Do you have any pics?
I have plenty of worms that come out on my LR at night and I know they are harmless. I bet more than likely they are safe in your reef tank, but if you could provide a pic it would be easier for us to help.
125 gal. reef w sump/refugium & 8-bulb 640w T5's
45 gal fresh w/plants + CPF lighting
They are fine, I know what your talking about, just cant think of the name for anything right now. There are spaghettie worms (very thin) and some white worms (usually have two "threads" coming out of the hole. Both are harmless.