Learning to comply