The shaliach who carries out the task stands in for the one who appointed him. Sh’lucho shel adam k’moto, “A person’s agent is as himself” is the frequently stated rabbinic principle, though Rabbi Isaac Herzog points out that there are two ways of understanding this rule – either it means the agent is for this purpose the one who sent him, or he is like an extension of the principal’s hand (“The Main Institutions of Jewish Law”, vol. 2, pages 142 etc.).
However, if the act for which the shaliach has been appointed is unlawful, it is no defence for the agent to claim, “I was only following orders”. In this case the rule is ein shaliach lid’var averah, “Agency does not apply to a transgression”.
Both the principal and the agent are obligated to obey the law and have no right to carry out an averah. Hence the so-called defence of superior orders cannot justify an offence against law or morality.