This illustrates the principle of informed consent.
In all research experiments the experimenter has to have complete consent from all participants involved. They are required to give them a document to read through explaining the experiment, any risks involved, confirmation of data confidentiality etc. and the participant will sign the document if they agree. This is called informed consent. It protects the experimenter and the participant.