Teaching Models to Understand (but not Generate) High-risk Data