Structural and mechanistic insights into a lysosomal membrane enzyme HGSNAT involved in Sanfilippo syndrome. Here, HGSNAT is linked to mucopolysaccharidosis type 3.