Article 4 Prohibition of slavery and forced labour
…
3) For the purpose of this article the term “forced or compulsory labour” shall not include:
a) any work required to be done in the ordinary course of detention imposed according to the provisions of Article 5 of this Convention
Article 5 Right to liberty and security
1) Everyone has the right to liberty and security of person. No one shall be deprived of his liberty save in the following cases and in accordance with a procedure prescribed by law:
…
d) the detention of a minor by lawful order for the purpose of educational supervision …