This paper deals with certain basic aspects of the medical treatment of detainees and prisoners. Emphasis is placed on the requirement that the responsible doctor should have the fullest possible degree of professional discretion. The rules pertaining to professional confidentiality are not suspended in the prison situation. The question as to whether a doctor should work in a situation which in general is not ethically acceptable to him is discussed. Reference is made to the Declaration of Tokyo and South African positive law is examined.