Aware that they were on tenuous legal ground , agency officials at headquarters insisted on approving each new step -- a night without sleep , a session of waterboarding , even a " belly slap " -- in an exchange of encrypted messages .