Detritus worms pose no direct risk to human health; instead they eat excess waste produced by dead plants and fish in an aquarium environment, often appearing on the substrate but also rising to the surface when conditions deteriorate. They don't pose a direct threat to healthy tank inhabitants but may indicate an urgent need for attention in your aquatic system.
Some aquarists become alarmed when they see detritus worms and assume they are dangerous nematode worms called camallanus or capillaria, which can be deadly to their fish tanks. However, these aren't detritus worms but instead belong to another group known as Annelid detritus worms which can easily be distinguished from them by having head capsules, mandibulate jaws and clear segmentation along their bodies; unlike flat annelid worms which cannot expand and contract their bodies during feeding periods compared with flat annelid worms which cannot.
Detritus worms do not represent a threat to fish that they feed upon; rather they only scavenge dead plant matter, animal waste and dead algae in tanks where fish live. While occasionally they may hitchhike on fish and move between tanks without causing disease in the tank they visit.
Detritus worm populations can be drastically reduced with proper filtration systems and bioload management, and by adding extra rocks to your aquarium and decreasing feeding window to two or three minutes; this limits leftover food falling to the substrate that become food sources for detritus worms. Furthermore, quarantining new fish for several hours before adding them into the main tank ensures they are healthy and free from disease or parasites.