This would definitely be illegal in Germany where I work as CTO.
Even having employees sign some letter of acceptance of such would still be illegal as a court would assume an employee was in an uneven power position and therefore not able to refuse even if they wanted to.